Material dialogs in preferences

This commit is contained in:
Martin Fietz 2015-11-08 18:11:28 +01:00
parent 8de90b7948
commit 6184b7f306
2 changed files with 8 additions and 41 deletions

View File

@ -1,33 +0,0 @@
package de.danoeh.antennapod.preferences;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Build;
import android.preference.EditTextPreference;
import android.util.AttributeSet;
import de.danoeh.antennapod.R;
public class CustomEditTextPreference extends EditTextPreference {
public CustomEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public CustomEditTextPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomEditTextPreference(Context context) {
super(context);
}
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
builder.setInverseBackgroundForced(true);
getEditText().setTextColor(getContext().getResources().getColor(R.color.black));
}
}
}

View File

@ -2,7 +2,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/user_interface_label">
<ListPreference
<com.afollestad.materialdialogs.prefs.MaterialListPreference
android:entryValues="@array/theme_values"
android:entries="@array/theme_options"
android:title="@string/pref_set_theme_title"
@ -17,14 +17,14 @@
android:key="prefHiddenDrawerItems"
android:summary="@string/pref_nav_drawer_items_sum"
android:title="@string/pref_nav_drawer_items_title" />
<ListPreference
<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"/>
<ListPreference
<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"
@ -107,7 +107,7 @@
android:key="prefAutoDelete"
android:summary="@string/pref_auto_delete_sum"
android:title="@string/pref_auto_delete_title"/>
<ListPreference
<com.afollestad.materialdialogs.prefs.MaterialListPreference
android:defaultValue="30"
android:entries="@array/smart_mark_as_played_values"
android:entryValues="@array/smart_mark_as_played_values"
@ -145,7 +145,7 @@
android:summary="@string/pref_mobileUpdate_sum"
android:title="@string/pref_mobileUpdate_title"/>
<ListPreference
<com.afollestad.materialdialogs.prefs.MaterialListPreference
android:defaultValue="-1"
android:entries="@array/episode_cleanup_entries"
android:key="prefEpisodeCleanup"
@ -153,12 +153,12 @@
android:summary="@string/pref_episode_cleanup_summary"
android:entryValues="@array/episode_cleanup_values"/>
<de.danoeh.antennapod.preferences.CustomEditTextPreference
android:defaultValue="6"
<com.afollestad.materialdialogs.prefs.MaterialEditTextPreference
android:defaultValue="4"
android:inputType="number"
android:key="prefParallelDownloads"
android:title="@string/pref_parallel_downloads_title"/>
<ListPreference
<com.afollestad.materialdialogs.prefs.MaterialListPreference
android:defaultValue="20"
android:entries="@array/episode_cache_size_entries"
android:key="prefEpisodeCacheSize"