Remove ThemeCache

pull/935/head
Alex Baker 5 years ago
parent 7631a19a87
commit ae3b3edd5a

@ -55,7 +55,6 @@ import org.tasks.preferences.DefaultFilterProvider;
import org.tasks.preferences.Preferences;
import org.tasks.receivers.RepeatConfirmationReceiver;
import org.tasks.themes.Theme;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
import org.tasks.ui.DeadlineControlSet;
import org.tasks.ui.EmptyTaskEditFragment;
@ -88,7 +87,6 @@ public class MainActivity extends InjectingAppCompatActivity
@Inject RepeatConfirmationReceiver repeatConfirmationReceiver;
@Inject DefaultFilterProvider defaultFilterProvider;
@Inject Theme theme;
@Inject ThemeCache themeCache;
@Inject TaskDao taskDao;
@Inject LocalBroadcastManager localBroadcastManager;
@Inject TaskCreator taskCreator;

@ -103,7 +103,6 @@ import org.tasks.tasklist.DragAndDropRecyclerAdapter;
import org.tasks.tasklist.PagedListRecyclerAdapter;
import org.tasks.tasklist.TaskListRecyclerAdapter;
import org.tasks.tasklist.ViewHolderFactory;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
import org.tasks.ui.TaskListViewModel;
import org.tasks.ui.Toaster;
@ -153,7 +152,6 @@ public final class TaskListFragment extends InjectingFragment
@Inject TaskDuplicator taskDuplicator;
@Inject TagDataDao tagDataDao;
@Inject CaldavDao caldavDao;
@Inject ThemeCache themeCache;
@Inject ThemeColor defaultThemeColor;
@BindView(R.id.swipe_layout)

