This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
Allow support PreferenceFragment with @PreferenceScreen #1397
Closed
WonderCsabo
wants to merge
3
commits into
androidannotations:develop
from
WonderCsabo:1396_supportPreferenceFragmentFromSupportLibrary
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ns/androidannotations/src/test/java/android/support/v4/preference/PreferenceFragment.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package android.support.v4.preference; | ||
|
|
||
| import android.app.Fragment; // for the test it is OK to extend normal Fragment | ||
|
|
||
| public abstract class PreferenceFragment extends Fragment { | ||
|
|
||
| public void addPreferencesFromResource(int preferencesResId) { | ||
|
|
||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...notations/src/test/java/com/github/machinarius/preferencefragment/PreferenceFragment.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package com.github.machinarius.preferencefragment; | ||
|
|
||
| import android.app.Fragment; // for the test it is OK to extend normal Fragment | ||
|
|
||
| public abstract class PreferenceFragment extends Fragment { | ||
|
|
||
| public void addPreferencesFromResource(int preferencesResId) { | ||
|
|
||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
...otations/src/test/java/org/androidannotations/preference/MachinariusSettingsFragment.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package org.androidannotations.preference; | ||
|
|
||
| import org.androidannotations.annotations.EFragment; | ||
| import org.androidannotations.annotations.PreferenceScreen; | ||
|
|
||
| import com.github.machinarius.preferencefragment.PreferenceFragment; | ||
|
|
||
| @PreferenceScreen(R.xml.preferences) | ||
| @EFragment | ||
| public class MachinariusSettingsFragment extends PreferenceFragment { | ||
|
|
||
| } |
46 changes: 46 additions & 0 deletions
46
...idannotations/src/test/java/org/androidannotations/preference/PreferenceFragmentTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package org.androidannotations.preference; | ||
|
|
||
| import org.androidannotations.AndroidAnnotationProcessor; | ||
| import org.androidannotations.utils.AAProcessorTestHelper; | ||
| import org.junit.Before; | ||
| import org.junit.Test; | ||
|
|
||
| public class PreferenceFragmentTest extends AAProcessorTestHelper { | ||
|
|
||
| @Before | ||
| public void setUp() { | ||
| addManifestProcessorParameter(PreferenceFragmentTest.class); | ||
| addProcessor(AndroidAnnotationProcessor.class); | ||
| } | ||
|
|
||
| @Test | ||
| public void preferenceFragmentCompiles() { | ||
| assertCompilationSuccessful(compileFiles(SettingsFragment.class)); | ||
| } | ||
|
|
||
| @Test | ||
| public void supportPreferenceFragmentCompiles() { | ||
| assertCompilationSuccessful(compileFiles(SupportSettingsFragment.class)); | ||
| } | ||
|
|
||
| @Test | ||
| public void machinariusPreferenceFragmentCompiles() { | ||
| assertCompilationSuccessful(compileFiles(MachinariusSettingsFragment.class)); | ||
| } | ||
|
|
||
| } |
7 changes: 7 additions & 0 deletions
7
AndroidAnnotations/androidannotations/src/test/java/org/androidannotations/preference/R.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package org.androidannotations.preference; | ||
|
|
||
| public class R { | ||
| public static final class xml { | ||
| public static final int preferences = 0x7f06000a; | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
.../androidannotations/src/test/java/org/androidannotations/preference/SettingsFragment.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package org.androidannotations.preference; | ||
|
|
||
| import org.androidannotations.annotations.EFragment; | ||
| import org.androidannotations.annotations.PreferenceScreen; | ||
|
|
||
| import android.preference.PreferenceFragment; | ||
|
|
||
| @PreferenceScreen(R.xml.preferences) | ||
| @EFragment | ||
| public class SettingsFragment extends PreferenceFragment { | ||
|
|
||
| } | ||
27 changes: 27 additions & 0 deletions
27
...dannotations/src/test/java/org/androidannotations/preference/SupportSettingsFragment.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /** | ||
| * Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| * use this file except in compliance with the License. You may obtain a copy of | ||
| * the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed To in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
| package org.androidannotations.preference; | ||
|
|
||
| import org.androidannotations.annotations.EFragment; | ||
| import org.androidannotations.annotations.PreferenceScreen; | ||
|
|
||
| import android.support.v4.preference.PreferenceFragment; | ||
|
|
||
| @PreferenceScreen(R.xml.preferences) | ||
| @EFragment | ||
| public class SupportSettingsFragment extends PreferenceFragment { | ||
|
|
||
| } |
24 changes: 24 additions & 0 deletions
24
...droidannotations/src/test/resources/org/androidannotations/preference/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
|
|
||
| Copyright (C) 2010-2015 eBusiness Information, Excilys Group | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
| use this file except in compliance with the License. You may obtain a copy of | ||
| the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed To in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| License for the specific language governing permissions and limitations under | ||
| the License. | ||
|
|
||
| --> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="org.androidannotations.preference" | ||
| android:versionCode="1" | ||
| android:versionName="1.0" > | ||
|
|
||
| </manifest> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't that be
android.support.v4.preference.PreferenceFragment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok nevermind. just saw that the next file had the support version.