summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2018-04-22 20:48:00 +0200
committerByteHamster <info@bytehamster.com>2018-04-22 20:48:00 +0200
commit8b72f3514740ff2f5a5b085355081a2751850756 (patch)
tree5f09964015f94622ef74cb78d2c8614b36eaec1a
parent8c6f40b0a272851110c9c073c75b9e6521e880d0 (diff)
parent94bf3cd7346343317b439641236264273e418365 (diff)
downloadAntennaPod-8b72f3514740ff2f5a5b085355081a2751850756.zip
Merge branch 'develop' into exo-player
-rw-r--r--app/src/main/AndroidManifest.xml5
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java23
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java63
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java41
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java45
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java470
-rw-r--r--app/src/main/res/layout/subscription_item.xml2
-rw-r--r--app/src/main/res/xml/preferences.xml374
-rw-r--r--app/src/main/res/xml/preferences_autodownload.xml39
-rw-r--r--app/src/main/res/xml/preferences_integrations.xml63
-rw-r--r--app/src/main/res/xml/preferences_network.xml40
-rw-r--r--app/src/main/res/xml/preferences_playback.xml130
-rw-r--r--app/src/main/res/xml/preferences_storage.xml43
-rw-r--r--app/src/main/res/xml/preferences_user_interface.xml60
-rw-r--r--build.gradle2
-rw-r--r--core/src/main/AndroidManifest.xml2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java2
-rw-r--r--core/src/main/res/drawable-hdpi/ic_launcher.pngbin3887 -> 0 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_poll_box_grey600_24dp.pngbin0 -> 608 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_poll_box_white_24dp.pngbin0 -> 558 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_sd_grey600_24dp.pngbin0 -> 533 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_sd_white_24dp.pngbin0 -> 472 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_swap_vertical_grey600_24dp.pngbin0 -> 581 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/ic_swap_vertical_white_24dp.pngbin0 -> 510 bytes
-rw-r--r--core/src/main/res/drawable-ldpi/ic_launcher.pngbin1645 -> 0 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_launcher.pngbin2359 -> 0 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_poll_box_grey600_24dp.pngbin0 -> 463 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_poll_box_white_24dp.pngbin0 -> 429 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_sd_grey600_24dp.pngbin0 -> 456 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_sd_white_24dp.pngbin0 -> 417 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_swap_vertical_grey600_24dp.pngbin0 -> 484 bytes
-rw-r--r--core/src/main/res/drawable-mdpi/ic_swap_vertical_white_24dp.pngbin0 -> 421 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_launcher.pngbin5519 -> 0 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_poll_box_grey600_24dp.pngbin0 -> 592 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_poll_box_white_24dp.pngbin0 -> 565 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_sd_grey600_24dp.pngbin0 -> 580 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_sd_white_24dp.pngbin0 -> 535 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_swap_vertical_grey600_24dp.pngbin0 -> 569 bytes
-rw-r--r--core/src/main/res/drawable-xhdpi/ic_swap_vertical_white_24dp.pngbin0 -> 496 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_launcher.pngbin9483 -> 0 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_poll_box_grey600_24dp.pngbin0 -> 787 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_poll_box_white_24dp.pngbin0 -> 704 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_sd_grey600_24dp.pngbin0 -> 791 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_sd_white_24dp.pngbin0 -> 684 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_swap_vertical_grey600_24dp.pngbin0 -> 710 bytes
-rw-r--r--core/src/main/res/drawable-xxhdpi/ic_swap_vertical_white_24dp.pngbin0 -> 582 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_poll_box_grey600_24dp.pngbin0 -> 918 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_poll_box_white_24dp.pngbin0 -> 848 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_sd_grey600_24dp.pngbin0 -> 925 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_sd_white_24dp.pngbin0 -> 842 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_grey600_24dp.pngbin0 -> 818 bytes
-rw-r--r--core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_white_24dp.pngbin0 -> 664 bytes
-rw-r--r--core/src/main/res/drawable/bg_splash.xml4
-rw-r--r--core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml5
-rw-r--r--core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml5
-rw-r--r--core/src/main/res/mipmap-hdpi/ic_launcher.pngbin0 -> 4628 bytes
-rw-r--r--core/src/main/res/mipmap-hdpi/ic_launcher_foreground.pngbin0 -> 4876 bytes
-rw-r--r--core/src/main/res/mipmap-hdpi/ic_launcher_round.pngbin0 -> 4628 bytes
-rw-r--r--core/src/main/res/mipmap-mdpi/ic_launcher.pngbin0 -> 2752 bytes
-rw-r--r--core/src/main/res/mipmap-mdpi/ic_launcher_foreground.pngbin0 -> 2884 bytes
-rw-r--r--core/src/main/res/mipmap-mdpi/ic_launcher_round.pngbin0 -> 2752 bytes
-rw-r--r--core/src/main/res/mipmap-xhdpi/ic_launcher.pngbin0 -> 6709 bytes
-rw-r--r--core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.pngbin0 -> 6980 bytes
-rw-r--r--core/src/main/res/mipmap-xhdpi/ic_launcher_round.pngbin0 -> 6709 bytes
-rw-r--r--core/src/main/res/mipmap-xxhdpi/ic_launcher.pngbin0 -> 10809 bytes
-rw-r--r--core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.pngbin0 -> 12641 bytes
-rw-r--r--core/src/main/res/mipmap-xxhdpi/ic_launcher_round.pngbin0 -> 10809 bytes
-rw-r--r--core/src/main/res/mipmap-xxxhdpi/ic_launcher.pngbin0 -> 15604 bytes
-rw-r--r--core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.pngbin0 -> 19600 bytes
-rw-r--r--core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.pngbin0 -> 15604 bytes
-rw-r--r--core/src/main/res/values/attrs.xml4
-rw-r--r--core/src/main/res/values/colors.xml3
-rw-r--r--core/src/main/res/values/ic_launcher_background.xml4
-rw-r--r--core/src/main/res/values/strings.xml12
-rw-r--r--core/src/main/res/values/styles.xml16
-rw-r--r--ic_launcher-web.pngbin40025 -> 53849 bytes
77 files changed, 903 insertions, 557 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c84b0110b..03ba97e08 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -33,11 +33,12 @@
<application
android:name="de.danoeh.antennapod.PodcastApp"
- android:icon="@drawable/ic_launcher"
+ android:icon="@mipmap/ic_launcher"
+ android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:backupAgent=".core.backup.OpmlBackupAgent"
android:restoreAnyVersion="true"
- android:logo="@drawable/ic_launcher">
+ android:logo="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.gms.car.notification.SmallIcon"
android:resource="@drawable/ic_notification" />
<meta-data
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
index f56dca173..e593934a9 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
@@ -572,10 +572,29 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
Feed feed = navDrawerData.feeds.get(position - navAdapter.getSubscriptionOffset());
switch(item.getItemId()) {
case R.id.mark_all_seen_item:
- DBWriter.markFeedSeen(feed.getId());
+ ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(this,
+ R.string.mark_all_seen_label,
+ R.string.mark_all_seen_confirmation_msg) {
+ @Override
+ public void onConfirmButtonPressed(DialogInterface dialog) {
+ dialog.dismiss();
+ DBWriter.markFeedSeen(feed.getId());
+ }
+ };
+ markAllSeenConfirmationDialog.createNewDialog().show();
return true;
case R.id.mark_all_read_item:
- DBWriter.markFeedRead(feed.getId());
+ ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(this,
+ R.string.mark_all_read_label,
+ R.string.mark_all_read_confirmation_msg) {
+
+ @Override
+ public void onConfirmButtonPressed(DialogInterface dialog) {
+ dialog.dismiss();
+ DBWriter.markFeedRead(feed.getId());
+ }
+ };
+ markAllReadConfirmationDialog.createNewDialog().show();
return true;
case R.id.rename_item:
new RenameFeedDialog(this, feed).show();
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/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
index 4ef26ad6c..2705e7402 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
@@ -124,8 +124,7 @@ public class ExternalPlayerFragment extends Fragment {
public void onResume() {
super.onResume();
controller.init();
- mProgressBar.setProgress((int)
- ((double) controller.getPosition() / controller.getDuration() * 100));
+ onPositionObserverUpdate();
}
@Override
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
index c834b7ea7..1247aacbb 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
@@ -152,18 +152,39 @@ public class SubscriptionFragment extends Fragment {
Feed feed = (Feed)selectedObject;
switch(item.getItemId()) {
case R.id.mark_all_seen_item:
- Observable.fromCallable(() -> DBWriter.markFeedSeen(feed.getId()))
- .subscribeOn(Schedulers.newThread())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> loadSubscriptions(),
- error -> Log.e(TAG, Log.getStackTraceString(error)));
+ ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(getActivity(),
+ R.string.mark_all_seen_label,
+ R.string.mark_all_seen_confirmation_msg) {
+
+ @Override
+ public void onConfirmButtonPressed(DialogInterface dialog) {
+ dialog.dismiss();
+
+ Observable.fromCallable(() -> DBWriter.markFeedSeen(feed.getId()))
+ .subscribeOn(Schedulers.newThread())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(result -> loadSubscriptions(),
+ error -> Log.e(TAG, Log.getStackTraceString(error)));
+ }
+ };
+ markAllSeenConfirmationDialog.createNewDialog().show();
return true;
case R.id.mark_all_read_item:
- Observable.fromCallable(() -> DBWriter.markFeedRead(feed.getId()))
- .subscribeOn(Schedulers.newThread())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> loadSubscriptions(),
- error -> Log.e(TAG, Log.getStackTraceString(error)));
+ ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(getActivity(),
+ R.string.mark_all_read_label,
+ R.string.mark_all_read_confirmation_msg) {
+
+ @Override
+ public void onConfirmButtonPressed(DialogInterface dialog) {
+ dialog.dismiss();
+ Observable.fromCallable(() -> DBWriter.markFeedRead(feed.getId()))
+ .subscribeOn(Schedulers.newThread())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(result -> loadSubscriptions(),
+ error -> Log.e(TAG, Log.getStackTraceString(error)));
+ }
+ };
+ markAllReadConfirmationDialog.createNewDialog().show();
return true;
case R.id.rename_item:
new RenameFeedDialog(getActivity(), feed).show();
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 042602f66..957f3f9c8 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";
@@ -140,7 +152,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) {
@@ -155,25 +200,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));
@@ -222,43 +276,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;
});
@@ -273,6 +415,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) -> {
@@ -318,121 +480,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;
@@ -464,11 +543,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) {
@@ -524,22 +609,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();
}
}
@@ -694,21 +795,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) {
MaterialListPreference p = ((MaterialListPreference) ui.findPreference(UserPreferences.PREF_MEDIA_PLAYER));
p.setEntries(R.array.media_player_options_no_sonic);
@@ -795,7 +899,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();
@@ -842,7 +946,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) {
@@ -1007,11 +1111,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/layout/subscription_item.xml b/app/src/main/res/layout/subscription_item.xml
index 8f0539dfa..502fa8672 100644
--- a/app/src/main/res/layout/subscription_item.xml
+++ b/app/src/main/res/layout/subscription_item.xml
@@ -11,7 +11,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerCrop"
- tools:src="@drawable/ic_launcher">
+ tools:src="@mipmap/ic_launcher_round">
</de.danoeh.antennapod.view.SquareImageView>
<com.joanzapata.iconify.widget.IconTextView
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 2ba41bab2..8472f7b26 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -1,340 +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">
- <com.afollestad.materialdialogs.prefs.MaterialListPreference
- android:defaultValue="sonic"
- android:entries="@array/media_player_options"
- android:key="prefMediaPlayer"
- android:title="@string/pref_media_player_title"
- android:summary="@string/pref_media_player_message"
- android:entryValues="@array/media_player_values"
- app:useStockLayout="true"/>
- <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"
@@ -350,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..00af36034
--- /dev/null
+++ b/app/src/main/res/xml/preferences_playback.xml
@@ -0,0 +1,130 @@
+<?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">
+ <com.afollestad.materialdialogs.prefs.MaterialListPreference
+ android:defaultValue="sonic"
+ android:entries="@array/media_player_options"
+ android:key="prefMediaPlayer"
+ android:title="@string/pref_media_player_title"
+ android:summary="@string/pref_media_player_message"
+ android:entryValues="@array/media_player_values"
+ app:useStockLayout="true"/>
+ </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/build.gradle b/build.gradle
index 61345e7b2..1cd8acc7e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -40,7 +40,7 @@ project.ext {
compileSdkVersion = 25
buildToolsVersion = "27.0.3"
minSdkVersion = 14
- targetSdkVersion = 25
+ targetSdkVersion = 26
supportVersion = "25.3.1"
commonsioVersion = "2.5"
diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml
index 3a5db2c36..3257c13a7 100644
--- a/core/src/main/AndroidManifest.xml
+++ b/core/src/main/AndroidManifest.xml
@@ -12,7 +12,7 @@
<application
android:allowBackup="true"
- android:icon="@drawable/ic_launcher">
+ android:icon="@mipmap/ic_launcher">
<service
android:name=".service.download.DownloadService"
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 a44ca8a8e..608de1be7 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_launcher.png b/core/src/main/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 8bd22b54a..000000000
--- a/core/src/main/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
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
new file mode 100644
index 000000000..2ee172a51
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_poll_box_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..3fe2256c7
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_poll_box_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..2c7c210d3
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_sd_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..77fd16301
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_sd_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..cd3508d72
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_swap_vertical_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..b26af6aac
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/ic_swap_vertical_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-ldpi/ic_launcher.png b/core/src/main/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644
index 494468020..000000000
--- a/core/src/main/res/drawable-ldpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/core/src/main/res/drawable-mdpi/ic_launcher.png b/core/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index 219e8c5ab..000000000
--- a/core/src/main/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
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
new file mode 100644
index 000000000..6fefa8b8c
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_poll_box_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..cf45cde6d
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_poll_box_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..81c5f77d9
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_sd_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..a012f237c
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_sd_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..c2aeb3b5d
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_swap_vertical_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..ea4faabdf
--- /dev/null
+++ b/core/src/main/res/drawable-mdpi/ic_swap_vertical_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xhdpi/ic_launcher.png b/core/src/main/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100644
index 2dbfd8874..000000000
--- a/core/src/main/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
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
new file mode 100644
index 000000000..e09b052b9
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_poll_box_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..9ed41f906
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_poll_box_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..c2bc3fa9f
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_sd_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..76e620405
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_sd_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..c6139c821
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..c4bee7069
--- /dev/null
+++ b/core/src/main/res/drawable-xhdpi/ic_swap_vertical_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable-xxhdpi/ic_launcher.png b/core/src/main/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100644
index 41b261b4f..000000000
--- a/core/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
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
new file mode 100644
index 000000000..3d24d9670
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_poll_box_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..3d9f54b6c
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_poll_box_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..7e8fa947e
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_sd_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..66c74428e
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_sd_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..2d71e15fc
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..24df5b942
--- /dev/null
+++ b/core/src/main/res/drawable-xxhdpi/ic_swap_vertical_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..c97eba579
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..54e169d54
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_poll_box_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..744b2c8f4
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_sd_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..1bee910ed
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_sd_white_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..631ef6d0a
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_grey600_24dp.png
Binary files differ
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
new file mode 100644
index 000000000..5bf24ac32
--- /dev/null
+++ b/core/src/main/res/drawable-xxxhdpi/ic_swap_vertical_white_24dp.png
Binary files differ
diff --git a/core/src/main/res/drawable/bg_splash.xml b/core/src/main/res/drawable/bg_splash.xml
index dd66e3083..32241ec22 100644
--- a/core/src/main/res/drawable/bg_splash.xml
+++ b/core/src/main/res/drawable/bg_splash.xml
@@ -2,12 +2,12 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
- android:drawable="@color/overlay_dark"/>
+ android:drawable="@color/ic_launcher_background"/>
<item>
<bitmap
android:gravity="center"
- android:src="@drawable/ic_launcher"/>
+ android:src="@mipmap/ic_launcher_foreground"/>
</item>
</layer-list> \ No newline at end of file
diff --git a/core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 000000000..036d09bc5
--- /dev/null
+++ b/core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@color/ic_launcher_background"/>
+ <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon> \ No newline at end of file
diff --git a/core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 000000000..036d09bc5
--- /dev/null
+++ b/core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@color/ic_launcher_background"/>
+ <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon> \ No newline at end of file
diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher.png b/core/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 000000000..12e9b3395
--- /dev/null
+++ b/core/src/main/res/mipmap-hdpi/ic_launcher.png
Binary files differ
diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
new file mode 100644
index 000000000..d687f94bb
--- /dev/null
+++ b/core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Binary files differ
diff --git a/core/src/main/res/mipmap-hdpi/ic_launcher_round.png b/core/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 000000000..12e9b3395
--- /dev/null
+++ b/core/src/main/res/mipmap-hdpi/ic_launcher_round.png
Binary files differ
diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher.png b/core/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 000000000..1da13d374
--- /dev/null
+++ b/core/src/main/res/mipmap-mdpi/ic_launcher.png
Binary files differ
diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
new file mode 100644
index 000000000..2e7a4b74d
--- /dev/null
+++ b/core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Binary files differ
diff --git a/core/src/main/res/mipmap-mdpi/ic_launcher_round.png b/core/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 000000000..1da13d374
--- /dev/null
+++ b/core/src/main/res/mipmap-mdpi/ic_launcher_round.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher.png b/core/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 000000000..32b022ada
--- /dev/null
+++ b/core/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
new file mode 100644
index 000000000..5f90a1d11
--- /dev/null
+++ b/core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/core/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..32b022ada
--- /dev/null
+++ b/core/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher.png b/core/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 000000000..321600e15
--- /dev/null
+++ b/core/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
new file mode 100644
index 000000000..d72ffedbb
--- /dev/null
+++ b/core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..321600e15
--- /dev/null
+++ b/core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/core/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 000000000..ff2870dca
--- /dev/null
+++ b/core/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
new file mode 100644
index 000000000..0af16fadf
--- /dev/null
+++ b/core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Binary files differ
diff --git a/core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 000000000..ff2870dca
--- /dev/null
+++ b/core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Binary files differ
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/ic_launcher_background.xml b/core/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 000000000..3df03b8f4
--- /dev/null
+++ b/core/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="ic_launcher_background">#008AB8</color>
+</resources> \ No newline at end of file
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index f9a03f3a2..63796fae4 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..77758a223 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,6 +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="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>
@@ -127,6 +134,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 +149,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 +203,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 +218,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 +272,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">
diff --git a/ic_launcher-web.png b/ic_launcher-web.png
index 7a7518d73..3868fc03b 100644
--- a/ic_launcher-web.png
+++ b/ic_launcher-web.png
Binary files differ