@ -12,6 +12,7 @@ import io.reactivex.Completable;
import io.reactivex.schedulers.Schedulers;
import javax.inject.Inject;
import org.tasks.billing.BillingClient;
import org.tasks.billing.Inventory;
import org.tasks.files.FileHelper;
import org.tasks.injection.ApplicationComponent;
import org.tasks.injection.ForApplication;
@ -24,7 +25,7 @@ import org.tasks.receivers.RefreshReceiver;
import org.tasks.scheduling.CalendarNotificationIntentService;
import org.tasks.scheduling.NotificationSchedulerIntentService;
import org.tasks.scheduling.RefreshScheduler;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeBase;
import timber.log.Timber;
public class Tasks extends InjectingApplication {
@ -33,7 +34,7 @@ public class Tasks extends InjectingApplication {
@Inject Lazy<Upgrader> upgrader;
@Inject Preferences preferences;
@Inject BuildSetup buildSetup;
@Inject ThemeCache themeCache;
@Inject Inventory inventory;
@Inject WorkManager workManager;
@Inject RefreshScheduler refreshScheduler;
@Inject GeofenceApi geofenceApi;
@ -56,7 +57,7 @@ public class Tasks extends InjectingApplication {
preferences.setSyncOngoing(false);
themeCache.getThemeBase().setDefaultNightMode();
ThemeBase.getThemeBase(preferences, inventory, null).setDefaultNightMode();
localBroadcastManager.registerRefreshReceiver(new RefreshBroadcastReceiver());

@ -22,7 +22,6 @@ import org.tasks.dialogs.ColorWheelPicker.Companion.newColorWheel
import org.tasks.injection.DialogFragmentComponent
import org.tasks.injection.InjectingDialogFragment
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeCache
import org.tasks.themes.ThemeColor
import javax.inject.Inject
@ -70,7 +69,6 @@ class ColorPalettePicker : InjectingDialogFragment() {
@Inject lateinit var dialogBuilder: DialogBuilder
@Inject lateinit var inventory: Inventory
@Inject lateinit var themeCache: ThemeCache
@BindView(R.id.icons) lateinit var recyclerView: RecyclerView

@ -20,8 +20,7 @@ import org.tasks.injection.DialogFragmentComponent
import org.tasks.injection.InjectingDialogFragment
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeBase
import org.tasks.themes.ThemeCache
import org.tasks.themes.ThemeCache.EXTRA_THEME_OVERRIDE
import org.tasks.themes.ThemeBase.EXTRA_THEME_OVERRIDE
import javax.inject.Inject
class ThemePickerDialog : InjectingDialogFragment() {
@ -49,7 +48,6 @@ class ThemePickerDialog : InjectingDialogFragment() {
@Inject lateinit var inventory: Inventory
@Inject lateinit var dialogBuilder: DialogBuilder
@Inject lateinit var accent: ThemeAccent
@Inject lateinit var themeCache: ThemeCache
@Inject lateinit var themeBase: ThemeBase
var adapter: ArrayAdapter<String>? = null
@ -89,7 +87,7 @@ class ThemePickerDialog : InjectingDialogFragment() {
updateButton()
activity?.intent?.putExtra(EXTRA_THEME_OVERRIDE, which)
Handler().post {
themeCache.getThemeBase(which).setDefaultNightMode()
ThemeBase(which).setDefaultNightMode()
activity?.recreate()
activity?.overridePendingTransition(R.anim.fragment_fade_enter, R.anim.fragment_fade_exit);
}
@ -135,5 +133,5 @@ class ThemePickerDialog : InjectingDialogFragment() {
private fun available() = isAvailable(selected)
private fun isAvailable(index: Int) =
inventory.purchasedThemes() || themeCache.getThemeBase(index).isFree
inventory.purchasedThemes() || ThemeBase(index).isFree
}

@ -5,12 +5,12 @@ import android.content.Context;
import dagger.Module;
import dagger.Provides;
import org.tasks.R;
import org.tasks.billing.Inventory;
import org.tasks.location.Geocoder;
import org.tasks.location.MapboxGeocoder;
import org.tasks.preferences.Preferences;
import org.tasks.themes.ThemeAccent;
import org.tasks.themes.ThemeBase;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
@Module
@ -35,8 +35,8 @@ public class ActivityModule {
@Provides
@ActivityScope
public ThemeBase getThemeBase(ThemeCache themeCache) {
return themeCache.getThemeBase(activity.getIntent());
public ThemeBase getThemeBase(Preferences preferences, Inventory inventory) {
return ThemeBase.getThemeBase(preferences, inventory, activity.getIntent());
}
@Provides

@ -5,14 +5,12 @@ import androidx.appcompat.app.AppCompatActivity;
import javax.inject.Inject;
import org.tasks.locale.Locale;
import org.tasks.themes.Theme;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
public abstract class ThemedInjectingAppCompatActivity extends AppCompatActivity
implements InjectingActivity {
@Inject Theme theme;
@Inject ThemeCache themeCache;
@Inject protected ThemeColor themeColor;
private ActivityComponent activityComponent;

@ -38,6 +38,7 @@ import org.tasks.BuildConfig;
import org.tasks.R;
import org.tasks.billing.Purchase;
import org.tasks.data.TaskAttachment;
import org.tasks.themes.ThemeBase;
import org.tasks.time.DateTime;
import timber.log.Timber;
@ -535,6 +536,6 @@ public class Preferences {
}
public int getThemeBase() {
return getInt(R.string.p_theme, 5);
return getInt(R.string.p_theme, ThemeBase.DEFAULT_BASE_THEME);
}
}

@ -37,9 +37,10 @@ import org.tasks.preferences.DefaultFilterProvider
import org.tasks.preferences.Preferences
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeBase
import org.tasks.themes.ThemeCache
import org.tasks.themes.ThemeCache.EXTRA_THEME_OVERRIDE
import org.tasks.themes.ThemeBase.DEFAULT_BASE_THEME
import org.tasks.themes.ThemeBase.EXTRA_THEME_OVERRIDE
import org.tasks.themes.ThemeColor
import org.tasks.themes.ThemeColor.getLauncherColor
import org.tasks.time.DateTime
import org.tasks.ui.NavigationDrawerFragment.REQUEST_PURCHASE
import org.tasks.ui.SingleCheckedArrayAdapter
@ -65,7 +66,6 @@ private const val FRAG_TAG_COLOR_PICKER = "frag_tag_color_picker"
class LookAndFeel : InjectingPreferenceFragment(), Preference.OnPreferenceChangeListener {
@Inject lateinit var themeCache: ThemeCache
@Inject lateinit var themeBase: ThemeBase
@Inject lateinit var themeColor: ThemeColor
@Inject lateinit var themeAccent: ThemeAccent
@ -87,7 +87,8 @@ class LookAndFeel : InjectingPreferenceFragment(), Preference.OnPreferenceChange
}
val themePref = findPreference(R.string.p_theme)
themePref.summary = themeBase.name
val themeNames = resources.getStringArray(R.array.base_theme_names)
themePref.summary = themeNames[themeBase.index]
themePref.setOnPreferenceClickListener {
newThemePickerDialog(this, REQUEST_THEME_PICKER, themeBase.index)
.show(parentFragmentManager, FRAG_TAG_THEME_PICKER)
@ -162,7 +163,7 @@ class LookAndFeel : InjectingPreferenceFragment(), Preference.OnPreferenceChange
}
private fun updateLauncherPreference() {
val launcher = themeCache.getLauncherColor(preferences.getInt(R.string.p_theme_launcher, 7))
val launcher = getLauncherColor(context, preferences.getInt(R.string.p_theme_launcher, 7))
setupColorPreference(
R.string.p_theme_launcher,
launcher.pickerColor,
@ -253,7 +254,7 @@ class LookAndFeel : InjectingPreferenceFragment(), Preference.OnPreferenceChange
preferences.setInt(R.string.p_theme, index)
if (themeBase.index != index) {
Handler().post {
themeCache.getThemeBase(index).setDefaultNightMode()
ThemeBase(index).setDefaultNightMode()
recreate()
}
}
@ -262,17 +263,17 @@ class LookAndFeel : InjectingPreferenceFragment(), Preference.OnPreferenceChange
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == REQUEST_PURCHASE) {
val index = if (inventory.hasPro()) {
data?.getIntExtra(ThemePickerDialog.EXTRA_SELECTED, themeBase.index)
data?.getIntExtra(ThemePickerDialog.EXTRA_SELECTED, DEFAULT_BASE_THEME)
?: themeBase.index
} else {
preferences.themeBase
}
setBaseTheme(index)
} else if (requestCode == REQUEST_THEME_PICKER) {
val index = data?.getIntExtra(ThemePickerDialog.EXTRA_SELECTED, themeBase.index)
val index = data?.getIntExtra(ThemePickerDialog.EXTRA_SELECTED, DEFAULT_BASE_THEME)
?: preferences.themeBase
if (resultCode == RESULT_OK) {
if (inventory.purchasedThemes() || themeCache.getThemeBase(index).isFree) {
if (inventory.purchasedThemes() || ThemeBase(index).isFree) {
setBaseTheme(index)
} else {
startActivityForResult(

@ -20,7 +20,6 @@ import org.tasks.injection.ActivityComponent;
import org.tasks.injection.ThemedInjectingAppCompatActivity;
import org.tasks.tags.CheckBoxTriStates.State;
import org.tasks.themes.Theme;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
public class TagPickerActivity extends ThemedInjectingAppCompatActivity {
@ -39,7 +38,6 @@ public class TagPickerActivity extends ThemedInjectingAppCompatActivity {
EditText editText;
@Inject Theme theme;
@Inject ThemeCache themeCache;
@Inject Inventory inventory;
private TagPickerViewModel viewModel;
@ -70,7 +68,7 @@ public class TagPickerActivity extends ThemedInjectingAppCompatActivity {
themeColor.apply(toolbar);
TagRecyclerAdapter recyclerAdapter =
new TagRecyclerAdapter(this, viewModel, themeCache, inventory, this::onToggle);
new TagRecyclerAdapter(this, viewModel, inventory, this::onToggle);
recyclerView.setAdapter(recyclerAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this));

@ -8,6 +8,7 @@ import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.AsyncListDiffer;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
@ -17,27 +18,22 @@ import org.tasks.billing.Inventory;
import org.tasks.data.TagData;
import org.tasks.tags.CheckBoxTriStates.State;
import org.tasks.themes.CustomIcons;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
public class TagRecyclerAdapter extends RecyclerView.Adapter<TagPickerViewHolder> {
private final AsyncListDiffer<TagData> differ;
private final Context context;
private final TagPickerViewModel viewModel;
private final ThemeCache themeCache;
private final Inventory inventory;
private final Function2<TagData, Boolean, State> callback;
TagRecyclerAdapter(
Context context,
TagPickerViewModel viewModel,
ThemeCache themeCache,
Inventory inventory,
Function2<TagData, Boolean, State> callback) {
this.context = context;
this.viewModel = viewModel;
this.themeCache = themeCache;
this.inventory = inventory;
this.callback = callback;
differ = new AsyncListDiffer<>(this, new TagDiffCallback());
@ -62,11 +58,9 @@ public class TagRecyclerAdapter extends RecyclerView.Adapter<TagPickerViewHolder
}
private int getColor(TagData tagData) {
ThemeColor themeColor =
tagData.getColor() == 0
? themeCache.getUntaggedColor()
: newThemeColor(context, tagData.getColor());
return themeColor.getPrimaryColor();
return tagData.getColor() == 0
? ContextCompat.getColor(context, R.color.icon_tint_with_alpha)
: newThemeColor(context, tagData.getColor()).getPrimaryColor();
}
private @Nullable Integer getIcon(TagData tagData) {

@ -2,20 +2,21 @@ package org.tasks.themes;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.ContextThemeWrapper;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import org.tasks.R;
import org.tasks.dialogs.ColorPalettePicker.Pickable;
import org.tasks.billing.Inventory;
import org.tasks.preferences.Preferences;
public class ThemeBase implements Pickable {
public class ThemeBase implements Parcelable {
private static final int[] THEMES =
new int[] {
R.style.Tasks, R.style.ThemeBlack, R.style.Tasks, R.style.Wallpaper, R.style.Tasks, R.style.Tasks
};
public static final String EXTRA_THEME_OVERRIDE = "extra_theme_override";
public static final int DEFAULT_BASE_THEME = 5;
public static final Parcelable.Creator<ThemeBase> CREATOR =
new Parcelable.Creator<ThemeBase>() {
@Override
@ -28,43 +29,49 @@ public class ThemeBase implements Pickable {
return new ThemeBase[size];
}
};
private final String name;
private static final int[] NIGHT_MODE =
new int[] {
AppCompatDelegate.MODE_NIGHT_NO,
AppCompatDelegate.MODE_NIGHT_YES,
AppCompatDelegate.MODE_NIGHT_YES,
AppCompatDelegate.MODE_NIGHT_YES,
AppCompatDelegate.MODE_NIGHT_AUTO_TIME,
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
};
private static final int[] THEMES =
new int[] {
R.style.Tasks,
R.style.ThemeBlack,
R.style.Tasks,
R.style.Wallpaper,
R.style.Tasks,
R.style.Tasks
};
private final int index;
private final int style;
private final int contentBackground;
private final int dayNightMode;
public ThemeBase(String name, int index, int contentBackground, int dayNightMode) {
this.name = name;
public static ThemeBase getThemeBase(
Preferences preferences, Inventory inventory, @Nullable Intent intent) {
if (intent != null && intent.hasExtra(EXTRA_THEME_OVERRIDE)) {
return new ThemeBase(intent.getIntExtra(EXTRA_THEME_OVERRIDE, ThemeBase.DEFAULT_BASE_THEME));
}
ThemeBase themeBase = new ThemeBase(preferences.getThemeBase());
return themeBase.isFree() || inventory.purchasedThemes()
? themeBase
: new ThemeBase(ThemeBase.DEFAULT_BASE_THEME);
}
public ThemeBase(int index) {
this.index = index;
this.dayNightMode = dayNightMode;
this.style = THEMES[index];
this.contentBackground = contentBackground;
}
private ThemeBase(Parcel source) {
name = source.readString();
index = source.readInt();
style = source.readInt();
contentBackground = source.readInt();
dayNightMode = source.readInt();
}
public String getName() {
return name;
}
@Override
public int getPickerColor() {
return contentBackground;
}
@Override
public boolean isFree() {
return index < 3 || index == 5;
}
@Override
public int getIndex() {
return index;
}
@ -78,15 +85,15 @@ public class ThemeBase implements Pickable {
}
public ContextThemeWrapper wrap(Context context) {
return new ContextThemeWrapper(context, style);
return new ContextThemeWrapper(context, THEMES[index]);
}
public void set(Activity activity) {
activity.setTheme(style);
activity.setTheme(THEMES[index]);
}
public void setDefaultNightMode() {
AppCompatDelegate.setDefaultNightMode(dayNightMode);
AppCompatDelegate.setDefaultNightMode(NIGHT_MODE[index]);
}
@Override
@ -96,10 +103,6 @@ public class ThemeBase implements Pickable {
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name);
dest.writeInt(index);
dest.writeInt(style);
dest.writeInt(contentBackground);
dest.writeInt(dayNightMode);
}
}

@ -1,102 +0,0 @@
package org.tasks.themes;
import static androidx.core.content.ContextCompat.getColor;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.tasks.R;
import org.tasks.billing.Inventory;
import org.tasks.injection.ApplicationScope;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.Preferences;
@ApplicationScope
public class ThemeCache {
public static final String EXTRA_THEME_OVERRIDE = "extra_theme_override";
private final List<ThemeBase> themes = new ArrayList<>();
private final ThemeColor untaggedColor;
private final Preferences preferences;
private final Inventory inventory;
private final Context context;
@Inject
public ThemeCache(Preferences preferences, Inventory inventory, @ForApplication Context context) {
this.preferences = preferences;
this.inventory = inventory;
this.context = context;
Resources resources = context.getResources();
themes.add(
new ThemeBase(
context.getString(R.string.theme_light),
0,
getColor(context, android.R.color.white),
AppCompatDelegate.MODE_NIGHT_NO));
themes.add(
new ThemeBase(
context.getString(R.string.theme_black),
1,
getColor(context, R.color.widget_background_black),
AppCompatDelegate.MODE_NIGHT_YES));
themes.add(
new ThemeBase(
context.getString(R.string.theme_dark),
2,
getColor(context, R.color.md_background_dark),
AppCompatDelegate.MODE_NIGHT_YES));
themes.add(
new ThemeBase(
context.getString(R.string.theme_wallpaper),
3,
getColor(context, R.color.black_38),
AppCompatDelegate.MODE_NIGHT_YES));
themes.add(
new ThemeBase(
context.getString(R.string.theme_day_night),
4,
getColor(context, android.R.color.white),
AppCompatDelegate.MODE_NIGHT_AUTO));
themes.add(
new ThemeBase(
context.getString(R.string.theme_system_default),
5,
getColor(context, android.R.color.white),
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM));
untaggedColor =
new ThemeColor(context, getColor(context, R.color.tag_color_none_background));
}
public ThemeBase getThemeBase() {
return getThemeBase(null);
}
public ThemeBase getThemeBase(@Nullable Intent intent) {
if (intent != null && intent.hasExtra(EXTRA_THEME_OVERRIDE)) {
return getThemeBase(intent.getIntExtra(EXTRA_THEME_OVERRIDE, 5));
}
ThemeBase themeBase = getThemeBase(preferences.getThemeBase());
return themeBase.isFree() || inventory.purchasedThemes() ? themeBase : getThemeBase(5);
}
public ThemeBase getThemeBase(int index) {
return themes.get(index);
}
public ThemeColor getLauncherColor(int index) {
return new ThemeColor(
context, index, ContextCompat.getColor(context, ThemeColor.LAUNCHER_COLORS[index]), false);
}
public ThemeColor getUntaggedColor() {
return untaggedColor;
}
}

@ -179,6 +179,11 @@ public class ThemeColor implements Pickable {
private final int colorPrimaryVariant;
private final boolean isDark;
public static ThemeColor getLauncherColor(Context context, int index) {
return new ThemeColor(
context, index, ContextCompat.getColor(context, LAUNCHER_COLORS[index]), false);
}
public ThemeColor(Context context, int color) {
this(context, -1, color == 0 ? ContextCompat.getColor(context, R.color.blue_500) : color, true);
}

@ -14,6 +14,7 @@ import android.content.res.ColorStateList;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import com.google.android.material.chip.Chip;
import com.google.common.base.Predicates;
@ -41,7 +42,6 @@ import org.tasks.data.TagDataDao;
import org.tasks.data.TaskContainer;
import org.tasks.injection.ApplicationScope;
import org.tasks.injection.ForApplication;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
@ApplicationScope
@ -52,7 +52,6 @@ public class ChipProvider {
private final Map<String, TagFilter> tagDatas = new HashMap<>();
private final Context context;
private final Inventory inventory;
private final ThemeCache themeCache;
private final int iconAlpha;
private final LocalBroadcastManager localBroadcastManager;
private final Ordering<TagFilter> orderByName =
@ -62,20 +61,20 @@ public class ChipProvider {
return left.listingTitle.compareTo(right.listingTitle);
}
};
private final ThemeColor untagged;
@Inject
public ChipProvider(
@ForApplication Context context,
Inventory inventory,
ThemeCache themeCache,
GoogleTaskListDao googleTaskListDao,
CaldavDao caldavDao,
TagDataDao tagDataDao,
LocalBroadcastManager localBroadcastManager) {
this.context = context;
this.inventory = inventory;
this.themeCache = themeCache;
this.localBroadcastManager = localBroadcastManager;
untagged = getUntaggedThemeColor(context);
iconAlpha =
(int) (255 * ResourcesCompat.getFloat(context.getResources(), R.dimen.alpha_secondary));
@ -218,6 +217,11 @@ public class ChipProvider {
return color;
}
}
return themeCache.getUntaggedColor();
return untagged;
}
private static ThemeColor getUntaggedThemeColor(Context context) {
return new ThemeColor(
context, -1, ContextCompat.getColor(context, R.color.tag_color_none_background), false);
}
}

@ -1,5 +1,7 @@
package org.tasks.widget;
import static org.tasks.themes.ThemeColor.getLauncherColor;
import android.app.Activity;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
@ -27,7 +29,6 @@ import org.tasks.injection.ThemedInjectingAppCompatActivity;
import org.tasks.intents.TaskIntents;
import org.tasks.preferences.DefaultFilterProvider;
import org.tasks.themes.DrawableUtil;
import org.tasks.themes.ThemeCache;
import org.tasks.themes.ThemeColor;
public class ShortcutConfigActivity extends ThemedInjectingAppCompatActivity
@ -39,8 +40,6 @@ public class ShortcutConfigActivity extends ThemedInjectingAppCompatActivity
private static final int REQUEST_FILTER = 1019;
@Inject DefaultFilterProvider defaultFilterProvider;
@Inject ThemeColor themeColor;
@Inject ThemeCache themeCache;
@BindView(R.id.toolbar)
Toolbar toolbar;
@ -143,7 +142,7 @@ public class ShortcutConfigActivity extends ThemedInjectingAppCompatActivity
private void updateTheme() {
clear.setVisibility(View.GONE);
ThemeColor color = themeCache.getLauncherColor(getThemeIndex());
ThemeColor color = getLauncherColor(this, getThemeIndex());
DrawableUtil.setLeftDrawable(this, colorIcon, R.drawable.color_picker);
DrawableUtil.setTint(DrawableUtil.getLeftDrawable(colorIcon), color.getPrimaryColor());
color.apply(toolbar);

@ -10,6 +10,7 @@
<color name="text_secondary">@color/white_60</color>
<color name="text_tertiary">@color/white_38</color>
<color name="overdue">@color/error_color_material_dark</color>
<color name="tag_color_none_background">@color/grey_300</color>
<color name="priority_1">@color/red_200</color>
<color name="priority_2">@color/amber_200</color>

@ -74,6 +74,8 @@
<color name="brown_500">#795548</color>
<color name="grey_100">#f5f5f5</color>
<color name="grey_300">#e0e0e0</color>
<color name="grey_500">#9e9e9e</color>
<color name="grey_800">#424242</color>
<color name="grey_900">#212121</color>
@ -119,7 +121,7 @@
<color name="snackbar_text_color">@color/white_87</color>
<color name="snackbar_action_color">#f4b400</color>
<color name="snackbar_background">@color/grey_800</color>
<color name="tag_color_none_background">#e1e1e1</color>
<color name="tag_color_none_background">@color/grey_300</color>
<!-- deprecated -->
<color name="reminder_background">#262626</color>

Loading…
Cancel
Save