aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt71
1 files changed, 61 insertions, 10 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
index cb265149..5cbb051d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
@@ -10,20 +10,71 @@ import com.pitchedapps.frost.injectors.JsActions
/**
* Created by Allan Wang on 2017-06-14.
*/
-enum class Theme(@StringRes val textRes: Int, val injector: InjectorContract,
- private val textColorGetter: () -> Int, private val backgroundColorGetter: () -> Int,
- private val headerColorGetter: () -> Int, private val iconColorGetter: () -> Int) {
- DEFAULT(R.string.kau_default, JsActions.EMPTY, { 0xde000000.toInt() }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
- LIGHT(R.string.kau_light, CssAssets.MATERIAL_LIGHT, { 0xde000000.toInt() }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
- DARK(R.string.kau_dark, CssAssets.MATERIAL_DARK, { Color.WHITE }, { 0xff303030.toInt() }, { 0xff2e4b86.toInt() }, { Color.WHITE }),
- AMOLED(R.string.kau_amoled, CssAssets.MATERIAL_AMOLED, { Color.WHITE }, { Color.BLACK }, { Color.BLACK }, { Color.WHITE }),
- GLASS(R.string.kau_glass, CssAssets.MATERIAL_GLASS, { Color.WHITE }, { 0x80000000.toInt() }, { 0xb3000000.toInt() }, { Color.WHITE }),
- CUSTOM(R.string.kau_custom, CssAssets.CUSTOM, { Prefs.customTextColor }, { Prefs.customBackgroundColor }, { Prefs.customHeaderColor }, { Prefs.customIconColor })
- ;
+const val FACEBOOK_BLUE = 0xff3b5998.toInt()
+const val BLUE_LIGHT = 0xff5d86dd.toInt()
+
+enum class Theme(@StringRes val textRes: Int,
+ val injector: InjectorContract,
+ private val textColorGetter: () -> Int,
+ private val accentColorGetter: () -> Int,
+ private val backgroundColorGetter: () -> Int,
+ private val headerColorGetter: () -> Int,
+ private val iconColorGetter: () -> Int) {
+
+ DEFAULT(R.string.kau_default,
+ JsActions.EMPTY,
+ { 0xde000000.toInt() },
+ { FACEBOOK_BLUE },
+ { 0xfffafafa.toInt() },
+ { FACEBOOK_BLUE },
+ { Color.WHITE }),
+
+ LIGHT(R.string.kau_light,
+ CssAssets.MATERIAL_LIGHT,
+ { 0xde000000.toInt() },
+ { FACEBOOK_BLUE },
+ { 0xfffafafa.toInt() },
+ { FACEBOOK_BLUE },
+ { Color.WHITE }),
+
+ DARK(R.string.kau_dark,
+ CssAssets.MATERIAL_DARK,
+ { Color.WHITE },
+ { BLUE_LIGHT },
+ { 0xff303030.toInt() },
+ { 0xff2e4b86.toInt() },
+ { Color.WHITE }),
+
+ AMOLED(R.string.kau_amoled,
+ CssAssets.MATERIAL_AMOLED,
+ { Color.WHITE },
+ { BLUE_LIGHT },
+ { Color.BLACK },
+ { Color.BLACK },
+ { Color.WHITE }),
+
+ GLASS(R.string.kau_glass,
+ CssAssets.MATERIAL_GLASS,
+ { Color.WHITE },
+ { BLUE_LIGHT },
+ { 0x80000000.toInt() },
+ { 0xb3000000.toInt() },
+ { Color.WHITE }),
+
+ CUSTOM(R.string.kau_custom,
+ CssAssets.CUSTOM,
+ { Prefs.customTextColor },
+ { Prefs.customAccentColor },
+ { Prefs.customBackgroundColor },
+ { Prefs.customHeaderColor },
+ { Prefs.customIconColor });
val textColor: Int
get() = textColorGetter()
+ val accentColor: Int
+ get() = accentColorGetter()
+
val bgColor: Int
get() = backgroundColorGetter()