Configure theme and colors separately

pull/413/head
Alex Baker 8 years ago
parent 1643ca397c
commit 9d918950bb

@ -91,7 +91,7 @@
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/BlueGrey"
android:theme="@style/LightBase"
android:allowBackup="true"
android:name=".Tasks"
android:manageSpaceActivity="com.todoroo.astrid.core.OldTaskPreferences">
@ -175,22 +175,22 @@
<activity
android:name=".preferences.HelpAndFeedbackActivity"
android:label="@string/help_and_feedback"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<activity
android:name=".preferences.BasicPreferences"
android:label="@string/TLA_menu_settings"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<activity
android:name=".preferences.MiscellaneousPreferences"
android:label="@string/miscellaneous"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<activity
android:name=".preferences.BackupPreferences"
android:label="@string/backup_BPr_header"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<!-- Activity that configures widget -->
<activity
@ -276,21 +276,21 @@
<activity
android:name=".preferences.AppearancePreferences"
android:label="@string/EPr_appearance_header"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<activity
android:name=".preferences.DateShortcutPreferences"
android:label="@string/date_shortcuts"
android:theme="@style/BlueGrey" />
android:theme="@style/LightBase" />
<activity
android:name="com.todoroo.astrid.core.DefaultsPreferences"
android:label="@string/task_defaults"
android:theme="@style/BlueGrey"/>
android:theme="@style/LightBase"/>
<activity
android:name="com.todoroo.astrid.activity.BeastModePreferences"
android:theme="@style/BlueGrey"/>
android:theme="@style/LightBase"/>
<activity
android:name=".reminders.MissedCallActivity"
@ -318,7 +318,7 @@
<!-- custom filters -->
<activity
android:name="com.todoroo.astrid.core.CustomFilterActivity"
android:theme="@style/BlueGrey"/>
android:theme="@style/LightBase"/>
<!-- alarms -->
<receiver android:name="com.todoroo.astrid.alarms.AlarmTaskRepeatListener">
@ -361,7 +361,7 @@
<activity
android:name="com.todoroo.astrid.gcal.CalendarReminderActivity"
android:theme="@style/BlueGreyDialog"/>
android:theme="@style/LightDialogBase"/>
<receiver android:name="com.todoroo.astrid.gcal.CalendarAlarmReceiver" />
@ -369,7 +369,7 @@
<activity
android:name="com.todoroo.astrid.core.OldTaskPreferences"
android:label="@string/EPr_manage_header"
android:theme="@style/BlueGrey"/>
android:theme="@style/LightBase"/>
<activity
android:name=".activities.ClearAllDataActivity"
@ -404,7 +404,7 @@
android:name="com.todoroo.astrid.files.AACRecordingActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@style/BlueGreyDialog" />
android:theme="@style/LightDialogBase" />
<activity
android:name=".files.MyFilePickerActivity"
@ -431,7 +431,7 @@
<activity
android:name="com.todoroo.astrid.reminders.ReminderPreferences"
android:label="@string/notifications"
android:theme="@style/BlueGrey"/>
android:theme="@style/LightBase"/>
<activity
android:name=".voice.VoiceCommandActivity"

@ -60,15 +60,14 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
private final LayoutInflater inflater;
public FilterAdapter(FilterProvider filterProvider, FilterCounter filterCounter, Activity activity,
Theme theme, ListView listView, boolean navigationDrawer) {
LayoutInflater inflater, ListView listView, boolean navigationDrawer) {
super(activity, 0);
this.filterProvider = filterProvider;
this.filterCounter = filterCounter;
this.activity = activity;
this.listView = listView;
this.navigationDrawer = navigationDrawer;
inflater = theme.getThemedLayoutInflater();
this.inflater = inflater;
}
@Override

