diff options
author | ByteHamster <info@bytehamster.com> | 2018-05-18 11:54:53 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-05-18 11:54:53 +0200 |
commit | cddc1a7354514f005b59970bf2f4cc27a7942ba3 (patch) | |
tree | a99a191229975d77ce9d3f5b049553bccd83dea7 | |
parent | ed4b7dd96f726cecd51765281d159e0e6d87366c (diff) | |
download | AntennaPod-cddc1a7354514f005b59970bf2f4cc27a7942ba3.zip |
Improve autodownload in search
-rw-r--r-- | app/build.gradle | 2 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 22 | ||||
-rw-r--r-- | app/src/main/res/xml/preferences_autodownload.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/xml/preferences_network.xml | 6 |
4 files changed, 20 insertions, 14 deletions
diff --git a/app/build.gradle b/app/build.gradle index 62c606e0b..6c8abbdff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -180,7 +180,7 @@ dependencies { implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion" implementation 'com.github.mfietz:fyydlin:v0.3' - implementation 'com.github.ByteHamster:SearchPreference:v1.0.3' + implementation 'com.github.ByteHamster:SearchPreference:v1.0.8' androidTestImplementation "com.jayway.android.robotium:robotium-solo:$robotiumSoloVersion" } diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 31a31adb4..9bb0edeb2 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -37,6 +37,7 @@ import android.widget.Toast; import com.afollestad.materialdialogs.MaterialDialog; +import com.bytehamster.lib.preferencesearch.SearchConfiguration; import com.bytehamster.lib.preferencesearch.SearchPreference; import de.danoeh.antennapod.activity.AboutActivity; import de.danoeh.antennapod.activity.ImportExportActivity; @@ -561,32 +562,33 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc final AppCompatActivity activity = ui.getActivity(); SearchPreference searchPreference = (SearchPreference) ui.findPreference("searchPreference"); - searchPreference.setActivity(activity); - searchPreference.setFragmentContainerViewId(R.id.content); - searchPreference.setBreadcrumbsEnabled(true); + SearchConfiguration config = searchPreference.getSearchConfiguration(); + config.setActivity(activity); + config.setFragmentContainerViewId(R.id.content); + config.setBreadcrumbsEnabled(true); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_user_interface)) .addFile(R.xml.preferences_user_interface); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_playback)) .addFile(R.xml.preferences_playback); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_network)) .addFile(R.xml.preferences_network); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_storage)) .addFile(R.xml.preferences_storage); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_network)) .addBreadcrumb(R.string.automation) .addBreadcrumb(getTitleOfPage(R.xml.preferences_autodownload)) .addFile(R.xml.preferences_autodownload); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations)) .addBreadcrumb(getTitleOfPage(R.xml.preferences_gpodder)) .addFile(R.xml.preferences_gpodder); - searchPreference.index() + config.index() .addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations)) .addBreadcrumb(getTitleOfPage(R.xml.preferences_flattr)) .addFile(R.xml.preferences_flattr); diff --git a/app/src/main/res/xml/preferences_autodownload.xml b/app/src/main/res/xml/preferences_autodownload.xml index 037e92d75..b5e3182f0 100644 --- a/app/src/main/res/xml/preferences_autodownload.xml +++ b/app/src/main/res/xml/preferences_autodownload.xml @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:search="http://schemas.android.com/apk/com.bytehamster.lib.preferencesearch"> <de.danoeh.antennapod.preferences.MasterSwitchPreference android:key="prefEnableAutoDl" android:title="@string/pref_automatic_download_title" + search:summary="@string/pref_automatic_download_sum" android:defaultValue="false"/> <ListPreference android:defaultValue="25" diff --git a/app/src/main/res/xml/preferences_network.xml b/app/src/main/res/xml/preferences_network.xml index 05f960219..0ab8e5866 100644 --- a/app/src/main/res/xml/preferences_network.xml +++ b/app/src/main/res/xml/preferences_network.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:search="http://schemas.android.com/apk/com.bytehamster.lib.preferencesearch"> <PreferenceCategory android:title="@string/automation"> <Preference android:key="prefAutoUpdateIntervall" @@ -16,7 +17,8 @@ <Preference android:summary="@string/pref_automatic_download_sum" android:key="prefAutoDownloadSettings" - android:title="@string/pref_automatic_download_title" /> + android:title="@string/pref_automatic_download_title" + search:ignore="true" /> </PreferenceCategory> <PreferenceCategory android:title="@string/download_pref_details"> |