diff options
45 files changed, 826 insertions, 535 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index 12d918a76..83578ff5c 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceFragment; +import android.preference.PreferenceScreen; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.Menu; @@ -24,13 +25,25 @@ import de.danoeh.antennapod.preferences.PreferenceController; */ public class PreferenceActivity extends AppCompatActivity { + public static final String PARAM_RESOURCE = "resource"; private static WeakReference<PreferenceActivity> instance; private PreferenceController preferenceController; - private MainFragment prefFragment; private final PreferenceController.PreferenceUI preferenceUI = new PreferenceController.PreferenceUI() { + private PreferenceFragment fragment; + + @Override + public void setFragment(PreferenceFragment fragment) { + this.fragment = fragment; + } + @Override public Preference findPreference(CharSequence key) { - return prefFragment.findPreference(key); + return fragment.findPreference(key); + } + + @Override + public PreferenceScreen getPreferenceScreen() { + return fragment.getPreferenceScreen(); } @Override @@ -64,7 +77,11 @@ public class PreferenceActivity extends AppCompatActivity { // since the MainFragment depends on the preferenceController already being created preferenceController = new PreferenceController(preferenceUI); - prefFragment = new MainFragment(); + PreferenceFragment prefFragment = new MainFragment(); + preferenceUI.setFragment(prefFragment); + Bundle args = new Bundle(); + args.putInt(PARAM_RESOURCE, R.xml.preferences); + prefFragment.setArguments(args); getFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit(); } @@ -84,7 +101,11 @@ public class PreferenceActivity extends AppCompatActivity { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: - finish(); + if (getFragmentManager().getBackStackEntryCount() == 0) { + finish(); + } else { + getFragmentManager().popBackStack(); + } return true; default: return false; @@ -97,10 +118,11 @@ public class PreferenceActivity extends AppCompatActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); - addPreferencesFromResource(R.xml.preferences); + addPreferencesFromResource(getArguments().getInt(PARAM_RESOURCE)); PreferenceActivity activity = instance.get(); - if(activity != null && activity.preferenceController != null) { - activity.preferenceController.onCreate(); + if (activity != null && activity.preferenceController != null) { + activity.preferenceUI.setFragment(this); + activity.preferenceController.onCreate(getArguments().getInt(PARAM_RESOURCE)); } } @@ -109,7 +131,28 @@ public class PreferenceActivity extends AppCompatActivity { super.onResume(); PreferenceActivity activity = instance.get(); if(activity != null && activity.preferenceController != null) { - activity.preferenceController.onResume(); + activity.setTitle(getTitle(getArguments().getInt(PARAM_RESOURCE))); + activity.preferenceUI.setFragment(this); + activity.preferenceController.onResume(getArguments().getInt(PARAM_RESOURCE)); + } + } + + private int getTitle(int preferences) { + switch (preferences) { + case R.xml.preferences_network: + return R.string.network_pref; + case R.xml.preferences_autodownload: + return R.string.pref_automatic_download_title; + case R.xml.preferences_playback: + return R.string.playback_pref; + case R.xml.preferences_storage: + return R.string.storage_pref; + case R.xml.preferences_user_interface: + return R.string.user_interface_label; + case R.xml.preferences_integrations: + return R.string.integrations_label; + default: + return R.string.settings_label; } } @@ -117,7 +160,8 @@ public class PreferenceActivity extends AppCompatActivity { public void onPause() { PreferenceActivity activity = instance.get(); if(activity != null && activity.preferenceController != null) { - activity.preferenceController.onPause(); + activity.preferenceUI.setFragment(this); + activity.preferenceController.onPause(getArguments().getInt(PARAM_RESOURCE)); } super.onPause(); } @@ -126,6 +170,7 @@ public class PreferenceActivity extends AppCompatActivity { public void onStop() { PreferenceActivity activity = instance.get(); if(activity != null && activity.preferenceController != null) { + activity.preferenceUI.setFragment(this); activity.preferenceController.onStop(); } super.onStop(); diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java new file mode 100644 index 000000000..bcac65804 --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java @@ -0,0 +1,45 @@ +package de.danoeh.antennapod.preferences; + +import android.annotation.TargetApi; +import android.content.Context; +import android.graphics.Typeface; +import android.os.Build; +import android.util.AttributeSet; +import android.util.TypedValue; +import android.view.View; +import android.widget.TextView; +import de.danoeh.antennapod.R; + +public class MasterSwitchPreference extends SwitchCompatPreference { + + public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + public MasterSwitchPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public MasterSwitchPreference(Context context) { + super(context); + } + + @Override + protected void onBindView(View view) { + super.onBindView(view); + + TypedValue typedValue = new TypedValue(); + getContext().getTheme().resolveAttribute(R.attr.master_switch_background, typedValue, true); + view.setBackgroundColor(typedValue.data); + + TextView title = (TextView) view.findViewById(android.R.id.title); + if (title != null) { + title.setTypeface(title.getTypeface(), Typeface.BOLD); + } + } +}
\ No newline at end of file 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 0e9cf73e0..b2d1fa4d2 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.preferences; import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; +import android.app.Fragment; import android.app.ProgressDialog; import android.app.TimePickerDialog; import android.content.ActivityNotFoundException; @@ -16,10 +17,12 @@ import android.net.Uri; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiManager; import android.os.Build; +import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.preference.PreferenceScreen; import android.support.design.widget.Snackbar; @@ -38,9 +41,21 @@ import android.widget.Toast; import com.afollestad.materialdialogs.MaterialDialog; +import de.danoeh.antennapod.activity.AboutActivity; import com.afollestad.materialdialogs.prefs.MaterialListPreference; import de.danoeh.antennapod.activity.ImportExportActivity; +import de.danoeh.antennapod.activity.MediaplayerActivity; import de.danoeh.antennapod.activity.OpmlImportFromPathActivity; +import de.danoeh.antennapod.activity.PreferenceActivity; +import de.danoeh.antennapod.activity.StatisticsActivity; +import de.danoeh.antennapod.core.export.html.HtmlWriter; +import de.danoeh.antennapod.core.export.opml.OpmlWriter; +import de.danoeh.antennapod.core.service.GpodnetSyncService; +import de.danoeh.antennapod.dialog.AuthenticationDialog; +import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog; +import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog; +import de.danoeh.antennapod.dialog.ProxyDialog; +import de.danoeh.antennapod.dialog.VariableSpeedDialog; import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil; import org.apache.commons.lang3.ArrayUtils; @@ -55,30 +70,21 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.CrashReportWriter; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.AboutActivity; import de.danoeh.antennapod.activity.DirectoryChooserActivity; import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.activity.MediaplayerActivity; -import de.danoeh.antennapod.activity.StatisticsActivity; import de.danoeh.antennapod.asynctask.ExportWorker; import de.danoeh.antennapod.core.export.ExportWriter; -import de.danoeh.antennapod.core.export.html.HtmlWriter; -import de.danoeh.antennapod.core.export.opml.OpmlWriter; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.GpodnetSyncService; import de.danoeh.antennapod.core.util.flattr.FlattrUtils; -import de.danoeh.antennapod.dialog.AuthenticationDialog; -import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog; import de.danoeh.antennapod.dialog.ChooseDataFolderDialog; -import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog; -import de.danoeh.antennapod.dialog.ProxyDialog; -import de.danoeh.antennapod.dialog.VariableSpeedDialog; import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; +import static de.danoeh.antennapod.activity.PreferenceActivity.PARAM_RESOURCE; + /** * Sets up a preference UI that lets the user change user preferences. */ @@ -87,6 +93,13 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc private static final String TAG = "PreferenceController"; + private static final String PREF_SCREEN_USER_INTERFACE = "prefScreenInterface"; + private static final String PREF_SCREEN_PLAYBACK = "prefScreenPlayback"; + private static final String PREF_SCREEN_NETWORK = "prefScreenNetwork"; + private static final String PREF_SCREEN_INTEGRATIONS = "prefScreenIntegrations"; + private static final String PREF_SCREEN_STORAGE = "prefScreenStorage"; + private static final String PREF_SCREEN_AUTODL = "prefAutoDownloadSettings"; + private static final String PREF_FLATTR_SETTINGS = "prefFlattrSettings"; private static final String PREF_FLATTR_AUTH = "pref_flattr_authenticate"; private static final String PREF_FLATTR_REVOKE = "prefRevokeAccess"; @@ -98,7 +111,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc private static final String IMPORT_EXPORT = "importExport"; private static final String PREF_ABOUT = "prefAbout"; private static final String PREF_CHOOSE_DATA_DIR = "prefChooseDataDir"; - private static final String AUTO_DL_PREF_SCREEN = "prefAutoDownloadSettings"; private static final String PREF_PLAYBACK_SPEED_LAUNCHER = "prefPlaybackSpeedLauncher"; private static final String PREF_PLAYBACK_REWIND_DELTA_LAUNCHER = "prefPlaybackRewindDeltaLauncher"; private static final String PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER = "prefPlaybackFastForwardDeltaLauncher"; @@ -145,7 +157,40 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } } - public void onCreate() { + + + public void onCreate(int screen) { + switch (screen) { + case R.xml.preferences: + setupMainScreen(); + break; + case R.xml.preferences_network: + setupNetworkScreen(); + break; + case R.xml.preferences_autodownload: + setupAutoDownloadScreen(); + buildAutodownloadSelectedNetworsPreference(); + setSelectedNetworksEnabled(UserPreferences.isEnableAutodownloadWifiFilter()); + buildEpisodeCleanupPreference(); + break; + case R.xml.preferences_playback: + setupPlaybackScreen(); + PreferenceControllerFlavorHelper.setupFlavoredUI(ui); + buildSmartMarkAsPlayedPreference(); + break; + case R.xml.preferences_integrations: + setupIntegrationsScreen(); + break; + case R.xml.preferences_storage: + setupStorageScreen(); + break; + case R.xml.preferences_user_interface: + setupInterfaceScreen(); + break; + } + } + + private void setupInterfaceScreen() { final Activity activity = ui.getActivity(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { @@ -160,25 +205,34 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } ); } - ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setOnPreferenceClickListener( - preference -> { - FlattrUtils.revokeAccessToken(activity); - checkItemVisibility(); - return true; - } - ); - ui.findPreference(PreferenceController.PREF_ABOUT).setOnPreferenceClickListener( - preference -> { - activity.startActivity(new Intent(activity, AboutActivity.class)); + ui.findPreference(UserPreferences.PREF_THEME) + .setOnPreferenceChangeListener( + (preference, newValue) -> { + Intent i = new Intent(activity, MainActivity.class); + i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK + | Intent.FLAG_ACTIVITY_NEW_TASK); + activity.finish(); + activity.startActivity(i); + return true; + } + ); + ui.findPreference(UserPreferences.PREF_HIDDEN_DRAWER_ITEMS) + .setOnPreferenceClickListener(preference -> { + showDrawerPreferencesDialog(); return true; - } - ); - ui.findPreference(PreferenceController.STATISTICS).setOnPreferenceClickListener( - preference -> { - activity.startActivity(new Intent(activity, StatisticsActivity.class)); + }); + + ui.findPreference(UserPreferences.PREF_COMPACT_NOTIFICATION_BUTTONS) + .setOnPreferenceClickListener(preference -> { + showNotificationButtonsDialog(); return true; - } - ); + }); + + } + + private void setupStorageScreen() { + final Activity activity = ui.getActivity(); + ui.findPreference(PreferenceController.IMPORT_EXPORT).setOnPreferenceClickListener( preference -> { activity.startActivity(new Intent(activity, ImportExportActivity.class)); @@ -227,43 +281,131 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc return true; } ); - ui.findPreference(UserPreferences.PREF_THEME) - .setOnPreferenceChangeListener( - (preference, newValue) -> { - Intent i = new Intent(activity, MainActivity.class); - i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK - | Intent.FLAG_ACTIVITY_NEW_TASK); - activity.finish(); - activity.startActivity(i); - return true; + ui.findPreference(UserPreferences.PREF_IMAGE_CACHE_SIZE).setOnPreferenceChangeListener( + (preference, o) -> { + if (o instanceof String) { + int newValue = Integer.parseInt((String) o) * 1024 * 1024; + if (newValue != UserPreferences.getImageCacheSize()) { + AlertDialog.Builder dialog = new AlertDialog.Builder(ui.getActivity()); + dialog.setTitle(android.R.string.dialog_alert_title); + dialog.setMessage(R.string.pref_restart_required); + dialog.setPositiveButton(android.R.string.ok, null); + dialog.show(); } - ); - ui.findPreference(UserPreferences.PREF_HIDDEN_DRAWER_ITEMS) + return true; + } + return false; + } + ); + } + + private void setupIntegrationsScreen() { + final Activity activity = ui.getActivity(); + + ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setOnPreferenceClickListener( + preference -> { + FlattrUtils.revokeAccessToken(activity); + checkFlattrItemVisibility(); + return true; + } + ); + ui.findPreference(PreferenceController.PREF_GPODNET_SETLOGIN_INFORMATION) .setOnPreferenceClickListener(preference -> { - showDrawerPreferencesDialog(); + AuthenticationDialog dialog = new AuthenticationDialog(activity, + R.string.pref_gpodnet_setlogin_information_title, false, false, GpodnetPreferences.getUsername(), + null) { + + @Override + protected void onConfirmed(String username, String password, boolean saveUsernamePassword) { + GpodnetPreferences.setPassword(password); + } + }; + dialog.show(); + return true; + }); + ui.findPreference(PreferenceController.PREF_GPODNET_SYNC). + setOnPreferenceClickListener(preference -> { + GpodnetSyncService.sendSyncIntent(ui.getActivity().getApplicationContext()); + Toast toast = Toast.makeText(ui.getActivity(), R.string.pref_gpodnet_sync_started, + Toast.LENGTH_SHORT); + toast.show(); + return true; + }); + ui.findPreference(PreferenceController.PREF_GPODNET_FORCE_FULL_SYNC). + setOnPreferenceClickListener(preference -> { + GpodnetPreferences.setLastSubscriptionSyncTimestamp(0L); + GpodnetPreferences.setLastEpisodeActionsSyncTimestamp(0L); + GpodnetPreferences.setLastSyncAttempt(false, 0); + updateLastGpodnetSyncReport(false, 0); + GpodnetSyncService.sendSyncIntent(ui.getActivity().getApplicationContext()); + Toast toast = Toast.makeText(ui.getActivity(), R.string.pref_gpodnet_sync_started, + Toast.LENGTH_SHORT); + toast.show(); + return true; + }); + ui.findPreference(PreferenceController.PREF_GPODNET_LOGOUT).setOnPreferenceClickListener( + preference -> { + GpodnetPreferences.logout(); + Toast toast = Toast.makeText(activity, R.string.pref_gpodnet_logout_toast, Toast.LENGTH_SHORT); + toast.show(); + updateGpodnetPreferenceScreen(); + return true; + }); + ui.findPreference(PreferenceController.PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener( + preference -> { + GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen()); return true; }); - ui.findPreference(UserPreferences.PREF_COMPACT_NOTIFICATION_BUTTONS) + ui.findPreference(PreferenceController.PREF_AUTO_FLATTR_PREFS) .setOnPreferenceClickListener(preference -> { - showNotificationButtonsDialog(); + AutoFlattrPreferenceDialog.newAutoFlattrPreferenceDialog(activity, + new AutoFlattrPreferenceDialog.AutoFlattrPreferenceDialogInterface() { + @Override + public void onCancelled() { + + } + + @Override + public void onConfirmed(boolean autoFlattrEnabled, float autoFlattrValue) { + UserPreferences.setAutoFlattrSettings(autoFlattrEnabled, autoFlattrValue); + checkFlattrItemVisibility(); + } + }); return true; }); + } - ui.findPreference(UserPreferences.PREF_UPDATE_INTERVAL) + private void setupPlaybackScreen() { + final Activity activity = ui.getActivity(); + + ui.findPreference(PreferenceController.PREF_PLAYBACK_SPEED_LAUNCHER) .setOnPreferenceClickListener(preference -> { - showUpdateIntervalTimePreferencesDialog(); + VariableSpeedDialog.showDialog(activity); + return true; + }); + ui.findPreference(PreferenceController.PREF_PLAYBACK_REWIND_DELTA_LAUNCHER) + .setOnPreferenceClickListener(preference -> { + MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_REWIND); + return true; + }); + ui.findPreference(PreferenceController.PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER) + .setOnPreferenceClickListener(preference -> { + MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_FORWARD); return true; }); + if (!PictureInPictureUtil.supportsPictureInPicture(activity)) { + MaterialListPreference behaviour = (MaterialListPreference) ui.findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR); + behaviour.setEntries(R.array.video_background_behavior_options_without_pip); + behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip); + } + } + private void setupAutoDownloadScreen() { ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL).setOnPreferenceChangeListener( (preference, newValue) -> { if (newValue instanceof Boolean) { - boolean enabled = (Boolean) newValue; - ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE).setEnabled(enabled); - ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_ON_BATTERY).setEnabled(enabled); - ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_WIFI_FILTER).setEnabled(enabled); - setSelectedNetworksEnabled(enabled && UserPreferences.isEnableAutodownloadWifiFilter()); + checkAutodownloadItemVisibility((Boolean) newValue); } return true; }); @@ -278,6 +420,26 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } } ); + ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE) + .setOnPreferenceChangeListener( + (preference, o) -> { + if (o instanceof String) { + setEpisodeCacheSizeText(UserPreferences.readEpisodeCacheSize((String) o)); + } + return true; + } + ); + } + + private void setupNetworkScreen() { + final Activity activity = ui.getActivity(); + ui.findPreference(PREF_SCREEN_AUTODL).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_autodownload, activity)); + ui.findPreference(UserPreferences.PREF_UPDATE_INTERVAL) + .setOnPreferenceClickListener(preference -> { + showUpdateIntervalTimePreferencesDialog(); + return true; + }); ui.findPreference(UserPreferences.PREF_PARALLEL_DOWNLOADS) .setOnPreferenceChangeListener( (preference, o) -> { @@ -323,121 +485,38 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } } }); - ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE) - .setOnPreferenceChangeListener( - (preference, o) -> { - if (o instanceof String) { - setEpisodeCacheSizeText(UserPreferences.readEpisodeCacheSize((String) o)); - } - return true; - } - ); - ui.findPreference(PreferenceController.PREF_PLAYBACK_SPEED_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - VariableSpeedDialog.showDialog(activity); - return true; - }); - ui.findPreference(PreferenceController.PREF_PLAYBACK_REWIND_DELTA_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_REWIND); - return true; - }); - ui.findPreference(PreferenceController.PREF_PLAYBACK_FAST_FORWARD_DELTA_LAUNCHER) - .setOnPreferenceClickListener(preference -> { - MediaplayerActivity.showSkipPreference(activity, MediaplayerActivity.SkipDirection.SKIP_FORWARD); - return true; - }); - ui.findPreference(PreferenceController.PREF_GPODNET_SETLOGIN_INFORMATION) - .setOnPreferenceClickListener(preference -> { - AuthenticationDialog dialog = new AuthenticationDialog(activity, - R.string.pref_gpodnet_setlogin_information_title, false, false, GpodnetPreferences.getUsername(), - null) { + ui.findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> { + ProxyDialog dialog = new ProxyDialog(ui.getActivity()); + dialog.createDialog().show(); + return true; + }); + } - @Override - protected void onConfirmed(String username, String password, boolean saveUsernamePassword) { - GpodnetPreferences.setPassword(password); - } - }; - dialog.show(); - return true; - }); - ui.findPreference(PreferenceController.PREF_GPODNET_SYNC). - setOnPreferenceClickListener(preference -> { - GpodnetSyncService.sendSyncIntent(ui.getActivity().getApplicationContext()); - Toast toast = Toast.makeText(ui.getActivity(), R.string.pref_gpodnet_sync_started, - Toast.LENGTH_SHORT); - toast.show(); - return true; - }); - ui.findPreference(PreferenceController.PREF_GPODNET_FORCE_FULL_SYNC). - setOnPreferenceClickListener(preference -> { - GpodnetPreferences.setLastSubscriptionSyncTimestamp(0L); - GpodnetPreferences.setLastEpisodeActionsSyncTimestamp(0L); - GpodnetPreferences.setLastSyncAttempt(false, 0); - updateLastGpodnetSyncReport(false, 0); - GpodnetSyncService.sendSyncIntent(ui.getActivity().getApplicationContext()); - Toast toast = Toast.makeText(ui.getActivity(), R.string.pref_gpodnet_sync_started, - Toast.LENGTH_SHORT); - toast.show(); - return true; - }); - ui.findPreference(PreferenceController.PREF_GPODNET_LOGOUT).setOnPreferenceClickListener( + private void setupMainScreen() { + final Activity activity = ui.getActivity(); + ui.findPreference(PREF_SCREEN_USER_INTERFACE).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_user_interface, activity)); + ui.findPreference(PREF_SCREEN_PLAYBACK).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_playback, activity)); + ui.findPreference(PREF_SCREEN_NETWORK).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_network, activity)); + ui.findPreference(PREF_SCREEN_INTEGRATIONS).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_integrations, activity)); + ui.findPreference(PREF_SCREEN_STORAGE).setOnPreferenceClickListener(preference -> + openScreen(R.xml.preferences_storage, activity)); + + ui.findPreference(PreferenceController.PREF_ABOUT).setOnPreferenceClickListener( preference -> { - GpodnetPreferences.logout(); - Toast toast = Toast.makeText(activity, R.string.pref_gpodnet_logout_toast, Toast.LENGTH_SHORT); - toast.show(); - updateGpodnetPreferenceScreen(); + activity.startActivity(new Intent(activity, AboutActivity.class)); return true; - }); - ui.findPreference(PreferenceController.PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener( + } + ); + ui.findPreference(PreferenceController.STATISTICS).setOnPreferenceClickListener( preference -> { - GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen()); - return true; - }); - - ui.findPreference(PreferenceController.PREF_AUTO_FLATTR_PREFS) - .setOnPreferenceClickListener(preference -> { - AutoFlattrPreferenceDialog.newAutoFlattrPreferenceDialog(activity, - new AutoFlattrPreferenceDialog.AutoFlattrPreferenceDialogInterface() { - @Override - public void onCancelled() { - - } - - @Override - public void onConfirmed(boolean autoFlattrEnabled, float autoFlattrValue) { - UserPreferences.setAutoFlattrSettings(autoFlattrEnabled, autoFlattrValue); - checkItemVisibility(); - } - }); + activity.startActivity(new Intent(activity, StatisticsActivity.class)); return true; - }); - ui.findPreference(UserPreferences.PREF_IMAGE_CACHE_SIZE).setOnPreferenceChangeListener( - (preference, o) -> { - if (o instanceof String) { - int newValue = Integer.parseInt((String) o) * 1024 * 1024; - if (newValue != UserPreferences.getImageCacheSize()) { - AlertDialog.Builder dialog = new AlertDialog.Builder(ui.getActivity()); - dialog.setTitle(android.R.string.dialog_alert_title); - dialog.setMessage(R.string.pref_restart_required); - dialog.setPositiveButton(android.R.string.ok, null); - dialog.show(); - } - return true; - } - return false; } ); - if (!PictureInPictureUtil.supportsPictureInPicture(activity)) { - MaterialListPreference behaviour = (MaterialListPreference) ui.findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR); - behaviour.setEntries(R.array.video_background_behavior_options_without_pip); - behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip); - } - ui.findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> { - ProxyDialog dialog = new ProxyDialog(ui.getActivity()); - dialog.createDialog().show(); - return true; - }); ui.findPreference(PREF_KNOWN_ISSUES).setOnPreferenceClickListener(preference -> { openInBrowser("https://github.com/AntennaPod/AntennaPod/labels/bug"); return true; @@ -469,11 +548,17 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc ui.getActivity().startActivity(Intent.createChooser(emailIntent, intentTitle)); return true; }); - PreferenceControllerFlavorHelper.setupFlavoredUI(ui); - buildEpisodeCleanupPreference(); - buildSmartMarkAsPlayedPreference(); - buildAutodownloadSelectedNetworsPreference(); - setSelectedNetworksEnabled(UserPreferences.isEnableAutodownloadWifiFilter()); + } + + private boolean openScreen(int preferences, Activity activity) { + Fragment prefFragment = new PreferenceActivity.MainFragment(); + Bundle args = new Bundle(); + args.putInt(PARAM_RESOURCE, preferences); + prefFragment.setArguments(args); + activity.getFragmentManager().beginTransaction() + .replace(R.id.content, prefFragment) + .addToBackStack(TAG).commit(); + return true; } private boolean export(ExportWriter exportWriter) { @@ -529,22 +614,38 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } } - public void onResume() { - checkItemVisibility(); - setUpdateIntervalText(); - setParallelDownloadsText(UserPreferences.getParallelDownloads()); - setEpisodeCacheSizeText(UserPreferences.getEpisodeCacheSize()); - setDataFolderText(); - GpodnetPreferences.registerOnSharedPreferenceChangeListener(gpoddernetListener); - updateGpodnetPreferenceScreen(); + public void onResume(int screen) { + switch (screen) { + case R.xml.preferences_network: + setUpdateIntervalText(); + setParallelDownloadsText(UserPreferences.getParallelDownloads()); + break; + case R.xml.preferences_autodownload: + setEpisodeCacheSizeText(UserPreferences.getEpisodeCacheSize()); + checkAutodownloadItemVisibility(UserPreferences.isEnableAutodownload()); + break; + case R.xml.preferences_storage: + setDataFolderText(); + break; + case R.xml.preferences_integrations: + GpodnetPreferences.registerOnSharedPreferenceChangeListener(gpoddernetListener); + updateGpodnetPreferenceScreen(); + checkFlattrItemVisibility(); + break; + case R.xml.preferences_playback: + checkSonicItemVisibility(); + break; + } } - public void onPause() { - GpodnetPreferences.unregisterOnSharedPreferenceChangeListener(gpoddernetListener); + public void onPause(int screen) { + if (screen == R.xml.preferences_integrations) { + GpodnetPreferences.unregisterOnSharedPreferenceChangeListener(gpoddernetListener); + } } public void onStop() { - if(subscription != null) { + if (subscription != null) { subscription.unsubscribe(); } } @@ -699,21 +800,24 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } @SuppressWarnings("deprecation") - private void checkItemVisibility() { + private void checkFlattrItemVisibility() { boolean hasFlattrToken = FlattrUtils.hasToken(); ui.findPreference(PreferenceController.PREF_FLATTR_SETTINGS).setEnabled(FlattrUtils.hasAPICredentials()); ui.findPreference(PreferenceController.PREF_FLATTR_AUTH).setEnabled(!hasFlattrToken); ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setEnabled(hasFlattrToken); ui.findPreference(PreferenceController.PREF_AUTO_FLATTR_PREFS).setEnabled(hasFlattrToken); + } - boolean autoDownload = UserPreferences.isEnableAutodownload(); + private void checkAutodownloadItemVisibility(boolean autoDownload) { ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE).setEnabled(autoDownload); ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_ON_BATTERY).setEnabled(autoDownload); ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_WIFI_FILTER).setEnabled(autoDownload); + ui.findPreference(UserPreferences.PREF_EPISODE_CLEANUP).setEnabled(autoDownload); + ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_ON_MOBILE).setEnabled(autoDownload); setSelectedNetworksEnabled(autoDownload && UserPreferences.isEnableAutodownloadWifiFilter()); + } - ui.findPreference(PREF_SEND_CRASH_REPORT).setEnabled(CrashReportWriter.getFile().exists()); - + private void checkSonicItemVisibility() { if (Build.VERSION.SDK_INT >= 16) { ui.findPreference(UserPreferences.PREF_SONIC).setEnabled(true); } else { @@ -801,7 +905,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc selectedNetworks = new CheckBoxPreference[networks.size()]; List<String> prefValues = Arrays.asList(UserPreferences .getAutodownloadSelectedNetworks()); - PreferenceScreen prefScreen = (PreferenceScreen) ui.findPreference(PreferenceController.AUTO_DL_PREF_SCREEN); + PreferenceScreen prefScreen = ui.getPreferenceScreen(); Preference.OnPreferenceClickListener clickListener = preference -> { if (preference instanceof CheckBoxPreference) { String key = preference.getKey(); @@ -848,7 +952,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc private void clearAutodownloadSelectedNetworsPreference() { if (selectedNetworks != null) { - PreferenceScreen prefScreen = (PreferenceScreen) ui.findPreference(PreferenceController.AUTO_DL_PREF_SCREEN); + PreferenceScreen prefScreen = ui.getPreferenceScreen(); for (CheckBoxPreference network : selectedNetworks) { if (network != null) { @@ -1013,11 +1117,15 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc public interface PreferenceUI { + void setFragment(PreferenceFragment fragment); + /** * Finds a preference based on its key. */ Preference findPreference(CharSequence key); + PreferenceScreen getPreferenceScreen(); + Activity getActivity(); } } diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 622fef05b..8472f7b26 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -1,338 +1,36 @@ <?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"> - - <PreferenceCategory android:title="@string/user_interface_label"> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:entryValues="@array/theme_values" - android:entries="@array/theme_options" - android:title="@string/pref_set_theme_title" - android:key="prefTheme" - android:summary="@string/pref_set_theme_sum" - android:defaultValue="0" - app:useStockLayout="true"/> - <PreferenceScreen - android:key="prefDrawerSettings" - android:summary="@string/pref_nav_drawer_sum" - android:title="@string/pref_nav_drawer_title"> - <Preference - android:key="prefHiddenDrawerItems" - android:summary="@string/pref_nav_drawer_items_sum" - android:title="@string/pref_nav_drawer_items_title" /> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:entryValues="@array/nav_drawer_feed_order_values" - android:entries="@array/nav_drawer_feed_order_options" - android:title="@string/pref_nav_drawer_feed_order_title" - android:key="prefDrawerFeedOrder" - android:summary="@string/pref_nav_drawer_feed_order_sum" - android:defaultValue="0" - app:useStockLayout="true"/> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:entryValues="@array/nav_drawer_feed_counter_values" - android:entries="@array/nav_drawer_feed_counter_options" - android:title="@string/pref_nav_drawer_feed_counter_title" - android:key="prefDrawerFeedIndicator" - android:summary="@string/pref_nav_drawer_feed_counter_sum" - android:defaultValue="0" - app:useStockLayout="true"/> - </PreferenceScreen> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefExpandNotify" - android:summary="@string/pref_expandNotify_sum" - android:title="@string/pref_expandNotify_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefPersistNotify" - android:summary="@string/pref_persistNotify_sum" - android:title="@string/pref_persistNotify_title"/> - <Preference - android:key="prefCompactNotificationButtons" - android:summary="@string/pref_compact_notification_buttons_sum" - android:title="@string/pref_compact_notification_buttons_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefLockscreenBackground" - android:summary="@string/pref_lockscreen_background_sum" - android:title="@string/pref_lockscreen_background_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefShowDownloadReport" - android:summary="@string/pref_showDownloadReport_sum" - android:title="@string/pref_showDownloadReport_title"/> - </PreferenceCategory> - - <PreferenceCategory android:title="@string/queue_label"> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefQueueAddToFront" - android:summary="@string/pref_queueAddToFront_sum" - android:title="@string/pref_queueAddToFront_title"/> - </PreferenceCategory> - - <PreferenceCategory android:title="@string/playback_pref"> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="false" - android:key="prefSonic" - android:summary="@string/pref_sonic_message" - android:title="@string/pref_sonic_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefPauseOnHeadsetDisconnect" - android:summary="@string/pref_pauseOnDisconnect_sum" - android:title="@string/pref_pauseOnHeadsetDisconnect_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:dependency="prefPauseOnHeadsetDisconnect" - android:key="prefUnpauseOnHeadsetReconnect" - android:summary="@string/pref_unpauseOnHeadsetReconnect_sum" - android:title="@string/pref_unpauseOnHeadsetReconnect_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:dependency="prefPauseOnHeadsetDisconnect" - android:key="prefUnpauseOnBluetoothReconnect" - android:summary="@string/pref_unpauseOnBluetoothReconnect_sum" - android:title="@string/pref_unpauseOnBluetoothReconnect_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefHardwareForwardButtonSkips" - android:summary="@string/pref_hardwareForwardButtonSkips_sum" - android:title="@string/pref_hardwareForwardButtonSkips_title"/> - <Preference - android:key="prefPlaybackFastForwardDeltaLauncher" - android:summary="@string/pref_fast_forward_sum" - android:title="@string/pref_fast_forward" /> - <Preference - android:key="prefPlaybackRewindDeltaLauncher" - android:summary="@string/pref_rewind_sum" - android:title="@string/pref_rewind" /> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefHardwarePreviousButtonRestarts" - android:summary="@string/pref_hardwarePreviousButtonRestarts_sum" - android:title="@string/pref_hardwarePreviousButtonRestarts_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefFollowQueue" - android:summary="@string/pref_followQueue_sum" - android:title="@string/pref_followQueue_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefSkipKeepsEpisode" - android:summary="@string/pref_skip_keeps_episodes_sum" - android:title="@string/pref_skip_keeps_episodes_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefFavoriteKeepsEpisode" - android:summary="@string/pref_favorite_keeps_episodes_sum" - android:title="@string/pref_favorite_keeps_episodes_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefAutoDelete" - android:summary="@string/pref_auto_delete_sum" - android:title="@string/pref_auto_delete_title"/> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:defaultValue="30" - android:entries="@array/smart_mark_as_played_values" - android:entryValues="@array/smart_mark_as_played_values" - android:key="prefSmartMarkAsPlayedSecs" - android:summary="@string/pref_smart_mark_as_played_sum" - android:title="@string/pref_smart_mark_as_played_title" - app:useStockLayout="true"/> - <Preference - android:key="prefPlaybackSpeedLauncher" - android:summary="@string/pref_playback_speed_sum" - android:title="@string/pref_playback_speed_title" /> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefPauseForFocusLoss" - android:summary="@string/pref_pausePlaybackForFocusLoss_sum" - android:title="@string/pref_pausePlaybackForFocusLoss_title" /> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefResumeAfterCall" - android:summary="@string/pref_resumeAfterCall_sum" - android:title="@string/pref_resumeAfterCall_title"/> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:defaultValue="stop" - android:entries="@array/video_background_behavior_options" - android:entryValues="@array/video_background_behavior_values" - android:key="prefVideoBehavior" - android:summary="@string/pref_videoBehavior_sum" - android:title="@string/pref_videoBehavior_title" - app:useStockLayout="true"/> - - </PreferenceCategory> - <PreferenceCategory android:title="@string/network_pref"> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="true" - android:enabled="true" - android:key="prefEnqueueDownloaded" - android:summary="@string/pref_enqueue_downloaded_summary" - android:title="@string/pref_enqueue_downloaded_title" /> - <Preference - android:key="prefAutoUpdateIntervall" - android:summary="@string/pref_autoUpdateIntervallOrTime_sum" - android:title="@string/pref_autoUpdateIntervallOrTime_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefMobileUpdate" - android:summary="@string/pref_mobileUpdate_sum" - android:title="@string/pref_mobileUpdate_title"/> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:defaultValue="-1" - android:entries="@array/episode_cleanup_entries" - android:key="prefEpisodeCleanup" - android:title="@string/pref_episode_cleanup_title" - android:summary="@string/pref_episode_cleanup_summary" - android:entryValues="@array/episode_cleanup_values" - app:useStockLayout="true"/> - <com.afollestad.materialdialogs.prefs.MaterialEditTextPreference - android:defaultValue="4" - android:inputType="number" - android:key="prefParallelDownloads" - android:title="@string/pref_parallel_downloads_title" - app:useStockLayout="true"/> - <PreferenceScreen - android:summary="@string/pref_automatic_download_sum" - android:key="prefAutoDownloadSettings" - android:title="@string/pref_automatic_download_title"> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:key="prefEnableAutoDl" - android:title="@string/pref_automatic_download_title" - android:defaultValue="false"/> - <com.afollestad.materialdialogs.prefs.MaterialListPreference - android:defaultValue="25" - android:entries="@array/episode_cache_size_entries" - android:key="prefEpisodeCacheSize" - android:title="@string/pref_episode_cache_title" - android:entryValues="@array/episode_cache_size_values" - app:useStockLayout="true"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:key="prefEnableAutoDownloadOnBattery" - android:title="@string/pref_automatic_download_on_battery_title" - android:summary="@string/pref_automatic_download_on_battery_sum" - android:defaultValue="true"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:key="prefEnableAutoDownloadOnMobile" - android:title="@string/pref_autodl_allow_on_mobile_title" - android:summary="@string/pref_autodl_allow_on_mobile_sum" - android:defaultValue="false"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:key="prefEnableAutoDownloadWifiFilter" - android:title="@string/pref_autodl_wifi_filter_title" - android:summary="@string/pref_autodl_wifi_filter_sum"/> - </PreferenceScreen> - <Preference - android:key="prefProxy" - android:summary="@string/pref_proxy_sum" - android:title="@string/pref_proxy_title" /> - - </PreferenceCategory> - - <PreferenceCategory android:title="@string/services_label"> - <PreferenceScreen - android:key="prefFlattrSettings" - android:title="@string/flattr_label"> - <PreferenceScreen - android:key="pref_flattr_authenticate" - android:summary="@string/pref_flattr_auth_sum" - android:title="@string/pref_flattr_auth_title"> - <intent android:action=".activities.FlattrAuthActivity"/> - </PreferenceScreen> - - <Preference - android:key="prefAutoFlattrPrefs" - android:summary="@string/pref_auto_flattr_sum" - android:title="@string/pref_auto_flattr_title" /> - <Preference - android:key="prefRevokeAccess" - android:summary="@string/pref_revokeAccess_sum" - android:title="@string/pref_revokeAccess_title"/> - </PreferenceScreen> - <PreferenceScreen - android:key="prefGpodderSettings" - android:title="@string/gpodnet_main_label"> - - <PreferenceScreen - android:key="pref_gpodnet_authenticate" - android:title="@string/pref_gpodnet_authenticate_title" - android:summary="@string/pref_gpodnet_authenticate_sum"> - <intent android:action=".activity.gpoddernet.GpodnetAuthenticationActivity"/> - </PreferenceScreen> - <Preference - android:key="pref_gpodnet_setlogin_information" - android:title="@string/pref_gpodnet_setlogin_information_title" - android:summary="@string/pref_gpodnet_setlogin_information_sum"/> - <Preference - android:key="pref_gpodnet_sync" - android:title="@string/pref_gpodnet_sync_changes_title" - android:summary="@string/pref_gpodnet_sync_changes_sum"/> - <Preference - android:key="pref_gpodnet_force_full_sync" - android:title="@string/pref_gpodnet_full_sync_title" - android:summary="@string/pref_gpodnet_full_sync_sum"/> - <Preference - android:key="pref_gpodnet_logout" - android:title="@string/pref_gpodnet_logout_title"/> - <Preference - android:key="pref_gpodnet_hostname" - android:title="@string/pref_gpodnet_sethostname_title"/> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:key="pref_gpodnet_notifications" - android:title="@string/pref_gpodnet_notifications_title" - android:summary="@string/pref_gpodnet_notifications_sum" - android:defaultValue="true"/> - </PreferenceScreen> - </PreferenceCategory> - <PreferenceCategory android:title="@string/storage_pref"> - <Preference - android:title="@string/choose_data_directory" - android:key="prefChooseDataDir"/> - <ListPreference - android:entryValues="@array/image_cache_size_values" - android:entries="@array/image_cache_size_options" - android:title="@string/pref_image_cache_size_title" - android:key="prefImageCacheSize" - android:summary="@string/pref_image_cache_size_sum" - android:defaultValue="100"/> - </PreferenceCategory> - <PreferenceCategory android:title="@string/other_pref"> - <Preference - android:key="prefOpmlExport" - android:title="@string/opml_export_label"/> - <Preference - android:key="prefOpmlImport" - android:title="@string/opml_import_label"/> - <Preference - android:key="prefHtmlExport" - android:title="@string/html_export_label"/> - <Preference - android:key="importExport" - android:title="@string/import_export"/> - <Preference + xmlns:android="http://schemas.android.com/apk/res/android"> + <Preference + android:key="prefScreenInterface" + android:title="@string/user_interface_label" + android:icon="?attr/type_video" /> + + <Preference + android:key="prefScreenPlayback" + android:title="@string/playback_pref" + android:icon="?attr/av_play" /> + + <Preference + android:key="prefScreenNetwork" + android:title="@string/network_pref" + android:icon="?attr/ic_swap" /> + + <Preference + android:key="prefScreenIntegrations" + android:title="@string/integrations_label" + android:icon="?attr/ic_unfav" /> + + <Preference + android:key="prefScreenStorage" + android:title="@string/storage_pref" + android:icon="?attr/storage" /> + + <Preference android:key="statistics" - android:title="@string/statistics_label"/> - </PreferenceCategory> + android:title="@string/statistics_label" + android:icon="?attr/statistics" /> + <PreferenceCategory android:title="@string/project_pref"> <Preference android:key="prefFaq" @@ -348,14 +46,4 @@ android:key="prefAbout" android:title="@string/about_pref"/> </PreferenceCategory> - - <PreferenceCategory android:title="@string/experimental_pref"> - <de.danoeh.antennapod.preferences.SwitchCompatPreference - android:defaultValue="false" - android:enabled="true" - android:key="prefCast" - android:summary="@string/pref_cast_message" - android:title="@string/pref_cast_title"/> - </PreferenceCategory> - </PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_autodownload.xml b/app/src/main/res/xml/preferences_autodownload.xml new file mode 100644 index 000000000..72716423a --- /dev/null +++ b/app/src/main/res/xml/preferences_autodownload.xml @@ -0,0 +1,39 @@ +<?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"> + + <de.danoeh.antennapod.preferences.MasterSwitchPreference + android:key="prefEnableAutoDl" + android:title="@string/pref_automatic_download_title" + android:defaultValue="false"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:defaultValue="25" + android:entries="@array/episode_cache_size_entries" + android:key="prefEpisodeCacheSize" + android:title="@string/pref_episode_cache_title" + android:entryValues="@array/episode_cache_size_values" + app:useStockLayout="true"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:defaultValue="-1" + android:entries="@array/episode_cleanup_entries" + android:key="prefEpisodeCleanup" + android:title="@string/pref_episode_cleanup_title" + android:summary="@string/pref_episode_cleanup_summary" + android:entryValues="@array/episode_cleanup_values" + app:useStockLayout="true"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:key="prefEnableAutoDownloadOnBattery" + android:title="@string/pref_automatic_download_on_battery_title" + android:summary="@string/pref_automatic_download_on_battery_sum" + android:defaultValue="true"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:key="prefEnableAutoDownloadOnMobile" + android:title="@string/pref_autodl_allow_on_mobile_title" + android:summary="@string/pref_autodl_allow_on_mobile_sum" + android:defaultValue="false"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:key="prefEnableAutoDownloadWifiFilter" + android:title="@string/pref_autodl_wifi_filter_title" + android:summary="@string/pref_autodl_wifi_filter_sum"/> +</PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_integrations.xml b/app/src/main/res/xml/preferences_integrations.xml new file mode 100644 index 000000000..8ce35b596 --- /dev/null +++ b/app/src/main/res/xml/preferences_integrations.xml @@ -0,0 +1,63 @@ +<?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"> + + <PreferenceScreen + android:key="prefFlattrSettings" + android:title="@string/flattr_label" + android:summary="@string/flattr_summary"> + <PreferenceScreen + android:key="pref_flattr_authenticate" + android:summary="@string/pref_flattr_auth_sum" + android:title="@string/pref_flattr_auth_title"> + <intent android:action=".activities.FlattrAuthActivity"/> + </PreferenceScreen> + + <Preference + android:key="prefAutoFlattrPrefs" + android:summary="@string/pref_auto_flattr_sum" + android:title="@string/pref_auto_flattr_title"/> + <Preference + android:key="prefRevokeAccess" + android:summary="@string/pref_revokeAccess_sum" + android:title="@string/pref_revokeAccess_title"/> + </PreferenceScreen> + + <PreferenceScreen + android:key="prefGpodderSettings" + android:title="@string/gpodnet_main_label" + android:summary="@string/gpodnet_summary"> + + <PreferenceScreen + android:key="pref_gpodnet_authenticate" + android:title="@string/pref_gpodnet_authenticate_title" + android:summary="@string/pref_gpodnet_authenticate_sum"> + <intent android:action=".activity.gpoddernet.GpodnetAuthenticationActivity"/> + </PreferenceScreen> + <Preference + android:key="pref_gpodnet_setlogin_information" + android:title="@string/pref_gpodnet_setlogin_information_title" + android:summary="@string/pref_gpodnet_setlogin_information_sum"/> + <Preference + android:key="pref_gpodnet_sync" + android:title="@string/pref_gpodnet_sync_changes_title" + android:summary="@string/pref_gpodnet_sync_changes_sum"/> + <Preference + android:key="pref_gpodnet_force_full_sync" + android:title="@string/pref_gpodnet_full_sync_title" + android:summary="@string/pref_gpodnet_full_sync_sum"/> + <Preference + android:key="pref_gpodnet_logout" + android:title="@string/pref_gpodnet_logout_title"/> + <Preference + android:key="pref_gpodnet_hostname" + android:title="@string/pref_gpodnet_sethostname_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:key="pref_gpodnet_notifications" + android:title="@string/pref_gpodnet_notifications_title" + android:summary="@string/pref_gpodnet_notifications_sum" + android:defaultValue="true"/> + </PreferenceScreen> + +</PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_network.xml b/app/src/main/res/xml/preferences_network.xml new file mode 100644 index 000000000..77792bf88 --- /dev/null +++ b/app/src/main/res/xml/preferences_network.xml @@ -0,0 +1,40 @@ +<?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"> + <PreferenceCategory android:title="@string/automation"> + <Preference + android:key="prefAutoUpdateIntervall" + android:summary="@string/pref_autoUpdateIntervallOrTime_sum" + android:title="@string/pref_autoUpdateIntervallOrTime_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefMobileUpdate" + android:summary="@string/pref_mobileUpdate_sum" + android:title="@string/pref_mobileUpdate_title"/> + <Preference + android:summary="@string/pref_automatic_download_sum" + android:key="prefAutoDownloadSettings" + android:title="@string/pref_automatic_download_title" /> + </PreferenceCategory> + + <PreferenceCategory android:title="@string/download_pref_details"> + <com.afollestad.materialdialogs.prefs.MaterialEditTextPreference + android:defaultValue="4" + android:inputType="number" + android:key="prefParallelDownloads" + android:title="@string/pref_parallel_downloads_title" + app:useStockLayout="true"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefShowDownloadReport" + android:summary="@string/pref_showDownloadReport_sum" + android:title="@string/pref_showDownloadReport_title"/> + <Preference + android:key="prefProxy" + android:summary="@string/pref_proxy_sum" + android:title="@string/pref_proxy_title"/> + </PreferenceCategory> +</PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_playback.xml b/app/src/main/res/xml/preferences_playback.xml new file mode 100644 index 000000000..49a53726c --- /dev/null +++ b/app/src/main/res/xml/preferences_playback.xml @@ -0,0 +1,128 @@ +<?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"> + + <PreferenceCategory android:title="@string/interruptions"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefPauseOnHeadsetDisconnect" + android:summary="@string/pref_pauseOnDisconnect_sum" + android:title="@string/pref_pauseOnHeadsetDisconnect_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:dependency="prefPauseOnHeadsetDisconnect" + android:key="prefUnpauseOnHeadsetReconnect" + android:summary="@string/pref_unpauseOnHeadsetReconnect_sum" + android:title="@string/pref_unpauseOnHeadsetReconnect_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:dependency="prefPauseOnHeadsetDisconnect" + android:key="prefUnpauseOnBluetoothReconnect" + android:summary="@string/pref_unpauseOnBluetoothReconnect_sum" + android:title="@string/pref_unpauseOnBluetoothReconnect_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefPauseForFocusLoss" + android:summary="@string/pref_pausePlaybackForFocusLoss_sum" + android:title="@string/pref_pausePlaybackForFocusLoss_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefResumeAfterCall" + android:summary="@string/pref_resumeAfterCall_sum" + android:title="@string/pref_resumeAfterCall_title"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:defaultValue="stop" + android:entries="@array/video_background_behavior_options" + android:entryValues="@array/video_background_behavior_values" + android:key="prefVideoBehavior" + android:summary="@string/pref_videoBehavior_sum" + android:title="@string/pref_videoBehavior_title" + app:useStockLayout="true"/> + </PreferenceCategory> + + <PreferenceCategory android:title="@string/buttons"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefHardwareForwardButtonSkips" + android:summary="@string/pref_hardwareForwardButtonSkips_sum" + android:title="@string/pref_hardwareForwardButtonSkips_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefHardwarePreviousButtonRestarts" + android:summary="@string/pref_hardwarePreviousButtonRestarts_sum" + android:title="@string/pref_hardwarePreviousButtonRestarts_title"/> + <Preference + android:key="prefPlaybackFastForwardDeltaLauncher" + android:summary="@string/pref_fast_forward_sum" + android:title="@string/pref_fast_forward"/> + <Preference + android:key="prefPlaybackRewindDeltaLauncher" + android:summary="@string/pref_rewind_sum" + android:title="@string/pref_rewind"/> + <Preference + android:key="prefPlaybackSpeedLauncher" + android:summary="@string/pref_playback_speed_sum" + android:title="@string/pref_playback_speed_title"/> + </PreferenceCategory> + + <PreferenceCategory android:title="@string/queue_label"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefEnqueueDownloaded" + android:summary="@string/pref_enqueue_downloaded_summary" + android:title="@string/pref_enqueue_downloaded_title" /> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefQueueAddToFront" + android:summary="@string/pref_queueAddToFront_sum" + android:title="@string/pref_queueAddToFront_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefFollowQueue" + android:summary="@string/pref_followQueue_sum" + android:title="@string/pref_followQueue_title"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:defaultValue="30" + android:entries="@array/smart_mark_as_played_values" + android:entryValues="@array/smart_mark_as_played_values" + android:key="prefSmartMarkAsPlayedSecs" + android:summary="@string/pref_smart_mark_as_played_sum" + android:title="@string/pref_smart_mark_as_played_title" + app:useStockLayout="true"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefSkipKeepsEpisode" + android:summary="@string/pref_skip_keeps_episodes_sum" + android:title="@string/pref_skip_keeps_episodes_title"/> + </PreferenceCategory> + + <PreferenceCategory android:title="@string/media_player"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="false" + android:key="prefSonic" + android:summary="@string/pref_sonic_message" + android:title="@string/pref_sonic_title"/> + </PreferenceCategory> + + <PreferenceCategory android:title="@string/experimental_pref"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefCast" + android:summary="@string/pref_cast_message" + android:title="@string/pref_cast_title"/> + </PreferenceCategory> +</PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_storage.xml b/app/src/main/res/xml/preferences_storage.xml new file mode 100644 index 000000000..091b02ced --- /dev/null +++ b/app/src/main/res/xml/preferences_storage.xml @@ -0,0 +1,43 @@ +<?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"> + + <Preference + android:title="@string/choose_data_directory" + android:key="prefChooseDataDir"/> + <ListPreference + android:entryValues="@array/image_cache_size_values" + android:entries="@array/image_cache_size_options" + android:title="@string/pref_image_cache_size_title" + android:key="prefImageCacheSize" + android:summary="@string/pref_image_cache_size_sum" + android:defaultValue="100"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefAutoDelete" + android:summary="@string/pref_auto_delete_sum" + android:title="@string/pref_auto_delete_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefFavoriteKeepsEpisode" + android:summary="@string/pref_favorite_keeps_episodes_sum" + android:title="@string/pref_favorite_keeps_episodes_title"/> + + <PreferenceCategory android:title="@string/import_export_pref"> + <Preference + android:key="prefOpmlExport" + android:title="@string/opml_export_label"/> + <Preference + android:key="prefOpmlImport" + android:title="@string/opml_import_label"/> + <Preference + android:key="prefHtmlExport" + android:title="@string/html_export_label"/> + <Preference + android:key="importExport" + android:title="@string/import_export"/> + </PreferenceCategory> +</PreferenceScreen> diff --git a/app/src/main/res/xml/preferences_user_interface.xml b/app/src/main/res/xml/preferences_user_interface.xml new file mode 100644 index 000000000..7ffa1b00f --- /dev/null +++ b/app/src/main/res/xml/preferences_user_interface.xml @@ -0,0 +1,60 @@ +<?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"> + + <PreferenceCategory android:title="@string/appearance"> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:entryValues="@array/theme_values" + android:entries="@array/theme_options" + android:title="@string/pref_set_theme_title" + android:key="prefTheme" + android:summary="@string/pref_set_theme_sum" + android:defaultValue="0" + app:useStockLayout="true"/> + <Preference + android:key="prefHiddenDrawerItems" + android:summary="@string/pref_nav_drawer_items_sum" + android:title="@string/pref_nav_drawer_items_title"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:entryValues="@array/nav_drawer_feed_order_values" + android:entries="@array/nav_drawer_feed_order_options" + android:title="@string/pref_nav_drawer_feed_order_title" + android:key="prefDrawerFeedOrder" + android:summary="@string/pref_nav_drawer_feed_order_sum" + android:defaultValue="0" + app:useStockLayout="true"/> + <com.afollestad.materialdialogs.prefs.MaterialListPreference + android:entryValues="@array/nav_drawer_feed_counter_values" + android:entries="@array/nav_drawer_feed_counter_options" + android:title="@string/pref_nav_drawer_feed_counter_title" + android:key="prefDrawerFeedIndicator" + android:summary="@string/pref_nav_drawer_feed_counter_sum" + android:defaultValue="0" + app:useStockLayout="true"/> + </PreferenceCategory> + <PreferenceCategory android:title="@string/external_elements"> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="false" + android:enabled="true" + android:key="prefExpandNotify" + android:summary="@string/pref_expandNotify_sum" + android:title="@string/pref_expandNotify_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefPersistNotify" + android:summary="@string/pref_persistNotify_sum" + android:title="@string/pref_persistNotify_title"/> + <Preference + android:key="prefCompactNotificationButtons" + android:summary="@string/pref_compact_notification_buttons_sum" + android:title="@string/pref_compact_notification_buttons_title"/> + <de.danoeh.antennapod.preferences.SwitchCompatPreference + android:defaultValue="true" + android:enabled="true" + android:key="prefLockscreenBackground" + android:summary="@string/pref_lockscreen_background_sum" + android:title="@string/pref_lockscreen_background_title"/> + </PreferenceCategory> +</PreferenceScreen> diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index bad48e4cc..a93012d59 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -86,7 +86,7 @@ public class UserPreferences { public static final String PREF_ENABLE_AUTODL = "prefEnableAutoDl"; public static final String PREF_ENABLE_AUTODL_ON_BATTERY = "prefEnableAutoDownloadOnBattery"; public static final String PREF_ENABLE_AUTODL_WIFI_FILTER = "prefEnableAutoDownloadWifiFilter"; - private static final String PREF_ENABLE_AUTODL_ON_MOBILE = "prefEnableAutoDownloadOnMobile"; + public static final String PREF_ENABLE_AUTODL_ON_MOBILE = "prefEnableAutoDownloadOnMobile"; private static final String PREF_AUTODL_SELECTED_NETWORKS = "prefAutodownloadSelectedNetworks"; private static final String PREF_PROXY_TYPE = "prefProxyType"; private static final String PREF_PROXY_HOST = "prefProxyHost"; diff --git a/core/src/main/res/drawable-hdpi/ic_poll_box_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_poll_box_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..2ee172a51 --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_poll_box_grey600_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_poll_box_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_poll_box_white_24dp.png Binary files differnew file mode 100644 index 000000000..3fe2256c7 --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_poll_box_white_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_sd_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_sd_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..2c7c210d3 --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_sd_grey600_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_sd_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_sd_white_24dp.png Binary files differnew file mode 100644 index 000000000..77fd16301 --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_sd_white_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_swap_vertical_grey600_24dp.png b/core/src/main/res/drawable-hdpi/ic_swap_vertical_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..cd3508d72 --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_swap_vertical_grey600_24dp.png diff --git a/core/src/main/res/drawable-hdpi/ic_swap_vertical_white_24dp.png b/core/src/main/res/drawable-hdpi/ic_swap_vertical_white_24dp.png Binary files differnew file mode 100644 index 000000000..b26af6aac --- /dev/null +++ b/core/src/main/res/drawable-hdpi/ic_swap_vertical_white_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_poll_box_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_poll_box_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..6fefa8b8c --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_poll_box_grey600_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_poll_box_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_poll_box_white_24dp.png Binary files differnew file mode 100644 index 000000000..cf45cde6d --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_poll_box_white_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_sd_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_sd_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..81c5f77d9 --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_sd_grey600_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_sd_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_sd_white_24dp.png Binary files differnew file mode 100644 index 000000000..a012f237c --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_sd_white_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_swap_vertical_grey600_24dp.png b/core/src/main/res/drawable-mdpi/ic_swap_vertical_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..c2aeb3b5d --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_swap_vertical_grey600_24dp.png diff --git a/core/src/main/res/drawable-mdpi/ic_swap_vertical_white_24dp.png b/core/src/main/res/drawable-mdpi/ic_swap_vertical_white_24dp.png Binary files differnew file mode 100644 index 000000000..ea4faabdf --- /dev/null +++ b/core/src/main/res/drawable-mdpi/ic_swap_vertical_white_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_poll_box_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_poll_box_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..e09b052b9 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_poll_box_grey600_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_poll_box_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_poll_box_white_24dp.png Binary files differnew file mode 100644 index 000000000..9ed41f906 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_poll_box_white_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_sd_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_sd_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..c2bc3fa9f --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_sd_grey600_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_sd_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_sd_white_24dp.png Binary files differnew file mode 100644 index 000000000..76e620405 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_sd_white_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_swap_vertical_grey600_24dp.png b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..c6139c821 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_grey600_24dp.png diff --git a/core/src/main/res/drawable-xhdpi/ic_swap_vertical_white_24dp.png b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_white_24dp.png Binary files differnew file mode 100644 index 000000000..c4bee7069 --- /dev/null +++ b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_white_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_poll_box_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_poll_box_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..3d24d9670 --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_poll_box_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_poll_box_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_poll_box_white_24dp.png Binary files differnew file mode 100644 index 000000000..3d9f54b6c --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_poll_box_white_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_sd_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_sd_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..7e8fa947e --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_sd_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_sd_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_sd_white_24dp.png Binary files differnew file mode 100644 index 000000000..66c74428e --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_sd_white_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_grey600_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..2d71e15fc --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_white_24dp.png b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_white_24dp.png Binary files differnew file mode 100644 index 000000000..24df5b942 --- /dev/null +++ b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_white_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_poll_box_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..c97eba579 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_poll_box_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_white_24dp.png Binary files differnew file mode 100644 index 000000000..54e169d54 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_white_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_sd_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_sd_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..744b2c8f4 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_sd_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_sd_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_sd_white_24dp.png Binary files differnew file mode 100644 index 000000000..1bee910ed --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_sd_white_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_grey600_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_grey600_24dp.png Binary files differnew file mode 100644 index 000000000..631ef6d0a --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_grey600_24dp.png diff --git a/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_white_24dp.png b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_white_24dp.png Binary files differnew file mode 100644 index 000000000..5bf24ac32 --- /dev/null +++ b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_white_24dp.png diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 5f25796b0..b005d4dc3 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -12,6 +12,8 @@ <attr name="av_rewind" format="reference"/> <attr name="content_discard" format="reference"/> <attr name="content_new" format="reference"/> + <attr name="storage" format="reference"/> + <attr name="statistics" format="reference"/> <attr name="feed" format="reference"/> <attr name="location_web_site" format="reference"/> <attr name="navigation_accept" format="reference"/> @@ -52,6 +54,8 @@ <attr name="ic_sd_storage" format="reference"/> <attr name="ic_create_new_folder" format="reference"/> <attr name="ic_cast_disconnect" format="reference"/> + <attr name="ic_swap" format="reference"/> + <attr name="master_switch_background" format="color"/> <!-- Used in itemdescription --> <attr name="non_transparent_background" format="reference"/> diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 969500928..c9a5b3d6a 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -33,4 +33,7 @@ <color name="antennapod_blue">#147BAF</color> + <color name="master_switch_background_light">#DDDDDD</color> + <color name="master_switch_background_dark">#191919</color> + </resources> diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index d199a8764..2ebc2ad77 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -24,6 +24,7 @@ <string name="cancel_download_label">Cancel\nDownload</string> <string name="playback_history_label">Playback History</string> <string name="gpodnet_main_label">gpodder.net</string> + <string name="gpodnet_summary">Synchronize with other devices</string> <string name="gpodnet_auth_label">gpodder.net Login</string> <string name="free_space_label">%1$s free</string> <string name="episode_cache_full_title">Episode cache full</string> @@ -310,8 +311,17 @@ <string name="other_pref">Other</string> <string name="about_pref">About</string> <string name="queue_label">Queue</string> - <string name="services_label">Services</string> + <string name="integrations_label">Integrations</string> <string name="flattr_label">Flattr</string> + <string name="flattr_summary">Micropayment service</string> + <string name="automation">Automation</string> + <string name="download_pref_details">Details</string> + <string name="import_export_pref">Import/Export</string> + <string name="appearance">Appearance</string> + <string name="external_elements">External elements</string> + <string name="interruptions">Interruptions</string> + <string name="buttons">Buttons</string> + <string name="media_player">Media player</string> <string name="pref_episode_cleanup_title">Episode Cleanup</string> <string name="pref_episode_cleanup_summary">Episodes that aren\'t in the queue and aren\'t favorites should be eligible for removal if Auto Download needs space for new episodes</string> <string name="pref_pauseOnDisconnect_sum">Pause playback when headphones or bluetooth are disconnected</string> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index b74b55334..decfa3b2b 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -12,6 +12,9 @@ <item name="buttonStyle">@style/Widget.AntennaPod.Button</item> <item name="alertDialogTheme">@style/AntennaPod.Dialog.Light</item> <item type="attr" name="action_bar_icon_color">@color/grey600</item> + <item type="attr" name="storage">@drawable/ic_sd_grey600_24dp</item> + <item type="attr" name="ic_swap">@drawable/ic_swap_vertical_grey600_24dp</item> + <item type="attr" name="statistics">@drawable/ic_poll_box_grey600_24dp</item> <item type="attr" name="action_about">@drawable/ic_info_grey600_24dp</item> <item type="attr" name="checkbox_multiple">@drawable/ic_checkbox_multiple_marked_outline_grey600_24dp</item> <item type="attr" name="action_search">@drawable/ic_search_grey600_24dp</item> @@ -63,6 +66,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_grey600_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> + <item type="attr" name="master_switch_background">@color/master_switch_background_light</item> </style> <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> @@ -76,7 +80,9 @@ <item name="progressBarTheme">@style/ProgressBarDark</item> <item name="alertDialogTheme">@style/AntennaPod.Dialog.Dark</item> <item type="attr" name="action_bar_icon_color">@color/white</item> - <item type="attr" name="action_about">@drawable/ic_info_white_24dp</item> + <item type="attr" name="storage">@drawable/ic_sd_white_24dp</item> + <item type="attr" name="ic_swap">@drawable/ic_swap_vertical_white_24dp</item> + <item type="attr" name="statistics">@drawable/ic_poll_box_white_24dp</item> <item type="attr" name="checkbox_multiple">@drawable/ic_checkbox_multiple_marked_outline_white_24dp</item> <item type="attr" name="action_search">@drawable/ic_search_white_24dp</item> <item type="attr" name="action_stream">@drawable/ic_settings_input_antenna_white_24dp</item> @@ -127,6 +133,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_white_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> + <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> </style> <style name="Theme.AntennaPod.Light.NoTitle" parent="Theme.Base.AntennaPod.Light.NoTitle"> @@ -141,6 +148,9 @@ <item name="colorAccent">@color/holo_blue_light</item> <item name="buttonStyle">@style/Widget.AntennaPod.Button</item> <item name="alertDialogTheme">@style/AntennaPod.Dialog.Light</item> + <item type="attr" name="storage">@drawable/ic_sd_grey600_24dp</item> + <item type="attr" name="ic_swap">@drawable/ic_swap_vertical_grey600_24dp</item> + <item type="attr" name="statistics">@drawable/ic_poll_box_grey600_24dp</item> <item type="attr" name="action_about">@drawable/ic_info_grey600_24dp</item> <item type="attr" name="checkbox_multiple">@drawable/ic_checkbox_multiple_marked_outline_grey600_24dp</item> <item type="attr" name="action_search">@drawable/ic_search_grey600_24dp</item> @@ -192,6 +202,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_grey600_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item> + <item type="attr" name="master_switch_background">@color/master_switch_background_light</item> </style> <style name="Theme.AntennaPod.Dark.NoTitle" parent="Theme.Base.AntennaPod.Dark.NoTitle"> @@ -206,6 +217,9 @@ <item name="colorControlNormal">@color/white</item> <item name="buttonStyle">@style/Widget.AntennaPod.Button</item> <item name="alertDialogTheme">@style/AntennaPod.Dialog.Dark</item> + <item type="attr" name="storage">@drawable/ic_sd_white_24dp</item> + <item type="attr" name="ic_swap">@drawable/ic_swap_vertical_white_24dp</item> + <item type="attr" name="statistics">@drawable/ic_poll_box_white_24dp</item> <item type="attr" name="action_about">@drawable/ic_info_white_24dp</item> <item type="attr" name="checkbox_multiple">@drawable/ic_checkbox_multiple_marked_outline_white_24dp</item> <item type="attr" name="action_search">@drawable/ic_search_white_24dp</item> @@ -257,6 +271,7 @@ <item type="attr" name="ic_sd_storage">@drawable/ic_sd_storage_white_36dp</item> <item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</item> <item type="attr" name="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item> + <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> </style> <style name="Theme.AntennaPod.Dark.Splash" parent="Theme.AppCompat.NoActionBar"> |