@ -13,6 +13,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ContextThemeWrapper;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@ -440,7 +441,10 @@ public class RepeatControlSet extends TaskEditControlFragment {
dialogValue = 1;
}
new NumberPickerDialog(context, themeManager.getDialogThemeResId(), new OnNumberPickedListener() {
ContextThemeWrapper wrapper = new ContextThemeWrapper(getActivity(), themeManager.getDialogThemeResId());
wrapper.getTheme().applyStyle(themeManager.getColorTheme().getResId(), true);
wrapper.getTheme().applyStyle(themeManager.getAccentTheme().getResId(), true);
new NumberPickerDialog(wrapper, new OnNumberPickedListener() {
@Override
public void onNumberPicked(int number) {
setRepeatValue(number);

@ -42,10 +42,10 @@ public class NNumberPickerDialog extends AlertDialog implements OnClickListener
* @param separators text separating the spinners. whole array, or individual
* elements can be null
*/
public NNumberPickerDialog(Context context, int theme, OnNNumberPickedListener callBack,
public NNumberPickerDialog(Context context, OnNNumberPickedListener callBack,
String title, int[] initialValue, int[] incrementBy, int[] start,
int[] end, String[] separators) {
super(context, theme);
super(context);
mCallback = callBack;
setButton(DialogInterface.BUTTON_POSITIVE, context.getText(android.R.string.ok), this);

@ -23,9 +23,9 @@ public class NumberPickerDialog extends AlertDialog implements OnClickListener {
private final NumberPicker mPicker;
private final OnNumberPickedListener mCallback;
public NumberPickerDialog(Context context, int theme, OnNumberPickedListener callBack,
public NumberPickerDialog(Context context, OnNumberPickedListener callBack,
String title, int initialValue, int incrementBy, int start, int end) {
super(context, theme);
super(context);
mCallback = callBack;
setButton(DialogInterface.BUTTON_POSITIVE, context.getText(android.R.string.ok), this);

@ -7,6 +7,7 @@ package com.todoroo.astrid.ui;
import android.content.Context;
import android.content.res.Resources;
import android.support.v7.view.ContextThemeWrapper;
import android.text.format.DateUtils;
import android.view.View;
import android.widget.TextView;
@ -68,7 +69,10 @@ public class TimeDurationControlSet implements OnNNumberPickedListener, View.OnC
@Override
public void onClick(View v) {
if(dialog == null) {
dialog = new NNumberPickerDialog(context, themeManager.getDialogThemeResId(), this,
ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(context, themeManager.getDialogThemeResId());
contextThemeWrapper.getTheme().applyStyle(themeManager.getColorTheme().getResId(), true);
contextThemeWrapper.getTheme().applyStyle(themeManager.getAccentTheme().getResId(), true);
dialog = new NNumberPickerDialog(contextThemeWrapper, this,
context.getResources().getString(R.string.DLG_hour_minutes),
new int[] {0, 0}, new int[] {1, 5}, new int[] {0, 0},
new int[] {999, 59}, new String[] {":", null});

@ -47,8 +47,8 @@ public class DateAndTimePickerActivity extends InjectingAppCompatActivity implem
if (datePickerDialog == null) {
datePickerDialog = new MyDatePickerDialog();
datePickerDialog.initialize(null, initial.getYear(), initial.getMonthOfYear() - 1, initial.getDayOfMonth());
datePickerDialog.setThemeDark(themeManager.getAppTheme().isDark());
datePickerDialog.setAccentColor(themeManager.getAccentColor().getAccentColor());
datePickerDialog.setThemeDark(themeManager.isDarkTheme());
datePickerDialog.setAccentColor(themeManager.getAccentTheme().getAccentColor());
datePickerDialog.show(fragmentManager, FRAG_TAG_DATE_PICKER);
}
datePickerDialog.setOnCancelListener(this);

@ -38,8 +38,8 @@ public class DatePickerActivity extends InjectingAppCompatActivity
if (dialog == null) {
dialog = new MyDatePickerDialog();
dialog.initialize(null, initial.getYear(), initial.getMonthOfYear() - 1, initial.getDayOfMonth());
dialog.setThemeDark(themeManager.getAppTheme().isDark());
dialog.setAccentColor(themeManager.getAccentColor().getAccentColor());
dialog.setThemeDark(themeManager.isDarkTheme());
dialog.setAccentColor(themeManager.getAccentTheme().getAccentColor());
dialog.show(fragmentManager, FRAG_TAG_DATE_PICKER);
}
dialog.setOnDismissListener(this);

@ -13,6 +13,7 @@ import org.tasks.filters.FilterCounter;
import org.tasks.filters.FilterProvider;
import org.tasks.injection.ActivityComponent;
import org.tasks.injection.InjectingAppCompatActivity;
import org.tasks.injection.ThemedInjectingAppCompatActivity;
import org.tasks.preferences.ThemeManager;
import javax.inject.Inject;
@ -37,7 +38,7 @@ public class FilterSelectionActivity extends InjectingAppCompatActivity {
final boolean returnFilter = getIntent().getBooleanExtra(EXTRA_RETURN_FILTER, false);
final FilterAdapter filterAdapter = new FilterAdapter(filterProvider, filterCounter, this,
themeManager.getAppTheme(), null, false);
themeManager.getThemedLayoutInflater(), null, false);
filterAdapter.populateList();
dialogBuilder.newDialog()

@ -42,8 +42,8 @@ public class TimePickerActivity extends InjectingAppCompatActivity implements Ti
if (dialog == null) {
dialog = new MyTimePickerDialog();
dialog.initialize(null, initial.getHourOfDay(), initial.getMinuteOfHour(), 0, DateFormat.is24HourFormat(this));
dialog.setThemeDark(themeManager.getAppTheme().isDark());
dialog.setAccentColor(themeManager.getAccentColor().getAccentColor());
dialog.setThemeDark(themeManager.isDarkTheme());
dialog.setAccentColor(themeManager.getAccentTheme().getAccentColor());
dialog.show(fragmentManager, FRAG_TAG_TIME_PICKER);
}
dialog.setOnDismissListener(this);

@ -8,6 +8,7 @@ public class Tracking {
SET_DEFAULT_LIST(R.string.tracking_category_preferences, R.string.p_default_list),
GTASK_DEFAULT_LIST(R.string.tracking_category_preferences, R.string.p_gtasks_default_list),
SET_THEME(R.string.tracking_category_preferences, R.string.p_theme),
SET_COLOR(R.string.tracking_category_preferences, R.string.p_theme_color),
SET_ACCENT(R.string.tracking_category_preferences, R.string.p_theme_accent),
WIDGET_ADD(R.string.tracking_category_widget, R.string.tracking_action_add),
TIMER_START(R.string.tracking_category_timer, R.string.tracking_action_start),

@ -2,10 +2,12 @@ package org.tasks.dialogs;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ContextThemeWrapper;
import com.todoroo.andlib.data.Callback;
import com.todoroo.andlib.utility.AndroidUtilities;
import org.tasks.preferences.ThemeManager;
@ -23,9 +25,7 @@ public class DialogBuilder {
}
public AlertDialog.Builder newDialog() {
ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activity, themeManager.getDialogThemeResId());
contextThemeWrapper.getTheme().applyStyle(themeManager.getAccentColor().getResId(), true);
return new AlertDialog.Builder(contextThemeWrapper);
return new AlertDialog.Builder(buildDialogWrapper());
}
public AlertDialog.Builder newMessageDialog(int message, Object... formatArgs) {
@ -33,7 +33,7 @@ public class DialogBuilder {
}
public ProgressDialog newProgressDialog() {
ProgressDialog progressDialog = new ProgressDialog(activity, themeManager.getDialogThemeResId());
ProgressDialog progressDialog = new ProgressDialog(buildDialogWrapper());
if (AndroidUtilities.preLollipop()) {
progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.R.color.transparent));
}
@ -49,4 +49,12 @@ public class DialogBuilder {
dialog.setCanceledOnTouchOutside(false);
return dialog;
}
private ContextThemeWrapper buildDialogWrapper() {
ContextThemeWrapper wrapper = new ContextThemeWrapper(activity, themeManager.getBaseTheme().getDialogThemeResId());
Resources.Theme theme = wrapper.getTheme();
theme.applyStyle(themeManager.getColorTheme().getResId(), true);
theme.applyStyle(themeManager.getAccentTheme().getResId(), true);
return wrapper;
}
}

@ -32,13 +32,10 @@ public class ThemePickerDialog extends InjectingDialogFragment {
public enum ColorPalette {
THEMES,
COLORS,
ACCENTS
}
public static ThemePickerDialog newThemePickerDialog() {
return newThemePickerDialog(ColorPalette.THEMES);
}
public static ThemePickerDialog newThemePickerDialog(ColorPalette palette) {
ThemePickerDialog dialog = new ThemePickerDialog();
dialog.palette = palette;
@ -66,29 +63,28 @@ public class ThemePickerDialog extends InjectingDialogFragment {
palette = (ColorPalette) savedInstanceState.getSerializable(EXTRA_COLOR_PALETTE);
}
final String[] themes = context.getResources().getStringArray(palette == ColorPalette.THEMES ? R.array.themes : R.array.accents);
final String[] themes = context.getResources().getStringArray(getNameRes());
final boolean purchasedThemes = preferences.hasPurchase(R.string.p_purchased_themes);
final LayoutInflater inflater = themeManager.getThemedLayoutInflater();
ListAdapter adapter = new ArrayAdapter<String>(context, R.layout.color_selection_row, themes) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
LayoutInflater inflater = getActivity().getLayoutInflater();
row = inflater.inflate(R.layout.color_selection_row, parent, false);
}
Resources resources = context.getResources();
Theme theme = palette == ColorPalette.THEMES ? themeManager.getTheme(position) : themeManager.getAccent(position);
Theme theme = getTheme(position);
ImageView primary = (ImageView) row.findViewById(R.id.color_primary);
Drawable original = resources.getDrawable(purchasedThemes || position < 2
? R.drawable.ic_lens_black_24dp
: R.drawable.ic_vpn_key_black_24dp);
Drawable wrapped = DrawableCompat.wrap(original.mutate());
int colorResId = palette == ColorPalette.THEMES ? theme.getPrimaryColor() : theme.getAccentColor();
DrawableCompat.setTint(wrapped, colorResId);
DrawableCompat.setTint(wrapped, getDisplayColor(theme));
primary.setImageDrawable(wrapped);
TextView text = (TextView) row.findViewById(android.R.id.text1);
@ -104,7 +100,7 @@ public class ThemePickerDialog extends InjectingDialogFragment {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
if (purchasedThemes || which < 2) {
callback.themePicked(palette, themeManager.getTheme(which));
callback.themePicked(palette, themeManager.getColor(which));
} else {
callback.initiateThemePurchase();
}
@ -113,6 +109,39 @@ public class ThemePickerDialog extends InjectingDialogFragment {
.show();
}
private int getNameRes() {
switch (palette) {
case COLORS:
return R.array.colors;
case ACCENTS:
return R.array.accents;
default:
return R.array.themes;
}
}
private Theme getTheme(int position) {
switch (palette) {
case COLORS:
return themeManager.getColor(position);
case ACCENTS:
return themeManager.getAccent(position);
default:
return themeManager.getBaseTheme(position);
}
}
private int getDisplayColor(Theme theme) {
switch (palette) {
case COLORS:
return theme.getPrimaryColor();
case ACCENTS:
return theme.getAccentColor();
default:
return theme.getContentBackground();
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);

@ -42,7 +42,7 @@ public abstract class BaseBasicPreferences extends InjectingPreferenceActivity i
addPreferencesFromResource(R.xml.preferences_privacy);
Preference themePreference = findPreference(getString(R.string.p_theme));
themePreference.setSummary(themeManager.getAppTheme().getName());
themePreference.setSummary(themeManager.getBaseTheme().getName());
themePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
@ -54,8 +54,21 @@ public abstract class BaseBasicPreferences extends InjectingPreferenceActivity i
return false;
}
});
Preference colorPreference = findPreference(getString(R.string.p_theme_color));
colorPreference.setSummary(themeManager.getColorTheme().getName());
colorPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager.findFragmentByTag(FRAG_TAG_THEME_PICKER) == null) {
newThemePickerDialog(ThemePickerDialog.ColorPalette.COLORS)
.show(fragmentManager, FRAG_TAG_THEME_PICKER);
}
return false;
}
});
Preference accentPreference = findPreference(getString(R.string.p_theme_accent));
accentPreference.setSummary(themeManager.getAccentColor().getName());
accentPreference.setSummary(themeManager.getAccentTheme().getName());
accentPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
@ -114,12 +127,19 @@ public abstract class BaseBasicPreferences extends InjectingPreferenceActivity i
@Override
public void themePicked(ThemePickerDialog.ColorPalette palette, Theme theme) {
int index = theme.getThemeIndex();
if (palette == ThemePickerDialog.ColorPalette.THEMES) {
preferences.setInt(R.string.p_theme, index);
tracker.reportEvent(Tracking.Events.SET_THEME, Integer.toString(index));
} else if (palette == ThemePickerDialog.ColorPalette.ACCENTS) {
preferences.setInt(R.string.p_theme_accent, index);
tracker.reportEvent(Tracking.Events.SET_ACCENT, Integer.toString(index));
switch (palette) {
case THEMES:
preferences.setInt(R.string.p_theme, index);
tracker.reportEvent(Tracking.Events.SET_THEME, Integer.toString(index));
break;
case COLORS:
preferences.setInt(R.string.p_theme_color, index);
tracker.reportEvent(Tracking.Events.SET_COLOR, Integer.toString(index));
break;
case ACCENTS:
preferences.setInt(R.string.p_theme_accent, index);
tracker.reportEvent(Tracking.Events.SET_ACCENT, Integer.toString(index));
break;
}
result.putBoolean(AppearancePreferences.EXTRA_RESTART, true);
recreate();

@ -80,11 +80,6 @@ public class Preferences {
return setting < 0 || setting > DateTime.MAX_MILLIS_PER_DAY ? defaultValue : setting;
}
@Deprecated
public boolean useDarkWidgetTheme(int widgetId) {
return getBoolean(WidgetConfigActivity.PREF_DARK_THEME + widgetId, false);
}
public boolean isDefaultCalendarSet() {
String defaultCalendar = getDefaultCalendar();
return defaultCalendar != null && !defaultCalendar.equals("-1") && !defaultCalendar.equals("0");

@ -20,18 +20,11 @@ public class Theme {
this.themeRes = themeRes;
}
public LayoutInflater getThemedLayoutInflater() {
return (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public boolean isDark() {
return themeIndex == 1;
}
public String getName() {
return name;
}
@Deprecated
public int getThemeIndex() {
return themeIndex;
}

@ -1,6 +1,7 @@
package org.tasks.preferences;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import javax.inject.Inject;
@ -23,20 +24,20 @@ public class ThemeApplicator {
}
public void applyTheme() {
applyTheme(
themeManager.getAppTheme().getResId(),
themeManager.getAccentColor().getResId());
applyTheme(themeManager.getBaseTheme(), themeManager.getColorTheme(), themeManager.getAccentTheme());
}
private void applyTheme(int themeResId, int accentResId) {
activity.setTheme(themeResId);
activity.getTheme().applyStyle(accentResId, true);
private void applyTheme(Theme theme, Theme color, Theme accent) {
activity.setTheme(theme.getResId());
Resources.Theme activityTheme = activity.getTheme();
activityTheme.applyStyle(color.getResId(), true);
activityTheme.applyStyle(accent.getResId(), true);
activity.getWindow().setFormat(PixelFormat.RGBA_8888);
}
private void applyStatusBarColor() {
if (atLeastLollipop()) {
Theme appTheme = themeManager.getAppTheme();
Theme appTheme = themeManager.getColorTheme();
activity.getWindow().setStatusBarColor(appTheme.getPrimaryDarkColor());
}
}

@ -1,6 +1,9 @@
package org.tasks.preferences;
import android.content.Context;
import android.content.res.Resources;
import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import org.tasks.R;
import org.tasks.injection.ForApplication;
@ -15,6 +18,7 @@ public class ThemeManager {
private final Context context;
private final Preferences preferences;
private final String[] themeNames;
private final String[] colorNames;
private final String[] accentNames;
@Inject
@ -22,35 +26,70 @@ public class ThemeManager {
this.context = context;
this.preferences = preferences;
themeNames = context.getResources().getStringArray(R.array.themes);
colorNames = context.getResources().getStringArray(R.array.colors);
accentNames = context.getResources().getStringArray(R.array.accents);
}
public Theme getAppTheme() {
return getTheme(preferences.getInt(R.string.p_theme, 0));
public boolean isDarkTheme() {
return preferences.getInt(R.string.p_theme, 0) > 0;
}
public Theme getAccentColor() {
public LayoutInflater getThemedLayoutInflater() {
ContextThemeWrapper wrapper = new ContextThemeWrapper(context, getBaseTheme().getResId());
Resources.Theme theme = wrapper.getTheme();
theme.applyStyle(getColorTheme().getResId(), true);
theme.applyStyle(getAccentTheme().getResId(), true);
return (LayoutInflater) wrapper.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public Theme getBaseTheme() {
return getBaseTheme(preferences.getInt(R.string.p_theme, 0));
}
public Theme getColorTheme() {
return getColor(preferences.getInt(R.string.p_theme_color, 0));
}
public Theme getAccentTheme() {
return getAccent(preferences.getInt(R.string.p_theme_accent, 1));
}
public Theme getTheme(int themeIndex) {
public Theme getBaseTheme(int themeIndex) {
return new Theme(context, themeIndex, getThemeResId(themeIndex), themeNames[themeIndex]);
}
public Theme getColor(int themeIndex) {
return new Theme(context, themeIndex, getColorResId(themeIndex), colorNames[themeIndex]);
}
public Theme getAccent(int accentIndex) {
return new Theme(context, accentIndex, getAccentResId(accentIndex), accentNames[accentIndex]);
}
public Theme getWidgetTheme(int widgetId) {
int defaultTheme = preferences.useDarkWidgetTheme(widgetId) ? 1 : 0;
return getTheme(preferences.getInt(WidgetConfigActivity.PREF_THEME + widgetId, defaultTheme));
return getBaseTheme(preferences.getInt(WidgetConfigActivity.PREF_THEME + widgetId, 0));
}
public Theme getWidgetColor(int widgetId) {
return getColor(preferences.getInt(WidgetConfigActivity.PREF_COLOR + widgetId, 0));
}
public int getDialogThemeResId() {
return getAppTheme().getDialogThemeResId();
return getBaseTheme().getDialogThemeResId();
}
private int getThemeResId(int index) {
switch (index) {
case 1:
return R.style.BaseBlack;
case 2:
return R.style.DarkOverride;
default:
return R.style.LightOverride;
}
}
private int getColorResId(int index) {
switch (index) {
case 1:
return R.style.Black;

@ -145,7 +145,7 @@ public class NavigationDrawerFragment extends InjectingFragment {
private void setUpList() {
adapter = new FilterAdapter(filterProvider, filterCounter, getActivity(),
themeManager.getAppTheme(), mDrawerListView, true);
themeManager.getThemedLayoutInflater(), mDrawerListView, true);
mDrawerListView.setAdapter(adapter);
registerForContextMenu(mDrawerListView);
}

@ -24,8 +24,8 @@ public abstract class BaseWidgetConfigActivity extends InjectingAppCompatActivit
public static final String PREF_WIDGET_ID = "widget-id-";
public static final String PREF_SHOW_DUE_DATE = "widget-show-due-date-";
public static final String PREF_HIDE_CHECKBOXES = "widget-hide-checkboxes-";
@Deprecated public static final String PREF_DARK_THEME = "widget-dark-theme-";
public static final String PREF_THEME = "widget-theme-";
public static final String PREF_THEME = "widget-theme-v2-";
public static final String PREF_COLOR = "widget-color-";
public static final String PREF_HIDE_HEADER = "widget-hide-header-";
@Deprecated public static final String PREF_WIDGET_OPACITY = "widget-opacity-";
public static final String PREF_WIDGET_OPACITY_V2 = "widget-opacity-v2";
@ -77,7 +77,11 @@ public abstract class BaseWidgetConfigActivity extends InjectingAppCompatActivit
@Override
public void themePicked(ThemePickerDialog.ColorPalette palette, Theme theme) {
widgetConfigDialog.setTheme(theme);
if (palette == ThemePickerDialog.ColorPalette.THEMES) {
widgetConfigDialog.setTheme(theme);
} else {
widgetConfigDialog.setColor(theme);
}
}
protected void showThemeSelection() {

@ -96,6 +96,7 @@ public class TasksWidget extends InjectingAppWidgetProvider {
rvIntent.putExtra(ScrollableWidgetUpdateService.FILTER_ID, filterId);
rvIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id);
rvIntent.setData(Uri.parse(rvIntent.toUri(Intent.URI_INTENT_SCHEME)));
Theme color = themeManager.getWidgetColor(id);
Theme theme = themeManager.getWidgetTheme(id);
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.scrollable_widget);
if (preferences.getBoolean(WidgetConfigActivity.PREF_HIDE_HEADER + id, false)) {
@ -107,10 +108,10 @@ public class TasksWidget extends InjectingAppWidgetProvider {
remoteViews.setImageViewBitmap(R.id.widget_background,
getSolidBackground(theme.getContentBackground()));
remoteViews.setImageViewBitmap(R.id.widget_header_background,
getSolidBackground(theme.getPrimaryColor()));
getSolidBackground(color.getPrimaryColor()));
remoteViews.setInt(R.id.widget_background, "setAlpha", opacity);
remoteViews.setInt(R.id.widget_header_background, "setAlpha", opacity);
if (!theme.isDark()) {
if (theme.getThemeIndex() != 1 || color.getThemeIndex() != 1) {
remoteViews.setInt(R.id.widget_header_separator, "setVisibility", View.GONE);
}

@ -17,8 +17,8 @@ import com.todoroo.astrid.api.Filter;
import org.tasks.R;
import org.tasks.activities.FilterSelectionActivity;
import org.tasks.dialogs.ThemePickerDialog;
import org.tasks.dialogs.DialogBuilder;
import org.tasks.dialogs.ThemePickerDialog;
import org.tasks.injection.DialogFragmentComponent;
import org.tasks.injection.ForApplication;
import org.tasks.injection.InjectingDialogFragment;
@ -40,6 +40,7 @@ import static org.tasks.dialogs.ThemePickerDialog.newThemePickerDialog;
public class WidgetConfigDialog extends InjectingDialogFragment implements SeekBar.OnSeekBarChangeListener {
private static final String FRAG_TAG_THEME_SELECTION = "frag_tag_theme_selection";
private static final String FRAG_TAG_COLOR_SELECTION = "frag_tag_color_selection";
private static final String EXTRA_FILTER = "extra_filter";
private static final String EXTRA_THEME = "extra_theme";
private static final String EXTRA_APP_WIDGET_ID = "extra_app_widget_id";
@ -70,6 +71,11 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
updateTheme();
}
public void setColor(Theme theme) {
this.color = theme.getThemeIndex();
updateColor();
}
public interface WidgetConfigCallback {
void ok();
@ -81,6 +87,7 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
@BindView(R.id.opacity_value) TextView opacityValue;
@BindView(R.id.selected_filter) TextView selectedFilter;
@BindView(R.id.selected_theme) TextView selectedTheme;
@BindView(R.id.selected_color) TextView selectedColor;
@BindView(R.id.hideDueDate) CheckBox hideDueDate;
@BindView(R.id.hideCheckboxes) CheckBox hideCheckBoxes;
@BindView(R.id.hideHeader) CheckBox hideHeader;
@ -94,13 +101,14 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
private Filter filter;
private int theme = 0;
private int color = 0;
private int appWidgetId;
private WidgetConfigCallback callback;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
View view = themeManager.getAppTheme().getThemedLayoutInflater().inflate(R.layout.widget_config_activity, null);
View view = themeManager.getThemedLayoutInflater().inflate(R.layout.widget_config_activity, null);
ButterKnife.bind(this, view);
@ -117,6 +125,7 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
updateFilter();
updateTheme();
updateColor();
updateOpacity();
return dialogBuilder.newDialog()
@ -164,7 +173,11 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
}
private void updateTheme() {
selectedTheme.setText(themeManager.getTheme(theme).getName());
selectedTheme.setText(themeManager.getBaseTheme(theme).getName());
}
private void updateColor() {
selectedColor.setText(themeManager.getColor(color).getName());
}
@OnClick(R.id.filter_selection)
@ -178,7 +191,15 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
public void showThemeSelection() {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager.findFragmentByTag(FRAG_TAG_THEME_SELECTION) == null) {
newThemePickerDialog().show(fragmentManager, FRAG_TAG_THEME_SELECTION);
newThemePickerDialog(ThemePickerDialog.ColorPalette.THEMES).show(fragmentManager, FRAG_TAG_THEME_SELECTION);
}
}
@OnClick(R.id.theme_color)
public void showColorSelection() {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager.findFragmentByTag(FRAG_TAG_COLOR_SELECTION) == null) {
newThemePickerDialog(ThemePickerDialog.ColorPalette.COLORS).show(fragmentManager, FRAG_TAG_COLOR_SELECTION);
}
}
@ -205,6 +226,7 @@ public class WidgetConfigDialog extends InjectingDialogFragment implements SeekB
preferences.setBoolean(WidgetConfigActivity.PREF_HIDE_CHECKBOXES + appWidgetId, hideCheckBoxes.isChecked());
preferences.setBoolean(WidgetConfigActivity.PREF_HIDE_HEADER + appWidgetId, hideHeader.isChecked());
preferences.setInt(WidgetConfigActivity.PREF_THEME + appWidgetId, theme);
preferences.setInt(WidgetConfigActivity.PREF_COLOR + appWidgetId, color);
preferences.setInt(WidgetConfigActivity.PREF_WIDGET_OPACITY_V2 + appWidgetId, opacitySeekbar.getProgress());
// force update after setting preferences

@ -7,6 +7,4 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator"/>
</LinearLayout>

@ -12,8 +12,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<com.commonsware.cwac.tlv.TouchListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tlv="http://schemas.android.com/apk/res/org.tasks"

@ -12,8 +12,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"

@ -7,8 +7,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

@ -10,8 +10,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dp"
@ -95,11 +93,6 @@
</LinearLayout>
</ScrollView>
<View
android:layout_width="fill_parent"
android:layout_height="1px"
android:background="?attr/asToolbarSeparator" />
<FrameLayout
android:id="@+id/comment_bar"
android:layout_width="match_parent"

@ -7,6 +7,4 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
</LinearLayout>

@ -20,8 +20,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"

@ -7,8 +7,6 @@
<include layout="@layout/toolbar" />
<include layout="@layout/toolbar_separator" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

@ -1,5 +0,0 @@
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar_separator"
android:layout_width="match_parent"
android:layout_height="?attr/toolbarSeparatorHeight"
android:background="?attr/asToolbarSeparator" />

@ -60,6 +60,32 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/theme_color"
style="@style/WidgetConfigRow">
<TextView
android:id="@+id/selected_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:textColor="?attr/asTextColor"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@id/selected_color"
android:layout_toStartOf="@id/selected_color"
android:text="@string/color"
android:textColor="?attr/asTextColor"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout style="@style/WidgetConfigRow">
<TextView

@ -69,6 +69,12 @@
</string-array>
<string-array name="themes">
<item>@string/theme_light</item>
<item>@string/theme_black</item>
<item>@string/theme_dark</item>
</string-array>
<string-array name="colors">
<item>@string/theme_blue_grey</item>
<item>@string/theme_black</item>
<item>@string/theme_red</item>

@ -11,19 +11,15 @@
<attr name="task_edit_divider" format="color" />
<attr name="asContentBackground" format="color" />
<attr name="asTextColor" format="color" />
<attr name="asTextColorInverse" format="color" />
<attr name="asTextColorHint" format="color" />
<attr name="asDetailsColor" format="color" />
<attr name="asDueDateColor" format="color" />
<attr name="asDueDateCompletedColor" format="color" />
<attr name="asSeparatorBackground" format="color" />
<attr name="asToolbarSeparator" format="color" />
<attr name="asSeparator" format="color" />
<attr name="asListDividerColor" format="color" />
<attr name="asThemeTextColor" format="color" />
<attr name="asEditTextBackground" format="reference" />
<attr name="icon_tint" format="color"/>
<attr name="toolbarSeparatorHeight" format="dimension" />
<attr name="separatorHeight" format="dimension" />
<attr name="popup_theme" format="reference" />

@ -87,9 +87,12 @@
<color name="overdue">@color/red_500</color>
<color name="task_list_done">#ff777777</color>
<color name="task_edit_deadline_gray">#888888</color>
<color name="drawer_background">#efefef</color>
<color name="drawer_background_dark">#303030</color>
<color name="md_dark_background">#303030</color>
<color name="md_light_background">#fafafa</color>
<color name="drawer_background">#f5f5f5</color>
<color name="drawer_background_dark">#212121</color>
<color name="drawer_background_selected">#dddddd</color>
<color name="drawer_background_selected_dark">#535353</color>
<color name="white_text">#fff</color>

@ -301,8 +301,9 @@
<string name="tesla_unread">TeslaUnread</string>
<string name="tasker_locale">Tasker/Locale</string>
<string name="dashclock">DashClock extension</string>
<string name="p_theme">selected_theme</string>
<string name="p_theme_accent">selected_theme_accent</string>
<string name="p_theme">theme_style</string>
<string name="p_theme_color">theme_color</string>
<string name="p_theme_accent">theme_accent</string>
<string name="p_gtasks_default_list">default_gtasks_list</string>
</resources>

@ -865,6 +865,8 @@ File %1$s contained %2$s.\n\n
<string name="opacity">Opacity</string>
<string name="theme">Theme</string>
<string name="color">Color</string>
<string name="accent">Accent</string>
<string name="themes">Additional themes</string>
<string name="theme_red">Red</string>
<string name="theme_pink">Pink</string>
@ -886,6 +888,8 @@ File %1$s contained %2$s.\n\n
<string name="theme_grey">Grey</string>
<string name="theme_blue_grey">Blue Grey</string>
<string name="theme_black">Black</string>
<string name="theme_light">Light</string>
<string name="theme_dark">Dark</string>
<string name="default_value">Default</string>
<string-array name="sync_SPr_interval_entries">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Amber" parent="LightOverride">
<style name="Amber">
<item name="colorPrimary">@color/amber_500</item>
<item name="colorPrimaryDark">@color/amber_700</item>
<item name="colorAccent">@color/purple_a400</item>
<item name="alertDialogTheme">@style/AmberDialog</item>
</style>
<style name="AmberDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/amber_500</item>
<item name="colorPrimaryDark">@color/amber_700</item>
<item name="colorAccent">@color/purple_a400</item>
</style>
<style name="AmberAccent">

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="BaseBlack" parent="DarkOverride">
<item name="android:windowBackground">@android:color/black</item>
<item name="asContentBackground">@android:color/black</item>
</style>
</resources>

@ -2,13 +2,46 @@
<resources>
<style name="DarkBase" parent="Theme.AppCompat.NoActionBar">
<item name="popup_theme">@style/ThemeOverlay.AppCompat</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:windowBackground">@color/md_dark_background</item>
<item name="drawer_background">@color/drawer_background_dark</item>
<item name="drawer_background_selected">@color/drawer_background_selected_dark</item>
<item name="asSeparator">@android:color/transparent</item>
<item name="android:actionModeBackground">?attr/colorPrimary</item>
<item name="asContentBackground">@color/md_dark_background</item>
<item name="asTextColor">@android:color/white</item>
<item name="asTextColorHint">@android:color/darker_gray</item>
<item name="icon_tint">@android:color/white</item>
<item name="task_edit_divider">@color/task_edit_divider</item>
<item name="asDueDateColor">#c3c3c3</item>
<item name="asEditTextBackground">@null</item>
<item name="asDueDateCompletedColor">#ff777777</item>
<item name="separatorHeight">1px</item>
<item name="asDetailsColor">#6666aa</item>
<item name="asListDividerColor">#dddddd</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="android:spinnerItemStyle">@style/SpinnerNoPadding</item>
<item name="alertDialogTheme">@style/DialogBaseDark</item>
</style>
<style name="DarkOverride" parent="DarkBase">
</style>
<style name="DialogBaseDark" parent="@style/Theme.AppCompat.Dialog">
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="asTextColor">@android:color/white</item>
<item name="asListDividerColor">#dddddd</item>
<item name="icon_tint">@android:color/white</item>
</style>
</resources>

@ -3,21 +3,17 @@
<style name="LightBase" parent="Theme.AppCompat.Light.NoActionBar">
<item name="popup_theme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowBackground">@color/md_light_background</item>
<item name="asEditTextBackground">@null</item>
<item name="windowActionModeOverlay">true</item>
<item name="drawer_background">@color/drawer_background</item>
<item name="drawer_background_selected">@color/drawer_background_selected</item>
<item name="asDueDateCompletedColor">#ff777777</item>
<item name="asToolbarSeparator">@android:color/transparent</item>
<item name="asSeparator">?attr/asSeparatorBackground</item>
<item name="toolbarSeparatorHeight">0dp</item>
<item name="asSeparator">#888888</item>
<item name="separatorHeight">1px</item>
<item name="asSeparatorBackground">#888888</item>
<item name="asContentBackground">@android:color/white</item>
<item name="asContentBackground">@color/md_light_background</item>
<item name="asTextColor">@android:color/black</item>
<item name="asTextColorHint">@android:color/darker_gray</item>
<item name="asTextColorInverse">@android:color/white</item>
<item name="asDetailsColor">#6666aa</item>
<item name="asDueDateColor">#878787</item>
<item name="asListDividerColor">#dddddd</item>
@ -26,6 +22,7 @@
<item name="task_edit_divider">@color/task_edit_divider</item>
<item name="android:spinnerItemStyle">@style/SpinnerNoPadding</item>
<item name="android:actionModeBackground">?attr/colorPrimary</item>
<item name="alertDialogTheme">@style/LightDialogBase</item>
</style>
<style name="LightOverride" parent="LightBase">

@ -1,51 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Black" parent="DarkOverride">
<style name="Black">
<item name="colorPrimary">@color/black_primary</item>
<item name="colorPrimaryDark">@color/black_primary_dark</item>
<item name="colorAccent">@color/red_500</item>
<item name="popup_theme">@style/ThemeOverlay.AppCompat</item>
<item name="android:windowBackground">@android:color/black</item>
<item name="drawer_background">@color/drawer_background_dark</item>
<item name="drawer_background_selected">@color/drawer_background_selected_dark</item>
<item name="toolbarSeparatorHeight">1px</item>
<item name="asToolbarSeparator">@android:color/white</item>
<item name="asSeparator">?attr/asToolbarSeparator</item>
<item name="android:actionModeBackground">@color/black_primary</item>
<item name="asContentBackground">@android:color/black</item>
<item name="asTextColor">@android:color/white</item>
<item name="asTextColorHint">@android:color/darker_gray</item>
<item name="asTextColorInverse">@android:color/black</item>
<item name="icon_tint">@android:color/white</item>
<item name="task_edit_divider">@color/task_edit_divider</item>
<item name="asDueDateColor">#c3c3c3</item>
<item name="asEditTextBackground">@null</item>
<item name="windowActionModeOverlay">true</item>
<item name="asDueDateCompletedColor">#ff777777</item>
<item name="separatorHeight">1px</item>
<item name="asSeparatorBackground">#888888</item>
<item name="asDetailsColor">#6666aa</item>
<item name="asListDividerColor">#dddddd</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="android:spinnerItemStyle">@style/SpinnerNoPadding</item>
<item name="alertDialogTheme">@style/BlackDialog</item>
</style>
<style name="BlackDialog" parent="DialogBaseDark">
<item name="colorPrimary">@color/black_primary</item>
<item name="colorPrimaryDark">@color/black_primary_dark</item>
<item name="colorAccent">@color/red_a400</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="asThemeTextColor">@color/dark_blue_theme_color</item>
<item name="asTextColor">@android:color/white</item>
<item name="asListDividerColor">#dddddd</item>
<item name="icon_tint">@android:color/white</item>
</style>
</resources>

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Blue" parent="LightOverride">
<style name="Blue">
<item name="colorPrimary">@color/blue_500</item>
<item name="colorPrimaryDark">@color/blue_700</item>
<item name="colorAccent">@color/pink_a400</item>
<item name="alertDialogTheme">@style/BlueDialog</item>
</style>
<style name="BlueDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/blue_500</item>
<item name="colorPrimaryDark">@color/blue_700</item>
<item name="colorAccent">@color/pink_a400</item>
</style>
<style name="BlueAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="BlueGrey" parent="LightOverride">
<style name="BlueGrey">
<item name="colorPrimary">@color/blue_grey_500</item>
<item name="colorPrimaryDark">@color/blue_grey_700</item>
<item name="colorAccent">@color/red_500</item>
<item name="alertDialogTheme">@style/BlueGreyDialog</item>
</style>
<style name="BlueGreyDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/blue_grey_500</item>
<item name="colorPrimaryDark">@color/blue_grey_700</item>
<item name="colorAccent">@color/red_500</item>
</style>
<style name="BlueGreyAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Brown" parent="LightOverride">
<style name="Brown">
<item name="colorPrimary">@color/brown_500</item>
<item name="colorPrimaryDark">@color/brown_700</item>
<item name="colorAccent">@color/red_a400</item>
<item name="alertDialogTheme">@style/BrownDialog</item>
</style>
<style name="BrownDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/brown_500</item>
<item name="colorPrimaryDark">@color/brown_700</item>
<item name="colorAccent">@color/red_a400</item>
</style>
</resources>

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Cyan" parent="LightOverride">
<style name="Cyan">
<item name="colorPrimary">@color/cyan_500</item>
<item name="colorPrimaryDark">@color/cyan_700</item>
<item name="colorAccent">@color/amber_a400</item>
<item name="alertDialogTheme">@style/CyanDialog</item>
</style>
<style name="CyanDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/cyan_500</item>
<item name="colorPrimaryDark">@color/cyan_700</item>
<item name="colorAccent">@color/amber_a400</item>
</style>
<style name="CyanAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DeepOrange" parent="LightOverride">
<style name="DeepOrange">
<item name="colorPrimary">@color/deep_orange_500</item>
<item name="colorPrimaryDark">@color/deep_orange_700</item>
<item name="colorAccent">@color/indigo_a400</item>
<item name="alertDialogTheme">@style/DeepOrangeDialog</item>
</style>
<style name="DeepOrangeDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/deep_orange_500</item>
<item name="colorPrimaryDark">@color/deep_orange_700</item>
<item name="colorAccent">@color/indigo_a400</item>
</style>
<style name="DeepOrangeAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DeepPurple" parent="LightOverride">
<style name="DeepPurple">
<item name="colorPrimary">@color/deep_purple_500</item>
<item name="colorPrimaryDark">@color/deep_purple_700</item>
<item name="colorAccent">@color/pink_a400</item>
<item name="alertDialogTheme">@style/DeepPurpleDialog</item>
</style>
<style name="DeepPurpleDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/deep_purple_500</item>
<item name="colorPrimaryDark">@color/deep_purple_700</item>
<item name="colorAccent">@color/pink_a400</item>
</style>
<style name="DeepPurpleAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Green" parent="LightOverride">
<style name="Green">
<item name="colorPrimary">@color/green_500</item>
<item name="colorPrimaryDark">@color/green_700</item>
<item name="colorAccent">@color/pink_a400</item>
<item name="alertDialogTheme">@style/GreenDialog</item>
</style>
<style name="GreenDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/green_500</item>
<item name="colorPrimaryDark">@color/green_700</item>
<item name="colorAccent">@color/pink_a400</item>
</style>
<style name="GreenAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Grey" parent="LightOverride">
<style name="Grey">
<item name="colorPrimary">@color/grey_500</item>
<item name="colorPrimaryDark">@color/grey_700</item>
<item name="colorAccent">@color/amber_a400</item>
<item name="alertDialogTheme">@style/GreyDialog</item>
</style>
<style name="GreyDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/grey_500</item>
<item name="colorPrimaryDark">@color/grey_700</item>
<item name="colorAccent">@color/amber_a400</item>
</style>
</resources>

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Indigo" parent="LightOverride">
<style name="Indigo">
<item name="colorPrimary">@color/indigo_500</item>
<item name="colorPrimaryDark">@color/indigo_700</item>
<item name="colorAccent">@color/red_a400</item>
<item name="alertDialogTheme">@style/IndigoDialog</item>
</style>
<style name="IndigoDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/indigo_500</item>
<item name="colorPrimaryDark">@color/indigo_700</item>
<item name="colorAccent">@color/red_a400</item>
</style>
<style name="IndigoAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LightBlue" parent="LightOverride">
<style name="LightBlue">
<item name="colorPrimary">@color/light_blue_500</item>
<item name="colorPrimaryDark">@color/light_blue_700</item>
<item name="colorAccent">@color/pink_a400</item>
<item name="alertDialogTheme">@style/LightBlueDialog</item>
</style>
<style name="LightBlueDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/light_blue_500</item>
<item name="colorPrimaryDark">@color/light_blue_700</item>
<item name="colorAccent">@color/pink_a400</item>
</style>
<style name="LightBlueAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LightGreen" parent="LightOverride">
<style name="LightGreen">
<item name="colorPrimary">@color/light_green_500</item>
<item name="colorPrimaryDark">@color/light_green_700</item>
<item name="colorAccent">@color/purple_a400</item>
<item name="alertDialogTheme">@style/LightGreenDialog</item>
</style>
<style name="LightGreenDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/light_green_500</item>
<item name="colorPrimaryDark">@color/light_green_700</item>
<item name="colorAccent">@color/purple_a400</item>
</style>
<style name="LightGreenAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Lime" parent="LightOverride">
<style name="Lime">
<item name="colorPrimary">@color/lime_500</item>
<item name="colorPrimaryDark">@color/lime_700</item>
<item name="colorAccent">@color/cyan_a400</item>
<item name="alertDialogTheme">@style/LimeDialog</item>
</style>
<style name="LimeDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/lime_500</item>
<item name="colorPrimaryDark">@color/lime_700</item>
<item name="colorAccent">@color/cyan_a400</item>
</style>
<style name="LimeAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Orange" parent="LightOverride">
<style name="Orange">
<item name="colorPrimary">@color/orange_500</item>
<item name="colorPrimaryDark">@color/orange_700</item>
<item name="colorAccent">@color/deep_purple_a400</item>
<item name="alertDialogTheme">@style/OrangeDialog</item>
</style>
<style name="OrangeDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/orange_500</item>
<item name="colorPrimaryDark">@color/orange_700</item>
<item name="colorAccent">@color/deep_purple_a400</item>
</style>
<style name="OrangeAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Pink" parent="LightOverride">
<style name="Pink">
<item name="colorPrimary">@color/pink_500</item>
<item name="colorPrimaryDark">@color/pink_700</item>
<item name="colorAccent">@color/blue_a400</item>
<item name="alertDialogTheme">@style/PinkDialog</item>
</style>
<style name="PinkDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/pink_500</item>
<item name="colorPrimaryDark">@color/pink_700</item>
<item name="colorAccent">@color/blue_a400</item>
</style>
<style name="PinkAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Purple" parent="LightOverride">
<style name="Purple">
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryDark">@color/purple_700</item>
<item name="colorAccent">@color/light_blue_a400</item>
<item name="alertDialogTheme">@style/PurpleDialog</item>
</style>
<style name="PurpleDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryDark">@color/purple_700</item>
<item name="colorAccent">@color/light_blue_a400</item>
</style>
<style name="PurpleAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Red" parent="LightOverride">
<style name="Red">
<item name="colorPrimary">@color/red_500</item>
<item name="colorPrimaryDark">@color/red_700</item>
<item name="colorAccent">@color/blue_a400</item>
<item name="alertDialogTheme">@style/RedDialog</item>
</style>
<style name="RedDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/red_500</item>
<item name="colorPrimaryDark">@color/red_700</item>
<item name="colorAccent">@color/blue_a400</item>
</style>
<style name="RedAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Teal" parent="LightOverride">
<style name="Teal">
<item name="colorPrimary">@color/teal_500</item>
<item name="colorPrimaryDark">@color/teal_700</item>
<item name="colorAccent">@color/purple_a400</item>
<item name="alertDialogTheme">@style/TealDialog</item>
</style>
<style name="TealDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/teal_500</item>
<item name="colorPrimaryDark">@color/teal_700</item>
<item name="colorAccent">@color/purple_a400</item>
</style>
<style name="TealAccent">

@ -1,17 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Yellow" parent="LightOverride">
<style name="Yellow">
<item name="colorPrimary">@color/yellow_500</item>
<item name="colorPrimaryDark">@color/yellow_700</item>
<item name="colorAccent">@color/red_a400</item>
<item name="alertDialogTheme">@style/YellowDialog</item>
</style>
<style name="YellowDialog" parent="LightDialogBase">
<item name="colorPrimary">@color/yellow_500</item>
<item name="colorPrimaryDark">@color/yellow_700</item>
<item name="colorAccent">@color/red_a400</item>
</style>
<style name="YellowAccent">

@ -5,9 +5,13 @@
android:key="@string/p_theme"
android:title="@string/theme" />
<Preference
android:key="@string/p_theme_color"
android:title="@string/color" />
<Preference
android:key="@string/p_theme_accent"
android:title="Accent" />
android:title="@string/accent" />
<Preference
android:key="@string/EPr_appearance_header"

Loading…
Cancel
Save