Merge pull request from ByteHamster/preference-support

Switched to PreferenceFragmentCompat
This commit is contained in:
Martin Fietz 2018-05-06 17:45:25 +02:00 committed by GitHub
commit f6faca95c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 239 additions and 249 deletions

@ -139,6 +139,7 @@ dependencies {
implementation "com.android.support:support-v4:$supportVersion" implementation "com.android.support:support-v4:$supportVersion"
implementation "com.android.support:appcompat-v7:$supportVersion" implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion" implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:preference-v14:$supportVersion"
implementation "com.android.support:gridlayout-v7:$supportVersion" implementation "com.android.support:gridlayout-v7:$supportVersion"
implementation "com.android.support:percent:$supportVersion" implementation "com.android.support:percent:$supportVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion" implementation "com.android.support:recyclerview-v7:$supportVersion"

@ -1,13 +1,12 @@
package de.danoeh.antennapod.activity; package de.danoeh.antennapod.activity;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; 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.ActionBar;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.PreferenceScreen;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -29,10 +28,10 @@ public class PreferenceActivity extends AppCompatActivity {
private static WeakReference<PreferenceActivity> instance; private static WeakReference<PreferenceActivity> instance;
private PreferenceController preferenceController; private PreferenceController preferenceController;
private final PreferenceController.PreferenceUI preferenceUI = new PreferenceController.PreferenceUI() { private final PreferenceController.PreferenceUI preferenceUI = new PreferenceController.PreferenceUI() {
private PreferenceFragment fragment; private PreferenceFragmentCompat fragment;
@Override @Override
public void setFragment(PreferenceFragment fragment) { public void setFragment(PreferenceFragmentCompat fragment) {
this.fragment = fragment; this.fragment = fragment;
} }
@ -47,7 +46,7 @@ public class PreferenceActivity extends AppCompatActivity {
} }
@Override @Override
public Activity getActivity() { public AppCompatActivity getActivity() {
return PreferenceActivity.this; return PreferenceActivity.this;
} }
}; };
@ -77,12 +76,12 @@ public class PreferenceActivity extends AppCompatActivity {
// since the MainFragment depends on the preferenceController already being created // since the MainFragment depends on the preferenceController already being created
preferenceController = new PreferenceController(preferenceUI); preferenceController = new PreferenceController(preferenceUI);
PreferenceFragment prefFragment = new MainFragment(); PreferenceFragmentCompat prefFragment = new MainFragment();
preferenceUI.setFragment(prefFragment); preferenceUI.setFragment(prefFragment);
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt(PARAM_RESOURCE, R.xml.preferences); args.putInt(PARAM_RESOURCE, R.xml.preferences);
prefFragment.setArguments(args); prefFragment.setArguments(args);
getFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit(); getSupportFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit();
} }
@Override @Override
@ -101,10 +100,10 @@ public class PreferenceActivity extends AppCompatActivity {
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case android.R.id.home: case android.R.id.home:
if (getFragmentManager().getBackStackEntryCount() == 0) { if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
finish(); finish();
} else { } else {
getFragmentManager().popBackStack(); getSupportFragmentManager().popBackStack();
} }
return true; return true;
default: default:
@ -112,13 +111,17 @@ public class PreferenceActivity extends AppCompatActivity {
} }
} }
public static class MainFragment extends PreferenceFragment { public static class MainFragment extends PreferenceFragmentCompat {
private int screen; private int screen;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setRetainInstance(true); setRetainInstance(true);
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
screen = getArguments().getInt(PARAM_RESOURCE); screen = getArguments().getInt(PARAM_RESOURCE);
addPreferencesFromResource(screen); addPreferencesFromResource(screen);
PreferenceActivity activity = instance.get(); PreferenceActivity activity = instance.get();
@ -133,35 +136,16 @@ public class PreferenceActivity extends AppCompatActivity {
super.onResume(); super.onResume();
PreferenceActivity activity = instance.get(); PreferenceActivity activity = instance.get();
if(activity != null && activity.preferenceController != null) { if(activity != null && activity.preferenceController != null) {
activity.setTitle(getTitle(screen)); activity.setTitle(activity.preferenceController.getTitleOfPage(screen));
activity.preferenceUI.setFragment(this); activity.preferenceUI.setFragment(this);
activity.preferenceController.onResume(screen); activity.preferenceController.onResume(screen);
} }
} }
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;
}
}
@Override @Override
public void onPause() { public void onPause() {
PreferenceActivity activity = instance.get(); PreferenceActivity activity = instance.get();
if (screen == R.xml.preferences_integrations) { if (screen == R.xml.preferences_gpodder) {
activity.preferenceController.unregisterGpodnet(); activity.preferenceController.unregisterGpodnet();
} }
super.onPause(); super.onPause();

@ -4,13 +4,14 @@ import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Build; import android.os.Build;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.PreferenceViewHolder;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
public class MasterSwitchPreference extends SwitchCompatPreference { public class MasterSwitchPreference extends SwitchPreference {
public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) { public MasterSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
@ -29,15 +30,16 @@ public class MasterSwitchPreference extends SwitchCompatPreference {
super(context); super(context);
} }
@Override @Override
protected void onBindView(View view) { public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindView(view); super.onBindViewHolder(holder);
TypedValue typedValue = new TypedValue(); TypedValue typedValue = new TypedValue();
getContext().getTheme().resolveAttribute(R.attr.master_switch_background, typedValue, true); getContext().getTheme().resolveAttribute(R.attr.master_switch_background, typedValue, true);
view.setBackgroundColor(typedValue.data); holder.itemView.setBackgroundColor(typedValue.data);
TextView title = (TextView) view.findViewById(android.R.id.title); TextView title = (TextView) holder.findViewById(android.R.id.title);
if (title != null) { if (title != null) {
title.setTypeface(title.getTypeface(), Typeface.BOLD); title.setTypeface(title.getTypeface(), Typeface.BOLD);
} }

@ -3,7 +3,6 @@ package de.danoeh.antennapod.preferences;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.Fragment;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.app.TimePickerDialog; import android.app.TimePickerDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
@ -18,31 +17,27 @@ import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.Build; import android.os.Build;
import android.os.Bundle; 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; import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat;
import android.support.v4.content.FileProvider; import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Editable; import android.support.v7.app.AppCompatActivity;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;
import android.text.Html; import android.text.Html;
import android.text.TextWatcher;
import android.text.format.DateFormat; import android.text.format.DateFormat;
import android.text.format.DateUtils; import android.text.format.DateUtils;
import android.util.Log; import android.util.Log;
import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog; import com.afollestad.materialdialogs.MaterialDialog;
import de.danoeh.antennapod.activity.AboutActivity; import de.danoeh.antennapod.activity.AboutActivity;
import com.afollestad.materialdialogs.prefs.MaterialListPreference;
import de.danoeh.antennapod.activity.ImportExportActivity; import de.danoeh.antennapod.activity.ImportExportActivity;
import de.danoeh.antennapod.activity.MediaplayerActivity; import de.danoeh.antennapod.activity.MediaplayerActivity;
import de.danoeh.antennapod.activity.OpmlImportFromPathActivity; import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
@ -99,8 +94,9 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
private static final String PREF_SCREEN_INTEGRATIONS = "prefScreenIntegrations"; private static final String PREF_SCREEN_INTEGRATIONS = "prefScreenIntegrations";
private static final String PREF_SCREEN_STORAGE = "prefScreenStorage"; private static final String PREF_SCREEN_STORAGE = "prefScreenStorage";
private static final String PREF_SCREEN_AUTODL = "prefAutoDownloadSettings"; private static final String PREF_SCREEN_AUTODL = "prefAutoDownloadSettings";
private static final String PREF_SCREEN_FLATTR = "prefFlattrSettings";
private static final String PREF_SCREEN_GPODDER = "prefGpodderSettings";
private static final String PREF_FLATTR_SETTINGS = "prefFlattrSettings";
private static final String PREF_FLATTR_AUTH = "pref_flattr_authenticate"; private static final String PREF_FLATTR_AUTH = "pref_flattr_authenticate";
private static final String PREF_FLATTR_REVOKE = "prefRevokeAccess"; private static final String PREF_FLATTR_REVOKE = "prefRevokeAccess";
private static final String PREF_AUTO_FLATTR_PREFS = "prefAutoFlattrPrefs"; private static final String PREF_AUTO_FLATTR_PREFS = "prefAutoFlattrPrefs";
@ -181,6 +177,12 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
case R.xml.preferences_integrations: case R.xml.preferences_integrations:
setupIntegrationsScreen(); setupIntegrationsScreen();
break; break;
case R.xml.preferences_flattr:
setupFlattrScreen();
break;
case R.xml.preferences_gpodder:
setupGpodderScreen();
break;
case R.xml.preferences_storage: case R.xml.preferences_storage:
setupStorageScreen(); setupStorageScreen();
break; break;
@ -300,7 +302,20 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
} }
private void setupIntegrationsScreen() { private void setupIntegrationsScreen() {
final Activity activity = ui.getActivity(); final AppCompatActivity activity = ui.getActivity();
ui.findPreference(PREF_SCREEN_FLATTR).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_flattr, activity);
return true;
});
ui.findPreference(PREF_SCREEN_GPODDER).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_gpodder, activity);
return true;
});
}
private void setupFlattrScreen() {
final AppCompatActivity activity = ui.getActivity();
ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setOnPreferenceClickListener( ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setOnPreferenceClickListener(
preference -> { preference -> {
@ -309,6 +324,29 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
return true; 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);
checkFlattrItemVisibility();
}
});
return true;
});
}
private void setupGpodderScreen() {
final AppCompatActivity activity = ui.getActivity();
ui.findPreference(PreferenceController.PREF_GPODNET_SETLOGIN_INFORMATION) ui.findPreference(PreferenceController.PREF_GPODNET_SETLOGIN_INFORMATION)
.setOnPreferenceClickListener(preference -> { .setOnPreferenceClickListener(preference -> {
AuthenticationDialog dialog = new AuthenticationDialog(activity, AuthenticationDialog dialog = new AuthenticationDialog(activity,
@ -356,24 +394,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen()); GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen());
return true; 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);
checkFlattrItemVisibility();
}
});
return true;
});
} }
private void setupPlaybackScreen() { private void setupPlaybackScreen() {
@ -395,7 +415,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
return true; return true;
}); });
if (!PictureInPictureUtil.supportsPictureInPicture(activity)) { if (!PictureInPictureUtil.supportsPictureInPicture(activity)) {
MaterialListPreference behaviour = (MaterialListPreference) ui.findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR); ListPreference behaviour = (ListPreference) ui.findPreference(UserPreferences.PREF_VIDEO_BEHAVIOR);
behaviour.setEntries(R.array.video_background_behavior_options_without_pip); behaviour.setEntries(R.array.video_background_behavior_options_without_pip);
behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip); behaviour.setEntryValues(R.array.video_background_behavior_values_without_pip);
} }
@ -432,9 +452,11 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
} }
private void setupNetworkScreen() { private void setupNetworkScreen() {
final Activity activity = ui.getActivity(); final AppCompatActivity activity = ui.getActivity();
ui.findPreference(PREF_SCREEN_AUTODL).setOnPreferenceClickListener(preference -> ui.findPreference(PREF_SCREEN_AUTODL).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_autodownload, activity)); openScreen(R.xml.preferences_autodownload, activity);
return true;
});
ui.findPreference(UserPreferences.PREF_UPDATE_INTERVAL) ui.findPreference(UserPreferences.PREF_UPDATE_INTERVAL)
.setOnPreferenceClickListener(preference -> { .setOnPreferenceClickListener(preference -> {
showUpdateIntervalTimePreferencesDialog(); showUpdateIntervalTimePreferencesDialog();
@ -458,33 +480,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
} }
); );
// validate and set correct value: number of downloads between 1 and 50 (inclusive) // validate and set correct value: number of downloads between 1 and 50 (inclusive)
final EditText ev = ((EditTextPreference) ui.findPreference(UserPreferences.PREF_PARALLEL_DOWNLOADS)).getEditText();
ev.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (s.length() > 0) {
try {
int value = Integer.parseInt(s.toString());
if (value <= 0) {
ev.setText("1");
} else if (value > 50) {
ev.setText("50");
}
} catch (NumberFormatException e) {
ev.setText("6");
}
ev.setSelection(ev.getText().length());
}
}
});
ui.findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> { ui.findPreference(PREF_PROXY).setOnPreferenceClickListener(preference -> {
ProxyDialog dialog = new ProxyDialog(ui.getActivity()); ProxyDialog dialog = new ProxyDialog(ui.getActivity());
dialog.createDialog().show(); dialog.createDialog().show();
@ -493,17 +488,27 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
} }
private void setupMainScreen() { private void setupMainScreen() {
final Activity activity = ui.getActivity(); final AppCompatActivity activity = ui.getActivity();
ui.findPreference(PREF_SCREEN_USER_INTERFACE).setOnPreferenceClickListener(preference -> ui.findPreference(PREF_SCREEN_USER_INTERFACE).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_user_interface, activity)); openScreen(R.xml.preferences_user_interface, activity);
ui.findPreference(PREF_SCREEN_PLAYBACK).setOnPreferenceClickListener(preference -> return true;
openScreen(R.xml.preferences_playback, activity)); });
ui.findPreference(PREF_SCREEN_NETWORK).setOnPreferenceClickListener(preference -> ui.findPreference(PREF_SCREEN_PLAYBACK).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_network, activity)); openScreen(R.xml.preferences_playback, activity);
ui.findPreference(PREF_SCREEN_INTEGRATIONS).setOnPreferenceClickListener(preference -> return true;
openScreen(R.xml.preferences_integrations, activity)); });
ui.findPreference(PREF_SCREEN_STORAGE).setOnPreferenceClickListener(preference -> ui.findPreference(PREF_SCREEN_NETWORK).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_storage, activity)); openScreen(R.xml.preferences_network, activity);
return true;
});
ui.findPreference(PREF_SCREEN_INTEGRATIONS).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_integrations, activity);
return true;
});
ui.findPreference(PREF_SCREEN_STORAGE).setOnPreferenceClickListener(preference -> {
openScreen(R.xml.preferences_storage, activity);
return true;
});
ui.findPreference(PreferenceController.PREF_ABOUT).setOnPreferenceClickListener( ui.findPreference(PreferenceController.PREF_ABOUT).setOnPreferenceClickListener(
preference -> { preference -> {
@ -550,15 +555,38 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
}); });
} }
private boolean openScreen(int preferences, Activity activity) { public PreferenceFragmentCompat openScreen(int preferences, AppCompatActivity activity) {
Fragment prefFragment = new PreferenceActivity.MainFragment(); PreferenceFragmentCompat prefFragment = new PreferenceActivity.MainFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt(PARAM_RESOURCE, preferences); args.putInt(PARAM_RESOURCE, preferences);
prefFragment.setArguments(args); prefFragment.setArguments(args);
activity.getFragmentManager().beginTransaction() activity.getSupportFragmentManager().beginTransaction()
.replace(R.id.content, prefFragment) .replace(R.id.content, prefFragment)
.addToBackStack(TAG).commit(); .addToBackStack(TAG).commit();
return true; return prefFragment;
}
public int getTitleOfPage(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;
case R.xml.preferences_flattr:
return R.string.flattr_label;
case R.xml.preferences_gpodder:
return R.string.gpodnet_main_label;
default:
return R.string.settings_label;
}
} }
private boolean export(ExportWriter exportWriter) { private boolean export(ExportWriter exportWriter) {
@ -628,9 +656,14 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
setDataFolderText(); setDataFolderText();
break; break;
case R.xml.preferences_integrations: case R.xml.preferences_integrations:
setIntegrationsItemVisibility();
return;
case R.xml.preferences_flattr:
checkFlattrItemVisibility();
break;
case R.xml.preferences_gpodder:
GpodnetPreferences.registerOnSharedPreferenceChangeListener(gpoddernetListener); GpodnetPreferences.registerOnSharedPreferenceChangeListener(gpoddernetListener);
updateGpodnetPreferenceScreen(); updateGpodnetPreferenceScreen();
checkFlattrItemVisibility();
break; break;
case R.xml.preferences_playback: case R.xml.preferences_playback:
checkSonicItemVisibility(); checkSonicItemVisibility();
@ -797,10 +830,13 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
} }
} }
private void setIntegrationsItemVisibility() {
ui.findPreference(PreferenceController.PREF_SCREEN_FLATTR).setEnabled(FlattrUtils.hasAPICredentials());
}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private void checkFlattrItemVisibility() { private void checkFlattrItemVisibility() {
boolean hasFlattrToken = FlattrUtils.hasToken(); 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_AUTH).setEnabled(!hasFlattrToken);
ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setEnabled(hasFlattrToken); ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setEnabled(hasFlattrToken);
ui.findPreference(PreferenceController.PREF_AUTO_FLATTR_PREFS).setEnabled(hasFlattrToken); ui.findPreference(PreferenceController.PREF_AUTO_FLATTR_PREFS).setEnabled(hasFlattrToken);
@ -1115,7 +1151,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
public interface PreferenceUI { public interface PreferenceUI {
void setFragment(PreferenceFragment fragment); void setFragment(PreferenceFragmentCompat fragment);
/** /**
* Finds a preference based on its key. * Finds a preference based on its key.
@ -1124,6 +1160,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
PreferenceScreen getPreferenceScreen(); PreferenceScreen getPreferenceScreen();
Activity getActivity(); AppCompatActivity getActivity();
} }
} }

@ -1,37 +0,0 @@
package de.danoeh.antennapod.preferences;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.preference.CheckBoxPreference;
import android.util.AttributeSet;
import de.danoeh.antennapod.R;
public class SwitchCompatPreference extends CheckBoxPreference {
public SwitchCompatPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public SwitchCompatPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
public SwitchCompatPreference(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public SwitchCompatPreference(Context context) {
super(context);
init();
}
private void init() {
setWidgetLayoutResource(R.layout.preference_switch_layout);
}
}

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.SwitchCompat
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false" />

@ -7,14 +7,14 @@
android:key="prefEnableAutoDl" android:key="prefEnableAutoDl"
android:title="@string/pref_automatic_download_title" android:title="@string/pref_automatic_download_title"
android:defaultValue="false"/> android:defaultValue="false"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:defaultValue="25" android:defaultValue="25"
android:entries="@array/episode_cache_size_entries" android:entries="@array/episode_cache_size_entries"
android:key="prefEpisodeCacheSize" android:key="prefEpisodeCacheSize"
android:title="@string/pref_episode_cache_title" android:title="@string/pref_episode_cache_title"
android:entryValues="@array/episode_cache_size_values" android:entryValues="@array/episode_cache_size_values"
app:useStockLayout="true"/> app:useStockLayout="true"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:defaultValue="-1" android:defaultValue="-1"
android:entries="@array/episode_cleanup_entries" android:entries="@array/episode_cleanup_entries"
android:key="prefEpisodeCleanup" android:key="prefEpisodeCleanup"
@ -22,17 +22,17 @@
android:summary="@string/pref_episode_cleanup_summary" android:summary="@string/pref_episode_cleanup_summary"
android:entryValues="@array/episode_cleanup_values" android:entryValues="@array/episode_cleanup_values"
app:useStockLayout="true"/> app:useStockLayout="true"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:key="prefEnableAutoDownloadOnBattery" android:key="prefEnableAutoDownloadOnBattery"
android:title="@string/pref_automatic_download_on_battery_title" android:title="@string/pref_automatic_download_on_battery_title"
android:summary="@string/pref_automatic_download_on_battery_sum" android:summary="@string/pref_automatic_download_on_battery_sum"
android:defaultValue="true"/> android:defaultValue="true"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:key="prefEnableAutoDownloadOnMobile" android:key="prefEnableAutoDownloadOnMobile"
android:title="@string/pref_autodl_allow_on_mobile_title" android:title="@string/pref_autodl_allow_on_mobile_title"
android:summary="@string/pref_autodl_allow_on_mobile_sum" android:summary="@string/pref_autodl_allow_on_mobile_sum"
android:defaultValue="false"/> android:defaultValue="false"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:key="prefEnableAutoDownloadWifiFilter" android:key="prefEnableAutoDownloadWifiFilter"
android:title="@string/pref_autodl_wifi_filter_title" android:title="@string/pref_autodl_wifi_filter_title"
android:summary="@string/pref_autodl_wifi_filter_sum"/> android:summary="@string/pref_autodl_wifi_filter_sum"/>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<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>

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<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"/>
<SwitchPreference
android:key="pref_gpodnet_notifications"
android:title="@string/pref_gpodnet_notifications_title"
android:summary="@string/pref_gpodnet_notifications_sum"
android:defaultValue="true"/>
</PreferenceScreen>

@ -3,61 +3,14 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceScreen <Preference
android:key="prefFlattrSettings" android:key="prefFlattrSettings"
android:title="@string/flattr_label" android:title="@string/flattr_label"
android:summary="@string/flattr_summary"> 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 <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:key="prefGpodderSettings"
android:title="@string/gpodnet_main_label" android:title="@string/gpodnet_main_label"
android:summary="@string/gpodnet_summary"> 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> </PreferenceScreen>

@ -7,7 +7,7 @@
android:key="prefAutoUpdateIntervall" android:key="prefAutoUpdateIntervall"
android:summary="@string/pref_autoUpdateIntervallOrTime_sum" android:summary="@string/pref_autoUpdateIntervallOrTime_sum"
android:title="@string/pref_autoUpdateIntervallOrTime_title"/> android:title="@string/pref_autoUpdateIntervallOrTime_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefMobileUpdate" android:key="prefMobileUpdate"
@ -20,13 +20,13 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/download_pref_details"> <PreferenceCategory android:title="@string/download_pref_details">
<com.afollestad.materialdialogs.prefs.MaterialEditTextPreference <EditTextPreference
android:defaultValue="4" android:defaultValue="4"
android:inputType="number" android:inputType="number"
android:key="prefParallelDownloads" android:key="prefParallelDownloads"
android:title="@string/pref_parallel_downloads_title" android:title="@string/pref_parallel_downloads_title"
app:useStockLayout="true"/> app:useStockLayout="true"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefShowDownloadReport" android:key="prefShowDownloadReport"

@ -4,39 +4,39 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/interruptions"> <PreferenceCategory android:title="@string/interruptions">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefPauseOnHeadsetDisconnect" android:key="prefPauseOnHeadsetDisconnect"
android:summary="@string/pref_pauseOnDisconnect_sum" android:summary="@string/pref_pauseOnDisconnect_sum"
android:title="@string/pref_pauseOnHeadsetDisconnect_title"/> android:title="@string/pref_pauseOnHeadsetDisconnect_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:dependency="prefPauseOnHeadsetDisconnect" android:dependency="prefPauseOnHeadsetDisconnect"
android:key="prefUnpauseOnHeadsetReconnect" android:key="prefUnpauseOnHeadsetReconnect"
android:summary="@string/pref_unpauseOnHeadsetReconnect_sum" android:summary="@string/pref_unpauseOnHeadsetReconnect_sum"
android:title="@string/pref_unpauseOnHeadsetReconnect_title"/> android:title="@string/pref_unpauseOnHeadsetReconnect_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:dependency="prefPauseOnHeadsetDisconnect" android:dependency="prefPauseOnHeadsetDisconnect"
android:key="prefUnpauseOnBluetoothReconnect" android:key="prefUnpauseOnBluetoothReconnect"
android:summary="@string/pref_unpauseOnBluetoothReconnect_sum" android:summary="@string/pref_unpauseOnBluetoothReconnect_sum"
android:title="@string/pref_unpauseOnBluetoothReconnect_title"/> android:title="@string/pref_unpauseOnBluetoothReconnect_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefPauseForFocusLoss" android:key="prefPauseForFocusLoss"
android:summary="@string/pref_pausePlaybackForFocusLoss_sum" android:summary="@string/pref_pausePlaybackForFocusLoss_sum"
android:title="@string/pref_pausePlaybackForFocusLoss_title"/> android:title="@string/pref_pausePlaybackForFocusLoss_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefResumeAfterCall" android:key="prefResumeAfterCall"
android:summary="@string/pref_resumeAfterCall_sum" android:summary="@string/pref_resumeAfterCall_sum"
android:title="@string/pref_resumeAfterCall_title"/> android:title="@string/pref_resumeAfterCall_title"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:defaultValue="stop" android:defaultValue="stop"
android:entries="@array/video_background_behavior_options" android:entries="@array/video_background_behavior_options"
android:entryValues="@array/video_background_behavior_values" android:entryValues="@array/video_background_behavior_values"
@ -47,13 +47,13 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/buttons"> <PreferenceCategory android:title="@string/buttons">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefHardwareForwardButtonSkips" android:key="prefHardwareForwardButtonSkips"
android:summary="@string/pref_hardwareForwardButtonSkips_sum" android:summary="@string/pref_hardwareForwardButtonSkips_sum"
android:title="@string/pref_hardwareForwardButtonSkips_title"/> android:title="@string/pref_hardwareForwardButtonSkips_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefHardwarePreviousButtonRestarts" android:key="prefHardwarePreviousButtonRestarts"
@ -74,25 +74,25 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/queue_label"> <PreferenceCategory android:title="@string/queue_label">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefEnqueueDownloaded" android:key="prefEnqueueDownloaded"
android:summary="@string/pref_enqueue_downloaded_summary" android:summary="@string/pref_enqueue_downloaded_summary"
android:title="@string/pref_enqueue_downloaded_title" /> android:title="@string/pref_enqueue_downloaded_title" />
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefQueueAddToFront" android:key="prefQueueAddToFront"
android:summary="@string/pref_queueAddToFront_sum" android:summary="@string/pref_queueAddToFront_sum"
android:title="@string/pref_queueAddToFront_title"/> android:title="@string/pref_queueAddToFront_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefFollowQueue" android:key="prefFollowQueue"
android:summary="@string/pref_followQueue_sum" android:summary="@string/pref_followQueue_sum"
android:title="@string/pref_followQueue_title"/> android:title="@string/pref_followQueue_title"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:defaultValue="30" android:defaultValue="30"
android:entries="@array/smart_mark_as_played_values" android:entries="@array/smart_mark_as_played_values"
android:entryValues="@array/smart_mark_as_played_values" android:entryValues="@array/smart_mark_as_played_values"
@ -100,7 +100,7 @@
android:summary="@string/pref_smart_mark_as_played_sum" android:summary="@string/pref_smart_mark_as_played_sum"
android:title="@string/pref_smart_mark_as_played_title" android:title="@string/pref_smart_mark_as_played_title"
app:useStockLayout="true"/> app:useStockLayout="true"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefSkipKeepsEpisode" android:key="prefSkipKeepsEpisode"
@ -109,7 +109,7 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/media_player"> <PreferenceCategory android:title="@string/media_player">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="false" android:enabled="false"
android:key="prefSonic" android:key="prefSonic"
@ -118,7 +118,7 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/experimental_pref"> <PreferenceCategory android:title="@string/experimental_pref">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefCast" android:key="prefCast"

@ -13,13 +13,13 @@
android:key="prefImageCacheSize" android:key="prefImageCacheSize"
android:summary="@string/pref_image_cache_size_sum" android:summary="@string/pref_image_cache_size_sum"
android:defaultValue="100"/> android:defaultValue="100"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefAutoDelete" android:key="prefAutoDelete"
android:summary="@string/pref_auto_delete_sum" android:summary="@string/pref_auto_delete_sum"
android:title="@string/pref_auto_delete_title"/> android:title="@string/pref_auto_delete_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefFavoriteKeepsEpisode" android:key="prefFavoriteKeepsEpisode"

@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/appearance"> <PreferenceCategory android:title="@string/appearance">
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:entryValues="@array/theme_values" android:entryValues="@array/theme_values"
android:entries="@array/theme_options" android:entries="@array/theme_options"
android:title="@string/pref_set_theme_title" android:title="@string/pref_set_theme_title"
@ -16,7 +16,7 @@
android:key="prefHiddenDrawerItems" android:key="prefHiddenDrawerItems"
android:summary="@string/pref_nav_drawer_items_sum" android:summary="@string/pref_nav_drawer_items_sum"
android:title="@string/pref_nav_drawer_items_title"/> android:title="@string/pref_nav_drawer_items_title"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:entryValues="@array/nav_drawer_feed_order_values" android:entryValues="@array/nav_drawer_feed_order_values"
android:entries="@array/nav_drawer_feed_order_options" android:entries="@array/nav_drawer_feed_order_options"
android:title="@string/pref_nav_drawer_feed_order_title" android:title="@string/pref_nav_drawer_feed_order_title"
@ -24,7 +24,7 @@
android:summary="@string/pref_nav_drawer_feed_order_sum" android:summary="@string/pref_nav_drawer_feed_order_sum"
android:defaultValue="0" android:defaultValue="0"
app:useStockLayout="true"/> app:useStockLayout="true"/>
<com.afollestad.materialdialogs.prefs.MaterialListPreference <ListPreference
android:entryValues="@array/nav_drawer_feed_counter_values" android:entryValues="@array/nav_drawer_feed_counter_values"
android:entries="@array/nav_drawer_feed_counter_options" android:entries="@array/nav_drawer_feed_counter_options"
android:title="@string/pref_nav_drawer_feed_counter_title" android:title="@string/pref_nav_drawer_feed_counter_title"
@ -34,13 +34,13 @@
app:useStockLayout="true"/> app:useStockLayout="true"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/external_elements"> <PreferenceCategory android:title="@string/external_elements">
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefExpandNotify" android:key="prefExpandNotify"
android:summary="@string/pref_expandNotify_sum" android:summary="@string/pref_expandNotify_sum"
android:title="@string/pref_expandNotify_title"/> android:title="@string/pref_expandNotify_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefPersistNotify" android:key="prefPersistNotify"
@ -50,7 +50,7 @@
android:key="prefCompactNotificationButtons" android:key="prefCompactNotificationButtons"
android:summary="@string/pref_compact_notification_buttons_sum" android:summary="@string/pref_compact_notification_buttons_sum"
android:title="@string/pref_compact_notification_buttons_title"/> android:title="@string/pref_compact_notification_buttons_title"/>
<de.danoeh.antennapod.preferences.SwitchCompatPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:enabled="true" android:enabled="true"
android:key="prefLockscreenBackground" android:key="prefLockscreenBackground"

@ -67,6 +67,7 @@
<item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</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="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item>
<item type="attr" name="master_switch_background">@color/master_switch_background_light</item> <item type="attr" name="master_switch_background">@color/master_switch_background_light</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style> </style>
<style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark"> <style name="Theme.AntennaPod.Dark" parent="Theme.Base.AntennaPod.Dark">
@ -135,6 +136,7 @@
<item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</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="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item>
<item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style> </style>
<style name="Theme.AntennaPod.Light.NoTitle" parent="Theme.Base.AntennaPod.Light.NoTitle"> <style name="Theme.AntennaPod.Light.NoTitle" parent="Theme.Base.AntennaPod.Light.NoTitle">
@ -204,6 +206,7 @@
<item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_grey600_24dp</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="ic_cast_disconnect">@drawable/ic_cast_disconnect_grey600_36dp</item>
<item type="attr" name="master_switch_background">@color/master_switch_background_light</item> <item type="attr" name="master_switch_background">@color/master_switch_background_light</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style> </style>
<style name="Theme.AntennaPod.Dark.NoTitle" parent="Theme.Base.AntennaPod.Dark.NoTitle"> <style name="Theme.AntennaPod.Dark.NoTitle" parent="Theme.Base.AntennaPod.Dark.NoTitle">
@ -273,6 +276,7 @@
<item type="attr" name="ic_create_new_folder">@drawable/ic_create_new_folder_white_24dp</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="ic_cast_disconnect">@drawable/ic_cast_disconnect_white_36dp</item>
<item type="attr" name="master_switch_background">@color/master_switch_background_dark</item> <item type="attr" name="master_switch_background">@color/master_switch_background_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style> </style>
<style name="Theme.AntennaPod.Dark.Splash" parent="Theme.AppCompat.NoActionBar"> <style name="Theme.AntennaPod.Dark.Splash" parent="Theme.AppCompat.NoActionBar">