diff --git a/app/src/main/java/io/legato/kazusa/lib/theme/MaterialValueHelper.kt b/app/src/main/java/io/legato/kazusa/lib/theme/MaterialValueHelper.kt index aa08d3a4b..941829c2b 100644 --- a/app/src/main/java/io/legato/kazusa/lib/theme/MaterialValueHelper.kt +++ b/app/src/main/java/io/legato/kazusa/lib/theme/MaterialValueHelper.kt @@ -8,10 +8,4 @@ import android.content.Context * @author Karim Abou Zeid (kabouzeid) */ val Context.primaryColor: Int - get() = ThemeStore.primaryColor(this) - -val Context.secondaryColor: Int - get() = ThemeStore.secondaryColor(this) - -val Context.primaryContainerColor: Int - get() = ThemeStore.primaryContainerColor(this) \ No newline at end of file + get() = ThemeStore.primaryColor(this) \ No newline at end of file diff --git a/app/src/main/java/io/legato/kazusa/lib/theme/ThemeStore.kt b/app/src/main/java/io/legato/kazusa/lib/theme/ThemeStore.kt index ce8be8204..5d6908126 100644 --- a/app/src/main/java/io/legato/kazusa/lib/theme/ThemeStore.kt +++ b/app/src/main/java/io/legato/kazusa/lib/theme/ThemeStore.kt @@ -39,17 +39,17 @@ private constructor(private val mContext: Context) : ThemeStoreInterface { val fallback = color - val secondary = MaterialColors.getColor( - wrapped, - com.google.android.material.R.attr.colorSecondary, - fallback - ) - - val primaryContainer = MaterialColors.getColor( - wrapped, - com.google.android.material.R.attr.colorSecondaryContainer, - fallback - ) +// val secondary = MaterialColors.getColor( +// wrapped, +// com.google.android.material.R.attr.colorSecondary, +// fallback +// ) +// +// val primaryContainer = MaterialColors.getColor( +// wrapped, +// com.google.android.material.R.attr.colorPrimaryContainer, +// fallback +// ) val primary = MaterialColors.getColor( wrapped, @@ -57,8 +57,8 @@ private constructor(private val mContext: Context) : ThemeStoreInterface { fallback ) - mEditor.putInt(ThemeStorePrefKeys.KEY_SECONDARY_COLOR, secondary) - mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_CONTAINER_COLOR, primaryContainer) + //mEditor.putInt(ThemeStorePrefKeys.KEY_SECONDARY_COLOR, secondary) + //mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_CONTAINER_COLOR, primaryContainer) mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, primary) return this @@ -67,7 +67,8 @@ private constructor(private val mContext: Context) : ThemeStoreInterface { override fun primaryColor(@ColorInt color: Int): ThemeStore { if (autoGeneratePrimaryDark(mContext)) primaryColorDark(ColorUtils.darkenColor(color)) - addColorScheme(color) + mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, color) + //addColorScheme(color) return this } @@ -155,27 +156,27 @@ private constructor(private val mContext: Context) : ThemeStoreInterface { } } - fun primaryContainerColor(context: Context = appCtx): Int { - return if (isCustomThemeEnabled(context)) { - prefs(context).getInt( - ThemeStorePrefKeys.KEY_PRIMARY_CONTAINER_COLOR, - "#FFFFFF".toColorInt() - ) - } else { - ThemeUtils.resolveColor(context, com.google.android.material.R.attr.colorPrimaryContainer) - } - } - - fun secondaryColor(context: Context = appCtx): Int { - return if (isCustomThemeEnabled(context)) { - prefs(context).getInt( - ThemeStorePrefKeys.KEY_SECONDARY_COLOR, - primaryColor(context) - ) - } else { - primaryColor(context) - } - } +// fun primaryContainerColor(context: Context = appCtx): Int { +// return if (isCustomThemeEnabled(context)) { +// prefs(context).getInt( +// ThemeStorePrefKeys.KEY_PRIMARY_CONTAINER_COLOR, +// "#FFFFFF".toColorInt() +// ) +// } else { +// ThemeUtils.resolveColor(context, com.google.android.material.R.attr.colorPrimaryContainer) +// } +// } +// +// fun secondaryColor(context: Context = appCtx): Int { +// return if (isCustomThemeEnabled(context)) { +// prefs(context).getInt( +// ThemeStorePrefKeys.KEY_SECONDARY_COLOR, +// primaryColor(context) +// ) +// } else { +// primaryColor(context) +// } +// } @CheckResult @ColorInt diff --git a/app/src/main/res/color/chip_background_selector.xml b/app/src/main/res/color/chip_background_selector.xml index c3ad46f6c..2e2cdce92 100644 --- a/app/src/main/res/color/chip_background_selector.xml +++ b/app/src/main/res/color/chip_background_selector.xml @@ -1,5 +1,5 @@ - + diff --git a/app/src/main/res/color/chip_stroke_selector.xml b/app/src/main/res/color/chip_stroke_selector.xml index 73f16062d..4c135b77a 100644 --- a/app/src/main/res/color/chip_stroke_selector.xml +++ b/app/src/main/res/color/chip_stroke_selector.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file