Merge pull request #2701 from ByteHamster/preference-search-update
Improve autodownload in search
This commit is contained in:
commit
03b2079087
|
@ -180,7 +180,7 @@ dependencies {
|
||||||
implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
|
implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
|
||||||
|
|
||||||
implementation 'com.github.mfietz:fyydlin:v0.3'
|
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"
|
androidTestImplementation "com.jayway.android.robotium:robotium-solo:$robotiumSoloVersion"
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
|
|
||||||
|
import com.bytehamster.lib.preferencesearch.SearchConfiguration;
|
||||||
import com.bytehamster.lib.preferencesearch.SearchPreference;
|
import com.bytehamster.lib.preferencesearch.SearchPreference;
|
||||||
import de.danoeh.antennapod.activity.AboutActivity;
|
import de.danoeh.antennapod.activity.AboutActivity;
|
||||||
import de.danoeh.antennapod.activity.ImportExportActivity;
|
import de.danoeh.antennapod.activity.ImportExportActivity;
|
||||||
|
@ -561,32 +562,33 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||||
final AppCompatActivity activity = ui.getActivity();
|
final AppCompatActivity activity = ui.getActivity();
|
||||||
|
|
||||||
SearchPreference searchPreference = (SearchPreference) ui.findPreference("searchPreference");
|
SearchPreference searchPreference = (SearchPreference) ui.findPreference("searchPreference");
|
||||||
searchPreference.setActivity(activity);
|
SearchConfiguration config = searchPreference.getSearchConfiguration();
|
||||||
searchPreference.setFragmentContainerViewId(R.id.content);
|
config.setActivity(activity);
|
||||||
searchPreference.setBreadcrumbsEnabled(true);
|
config.setFragmentContainerViewId(R.id.content);
|
||||||
|
config.setBreadcrumbsEnabled(true);
|
||||||
|
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_user_interface))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_user_interface))
|
||||||
.addFile(R.xml.preferences_user_interface);
|
.addFile(R.xml.preferences_user_interface);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_playback))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_playback))
|
||||||
.addFile(R.xml.preferences_playback);
|
.addFile(R.xml.preferences_playback);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_network))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_network))
|
||||||
.addFile(R.xml.preferences_network);
|
.addFile(R.xml.preferences_network);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_storage))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_storage))
|
||||||
.addFile(R.xml.preferences_storage);
|
.addFile(R.xml.preferences_storage);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_network))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_network))
|
||||||
.addBreadcrumb(R.string.automation)
|
.addBreadcrumb(R.string.automation)
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_autodownload))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_autodownload))
|
||||||
.addFile(R.xml.preferences_autodownload);
|
.addFile(R.xml.preferences_autodownload);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations))
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_gpodder))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_gpodder))
|
||||||
.addFile(R.xml.preferences_gpodder);
|
.addFile(R.xml.preferences_gpodder);
|
||||||
searchPreference.index()
|
config.index()
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_integrations))
|
||||||
.addBreadcrumb(getTitleOfPage(R.xml.preferences_flattr))
|
.addBreadcrumb(getTitleOfPage(R.xml.preferences_flattr))
|
||||||
.addFile(R.xml.preferences_flattr);
|
.addFile(R.xml.preferences_flattr);
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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
|
<de.danoeh.antennapod.preferences.MasterSwitchPreference
|
||||||
android:key="prefEnableAutoDl"
|
android:key="prefEnableAutoDl"
|
||||||
android:title="@string/pref_automatic_download_title"
|
android:title="@string/pref_automatic_download_title"
|
||||||
|
search:summary="@string/pref_automatic_download_sum"
|
||||||
android:defaultValue="false"/>
|
android:defaultValue="false"/>
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="25"
|
android:defaultValue="25"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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">
|
<PreferenceCategory android:title="@string/automation">
|
||||||
<Preference
|
<Preference
|
||||||
android:key="prefAutoUpdateIntervall"
|
android:key="prefAutoUpdateIntervall"
|
||||||
|
@ -16,7 +17,8 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:summary="@string/pref_automatic_download_sum"
|
android:summary="@string/pref_automatic_download_sum"
|
||||||
android:key="prefAutoDownloadSettings"
|
android:key="prefAutoDownloadSettings"
|
||||||
android:title="@string/pref_automatic_download_title" />
|
android:title="@string/pref_automatic_download_title"
|
||||||
|
search:ignore="true" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/download_pref_details">
|
<PreferenceCategory android:title="@string/download_pref_details">
|
||||||
|
|
Loading…
Reference in New Issue