优化代码

pull/32/head
Invinciblelee 6 years ago
parent 8b1a462aff
commit 315f7142f7
  1. 6
      app/build.gradle
  2. 4
      app/src/main/AndroidManifest.xml
  3. 84
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  4. 10
      app/src/main/java/io/legado/app/lib/theme/ATH.kt
  5. 4
      app/src/main/java/io/legado/app/lib/theme/ATHUtils.kt
  6. 2
      app/src/main/java/io/legado/app/lib/theme/ColorUtils.kt
  7. 25
      app/src/main/java/io/legado/app/lib/theme/DrawableUtil.kt
  8. 43
      app/src/main/java/io/legado/app/lib/theme/DrawableUtils.kt
  9. 97
      app/src/main/java/io/legado/app/lib/theme/MaterialValueHelper.kt
  10. 2
      app/src/main/java/io/legado/app/lib/theme/NavigationViewUtils.kt
  11. 38
      app/src/main/java/io/legado/app/lib/theme/ThemeStore.kt
  12. 34
      app/src/main/java/io/legado/app/lib/theme/ThemeStorePrefKeys.kt
  13. 22
      app/src/main/java/io/legado/app/lib/theme/TintHelper.kt
  14. 6
      app/src/main/java/io/legado/app/lib/theme/ViewUtils.kt
  15. 4
      app/src/main/java/io/legado/app/lib/theme/view/ATEAccentBgTextView.kt
  16. 3
      app/src/main/java/io/legado/app/lib/theme/view/ATEStockSwitch.kt
  17. 3
      app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt
  18. 2
      app/src/main/res/values-v21/styles.xml
  19. 64
      app/src/main/res/values/styles.xml

@ -42,13 +42,11 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.core:core-ktx:1.0.2' implementation 'androidx.core:core-ktx:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'

@ -23,7 +23,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/CAppTheme" android:theme="@style/AppTheme.Light"
tools:ignore="AllowBackup,GoogleAppIndexingWarning"> tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity android:name=".ui.search.SearchActivity"> <activity android:name=".ui.search.SearchActivity">
</activity> </activity>
@ -32,7 +32,7 @@
<activity <activity
android:name=".ui.main.MainActivity" android:name=".ui.main.MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/CAppTheme.NoActionBar"> android:theme="@style/AppTheme.Light.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

@ -1,17 +1,17 @@
package io.legado.app.base package io.legado.app.base
import android.annotation.SuppressLint
import android.graphics.PorterDuff
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.menu.MenuItemImpl
import androidx.core.content.ContextCompat
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import io.legado.app.R import io.legado.app.R
import io.legado.app.lib.theme.ColorUtil import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.MaterialValueHelper import io.legado.app.lib.theme.DrawableUtils
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import java.util.* import io.legado.app.lib.theme.getPrimaryTextColor
abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() { abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
@ -34,47 +34,45 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
* 设置MENU图标颜色 * 设置MENU图标颜色
*/ */
override fun onCreateOptionsMenu(menu: Menu): Boolean { override fun onCreateOptionsMenu(menu: Menu): Boolean {
val primaryTextColor = MaterialValueHelper val primaryTextColor = getPrimaryTextColor(ColorUtils.isColorLight(ThemeStore.primaryColor(this)))
.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.primaryColor(this))) val defaultTextColor = ContextCompat.getColor(this, R.color.tv_text_default)
for (i in 0 until menu.size()) { for (i in 0 until menu.size()) {
val drawable = menu.getItem(i).icon (menu.getItem(i) as MenuItemImpl).let {//overflow:展开的item
if (drawable != null) { DrawableUtils.setTint(it.icon, if (it.requiresOverflow()) defaultTextColor else primaryTextColor)
drawable.mutate()
drawable.setColorFilter(primaryTextColor, PorterDuff.Mode.SRC_ATOP)
} }
} }
return super.onCreateOptionsMenu(menu) return super.onCreateOptionsMenu(menu)
} }
@SuppressLint("PrivateApi") // @SuppressLint("PrivateApi")
override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean { // override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean {
if (menu != null) { // if (menu != null) {
//展开菜单显示图标 // //展开菜单显示图标
if (menu.javaClass.simpleName.equals("MenuBuilder", ignoreCase = true)) { // if (menu.javaClass.simpleName.equals("MenuBuilder", ignoreCase = true)) {
try { // try {
var method = menu.javaClass.getDeclaredMethod("setOptionalIconsVisible", java.lang.Boolean.TYPE) // var method = menu.javaClass.getDeclaredMethod("setOptionalIconsVisible", java.lang.Boolean.TYPE)
method.isAccessible = true // method.isAccessible = true
method.invoke(menu, true) // method.invoke(menu, true)
method = menu.javaClass.getDeclaredMethod("getNonActionItems") // method = menu.javaClass.getDeclaredMethod("getNonActionItems")
val menuItems = method.invoke(menu) as ArrayList<MenuItem> // val menuItems = method.invoke(menu) as ArrayList<MenuItem>
if (menuItems.isNotEmpty()) { // if (menuItems.isNotEmpty()) {
for (menuItem in menuItems) { // for (menuItem in menuItems) {
val drawable = menuItem.icon // val drawable = menuItem.icon
if (drawable != null) { // if (drawable != null) {
drawable.mutate() // drawable.mutate()
drawable.setColorFilter( // drawable.setColorFilter(
resources.getColor(R.color.tv_text_default), // resources.getColor(R.color.tv_text_default),
PorterDuff.Mode.SRC_ATOP // PorterDuff.Mode.SRC_ATOP
) // )
} // }
} // }
} // }
} catch (ignored: Exception) { // } catch (ignored: Exception) {
} // }
} // }
} // }
return super.onMenuOpened(featureId, menu) // return super.onMenuOpened(featureId, menu)
} // }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem?): Boolean {
item?.let { item?.let {
@ -91,10 +89,10 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
} }
protected fun initTheme() { protected fun initTheme() {
if (ColorUtil.isColorLight(ThemeStore.primaryColor(this))) { if (ColorUtils.isColorLight(ThemeStore.primaryColor(this))) {
setTheme(R.style.CAppTheme) setTheme(R.style.AppTheme_Light)
} else { } else {
setTheme(R.style.CAppThemeBarDark) setTheme(R.style.AppTheme_Dark)
} }
} }
} }

@ -18,7 +18,7 @@ object ATH {
@SuppressLint("CommitPrefEdits") @SuppressLint("CommitPrefEdits")
fun didThemeValuesChange(context: Context, since: Long): Boolean { fun didThemeValuesChange(context: Context, since: Long): Boolean {
return ThemeStore.isConfigured(context) && ThemeStore.prefs(context).getLong( return ThemeStore.isConfigured(context) && ThemeStore.prefs(context).getLong(
ThemeStore.VALUES_CHANGED, ThemeStorePrefKeys.VALUES_CHANGED,
-1 -1
) > since ) > since
} }
@ -35,7 +35,7 @@ object ATH {
} }
fun setLightStatusbarAuto(activity: Activity, bgColor: Int) { fun setLightStatusbarAuto(activity: Activity, bgColor: Int) {
setLightStatusbar(activity, ColorUtil.isColorLight(bgColor)) setLightStatusbar(activity, ColorUtils.isColorLight(bgColor))
} }
fun setLightStatusbar(activity: Activity, enabled: Boolean) { fun setLightStatusbar(activity: Activity, enabled: Boolean) {
@ -64,7 +64,7 @@ object ATH {
} }
fun setLightNavigationbarAuto(activity: Activity, bgColor: Int) { fun setLightNavigationbarAuto(activity: Activity, bgColor: Int) {
setLightNavigationbar(activity, ColorUtil.isColorLight(bgColor)) setLightNavigationbar(activity, ColorUtils.isColorLight(bgColor))
} }
fun setNavigationbarColorAuto(activity: Activity) { fun setNavigationbarColorAuto(activity: Activity) {
@ -86,7 +86,7 @@ object ATH {
val color1: Int val color1: Int
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Task description requires fully opaque color // Task description requires fully opaque color
color1 = ColorUtil.stripAlpha(color) color1 = ColorUtils.stripAlpha(color)
// Sets color of entry in the system recents page // Sets color of entry in the system recents page
activity.setTaskDescription(ActivityManager.TaskDescription(activity.title as String, null, color1)) activity.setTaskDescription(ActivityManager.TaskDescription(activity.title as String, null, color1))
} }
@ -103,7 +103,7 @@ object ATH {
fun setAlertDialogTint(dialog: AlertDialog): AlertDialog { fun setAlertDialogTint(dialog: AlertDialog): AlertDialog {
val colorStateList = Selector.colorBuild() val colorStateList = Selector.colorBuild()
.setDefaultColor(ThemeStore.accentColor(dialog.context)) .setDefaultColor(ThemeStore.accentColor(dialog.context))
.setPressedColor(ColorUtil.darkenColor(ThemeStore.accentColor(dialog.context))) .setPressedColor(ColorUtils.darkenColor(ThemeStore.accentColor(dialog.context)))
.create() .create()
if (dialog.getButton(AlertDialog.BUTTON_NEGATIVE) != null) { if (dialog.getButton(AlertDialog.BUTTON_NEGATIVE) != null) {
dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(colorStateList) dialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(colorStateList)

@ -6,10 +6,10 @@ import androidx.annotation.AttrRes
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
object ATHUtil { object ATHUtils {
fun isWindowBackgroundDark(context: Context): Boolean { fun isWindowBackgroundDark(context: Context): Boolean {
return !ColorUtil.isColorLight(ATHUtil.resolveColor(context, android.R.attr.windowBackground)) return !ColorUtils.isColorLight(resolveColor(context, android.R.attr.windowBackground))
} }
@JvmOverloads @JvmOverloads

@ -4,7 +4,7 @@ import android.graphics.Color
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.annotation.FloatRange import androidx.annotation.FloatRange
object ColorUtil { object ColorUtils {
fun intToString(intColor: Int): String { fun intToString(intColor: Int): String {
return String.format("#%06X", 0xFFFFFF and intColor) return String.format("#%06X", 0xFFFFFF and intColor)

@ -1,25 +0,0 @@
package io.legado.app.lib.theme
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.TransitionDrawable
import androidx.annotation.ColorInt
/**
* @author Karim Abou Zeid (kabouzeid)
*/
object DrawableUtil {
fun createTransitionDrawable(@ColorInt startColor: Int, @ColorInt endColor: Int): TransitionDrawable {
return createTransitionDrawable(ColorDrawable(startColor), ColorDrawable(endColor))
}
fun createTransitionDrawable(start: Drawable, end: Drawable): TransitionDrawable {
val drawables = arrayOfNulls<Drawable>(2)
drawables[0] = start
drawables[1] = end
return TransitionDrawable(drawables)
}
}

@ -0,0 +1,43 @@
package io.legado.app.lib.theme
import android.content.res.ColorStateList
import android.graphics.PorterDuff
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.TransitionDrawable
import androidx.annotation.ColorInt
import androidx.core.graphics.drawable.DrawableCompat
/**
* @author Karim Abou Zeid (kabouzeid)
*/
object DrawableUtils {
fun createTransitionDrawable(@ColorInt startColor: Int, @ColorInt endColor: Int): TransitionDrawable {
return createTransitionDrawable(ColorDrawable(startColor), ColorDrawable(endColor))
}
fun createTransitionDrawable(start: Drawable, end: Drawable): TransitionDrawable {
val drawables = arrayOfNulls<Drawable>(2)
drawables[0] = start
drawables[1] = end
return TransitionDrawable(drawables)
}
fun setTintList(drawable: Drawable, tint: ColorStateList, tintMode: PorterDuff.Mode = PorterDuff.Mode.SRC_ATOP) {
val wrappedDrawable = DrawableCompat.wrap(drawable)
wrappedDrawable.mutate()
DrawableCompat.setTintMode(wrappedDrawable, tintMode)
DrawableCompat.setTintList(wrappedDrawable, tint)
}
fun setTint(drawable: Drawable, @ColorInt tint: Int, tintMode: PorterDuff.Mode = PorterDuff.Mode.SRC_ATOP) {
val wrappedDrawable = DrawableCompat.wrap(drawable)
wrappedDrawable.mutate()
DrawableCompat.setTintMode(wrappedDrawable, tintMode)
DrawableCompat.setTint(wrappedDrawable, tint)
}
}

@ -4,42 +4,73 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import io.legado.app.R import io.legado.app.R
/** /**
* @author Karim Abou Zeid (kabouzeid) * @author Karim Abou Zeid (kabouzeid)
*/ */
object MaterialValueHelper { @SuppressLint("PrivateResource")
@ColorInt
@SuppressLint("PrivateResource") fun Context.getPrimaryTextColor(dark: Boolean): Int {
@ColorInt return if (dark) {
fun getPrimaryTextColor(context: Context, dark: Boolean): Int { ContextCompat.getColor(this, R.color.primary_text_default_material_light)
return if (dark) { } else ContextCompat.getColor(this, R.color.primary_text_default_material_dark)
ContextCompat.getColor(context, R.color.primary_text_default_material_light) }
} else ContextCompat.getColor(context, R.color.primary_text_default_material_dark)
} @SuppressLint("PrivateResource")
@ColorInt
@SuppressLint("PrivateResource") fun Context.getSecondaryTextColor(dark: Boolean): Int {
@ColorInt return if (dark) {
fun getSecondaryTextColor(context: Context, dark: Boolean): Int { ContextCompat.getColor(this, R.color.secondary_text_default_material_light)
return if (dark) { } else ContextCompat.getColor(this, R.color.secondary_text_default_material_dark)
ContextCompat.getColor(context, R.color.secondary_text_default_material_light) }
} else ContextCompat.getColor(context, R.color.secondary_text_default_material_dark)
} @SuppressLint("PrivateResource")
@ColorInt
@SuppressLint("PrivateResource") fun Context.getPrimaryDisabledTextColor(dark: Boolean): Int {
@ColorInt return if (dark) {
fun getPrimaryDisabledTextColor(context: Context, dark: Boolean): Int { ContextCompat.getColor(this, R.color.primary_text_disabled_material_light)
return if (dark) { } else ContextCompat.getColor(this, R.color.primary_text_disabled_material_dark)
ContextCompat.getColor(context, R.color.primary_text_disabled_material_light) }
} else ContextCompat.getColor(context, R.color.primary_text_disabled_material_dark)
} @SuppressLint("PrivateResource")
@ColorInt
@SuppressLint("PrivateResource") fun Context.getSecondaryDisabledTextColor(dark: Boolean): Int {
@ColorInt return if (dark) {
fun getSecondaryDisabledTextColor(context: Context, dark: Boolean): Int { ContextCompat.getColor(this, R.color.secondary_text_disabled_material_light)
return if (dark) { } else ContextCompat.getColor(this, R.color.secondary_text_disabled_material_dark)
ContextCompat.getColor(context, R.color.secondary_text_disabled_material_light) }
} else ContextCompat.getColor(context, R.color.secondary_text_disabled_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun Fragment.getPrimaryTextColor(dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(requireContext(), R.color.primary_text_default_material_light)
} else ContextCompat.getColor(requireContext(), R.color.primary_text_default_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun Fragment.getSecondaryTextColor(dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(requireContext(), R.color.secondary_text_default_material_light)
} else ContextCompat.getColor(requireContext(), R.color.secondary_text_default_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun Fragment.getPrimaryDisabledTextColor(dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(requireContext(), R.color.primary_text_disabled_material_light)
} else ContextCompat.getColor(requireContext(), R.color.primary_text_disabled_material_dark)
}
@SuppressLint("PrivateResource")
@ColorInt
fun Fragment.getSecondaryDisabledTextColor(dark: Boolean): Int {
return if (dark) {
ContextCompat.getColor(requireContext(), R.color.secondary_text_disabled_material_light)
} else ContextCompat.getColor(requireContext(), R.color.secondary_text_disabled_material_dark)
} }

@ -8,7 +8,7 @@ import com.google.android.material.navigation.NavigationView
/** /**
* @author Karim Abou Zeid (kabouzeid) * @author Karim Abou Zeid (kabouzeid)
*/ */
object NavigationViewUtil { object NavigationViewUtils {
fun setItemIconColors(navigationView: NavigationView, @ColorInt normalColor: Int, @ColorInt selectedColor: Int) { fun setItemIconColors(navigationView: NavigationView, @ColorInt normalColor: Int, @ColorInt selectedColor: Int) {
val iconSl = ColorStateList( val iconSl = ColorStateList(

@ -26,7 +26,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
override fun primaryColor(@ColorInt color: Int): ThemeStore { override fun primaryColor(@ColorInt color: Int): ThemeStore {
mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, color) mEditor.putInt(ThemeStorePrefKeys.KEY_PRIMARY_COLOR, color)
if (autoGeneratePrimaryDark(mContext)) if (autoGeneratePrimaryDark(mContext))
primaryColorDark(ColorUtil.darkenColor(color)) primaryColorDark(ColorUtils.darkenColor(color))
return this return this
} }
@ -35,7 +35,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun primaryColorAttr(@AttrRes colorAttr: Int): ThemeStore { override fun primaryColorAttr(@AttrRes colorAttr: Int): ThemeStore {
return primaryColor(ATHUtil.resolveColor(mContext, colorAttr)) return primaryColor(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun primaryColorDark(@ColorInt color: Int): ThemeStore { override fun primaryColorDark(@ColorInt color: Int): ThemeStore {
@ -48,7 +48,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun primaryColorDarkAttr(@AttrRes colorAttr: Int): ThemeStore { override fun primaryColorDarkAttr(@AttrRes colorAttr: Int): ThemeStore {
return primaryColorDark(ATHUtil.resolveColor(mContext, colorAttr)) return primaryColorDark(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun accentColor(@ColorInt color: Int): ThemeStore { override fun accentColor(@ColorInt color: Int): ThemeStore {
@ -61,7 +61,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun accentColorAttr(@AttrRes colorAttr: Int): ThemeStore { override fun accentColorAttr(@AttrRes colorAttr: Int): ThemeStore {
return accentColor(ATHUtil.resolveColor(mContext, colorAttr)) return accentColor(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun statusBarColor(@ColorInt color: Int): ThemeStore { override fun statusBarColor(@ColorInt color: Int): ThemeStore {
@ -74,7 +74,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun statusBarColorAttr(@AttrRes colorAttr: Int): ThemeStore { override fun statusBarColorAttr(@AttrRes colorAttr: Int): ThemeStore {
return statusBarColor(ATHUtil.resolveColor(mContext, colorAttr)) return statusBarColor(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun navigationBarColor(@ColorInt color: Int): ThemeStore { override fun navigationBarColor(@ColorInt color: Int): ThemeStore {
@ -87,7 +87,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun navigationBarColorAttr(@AttrRes colorAttr: Int): ThemeStore { override fun navigationBarColorAttr(@AttrRes colorAttr: Int): ThemeStore {
return navigationBarColor(ATHUtil.resolveColor(mContext, colorAttr)) return navigationBarColor(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun textColorPrimary(@ColorInt color: Int): ThemeStore { override fun textColorPrimary(@ColorInt color: Int): ThemeStore {
@ -100,7 +100,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun textColorPrimaryAttr(@AttrRes colorAttr: Int): ThemeStore { override fun textColorPrimaryAttr(@AttrRes colorAttr: Int): ThemeStore {
return textColorPrimary(ATHUtil.resolveColor(mContext, colorAttr)) return textColorPrimary(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun textColorPrimaryInverse(@ColorInt color: Int): ThemeStore { override fun textColorPrimaryInverse(@ColorInt color: Int): ThemeStore {
@ -113,7 +113,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun textColorPrimaryInverseAttr(@AttrRes colorAttr: Int): ThemeStore { override fun textColorPrimaryInverseAttr(@AttrRes colorAttr: Int): ThemeStore {
return textColorPrimaryInverse(ATHUtil.resolveColor(mContext, colorAttr)) return textColorPrimaryInverse(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun textColorSecondary(@ColorInt color: Int): ThemeStore { override fun textColorSecondary(@ColorInt color: Int): ThemeStore {
@ -126,7 +126,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun textColorSecondaryAttr(@AttrRes colorAttr: Int): ThemeStore { override fun textColorSecondaryAttr(@AttrRes colorAttr: Int): ThemeStore {
return textColorSecondary(ATHUtil.resolveColor(mContext, colorAttr)) return textColorSecondary(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun textColorSecondaryInverse(@ColorInt color: Int): ThemeStore { override fun textColorSecondaryInverse(@ColorInt color: Int): ThemeStore {
@ -139,7 +139,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
} }
override fun textColorSecondaryInverseAttr(@AttrRes colorAttr: Int): ThemeStore { override fun textColorSecondaryInverseAttr(@AttrRes colorAttr: Int): ThemeStore {
return textColorSecondaryInverse(ATHUtil.resolveColor(mContext, colorAttr)) return textColorSecondaryInverse(ATHUtils.resolveColor(mContext, colorAttr))
} }
override fun backgroundColor(color: Int): ThemeStore { override fun backgroundColor(color: Int): ThemeStore {
@ -179,7 +179,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
// Static getters // Static getters
@CheckResult @CheckResult
protected fun prefs(context: Context): SharedPreferences { internal fun prefs(context: Context): SharedPreferences {
return context.getSharedPreferences(ThemeStorePrefKeys.CONFIG_PREFS_KEY_DEFAULT, Context.MODE_PRIVATE) return context.getSharedPreferences(ThemeStorePrefKeys.CONFIG_PREFS_KEY_DEFAULT, Context.MODE_PRIVATE)
} }
@ -192,7 +192,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun primaryColor(context: Context): Int { fun primaryColor(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_PRIMARY_COLOR, ThemeStorePrefKeys.KEY_PRIMARY_COLOR,
ATHUtil.resolveColor(context, R.attr.colorPrimary, Color.parseColor("#455A64")) ATHUtils.resolveColor(context, R.attr.colorPrimary, Color.parseColor("#455A64"))
) )
} }
@ -201,7 +201,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun primaryColorDark(context: Context): Int { fun primaryColorDark(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_PRIMARY_COLOR_DARK, ThemeStorePrefKeys.KEY_PRIMARY_COLOR_DARK,
ATHUtil.resolveColor(context, R.attr.colorPrimaryDark, Color.parseColor("#37474F")) ATHUtils.resolveColor(context, R.attr.colorPrimaryDark, Color.parseColor("#37474F"))
) )
} }
@ -210,7 +210,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun accentColor(context: Context): Int { fun accentColor(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_ACCENT_COLOR, ThemeStorePrefKeys.KEY_ACCENT_COLOR,
ATHUtil.resolveColor(context, R.attr.colorAccent, Color.parseColor("#263238")) ATHUtils.resolveColor(context, R.attr.colorAccent, Color.parseColor("#263238"))
) )
} }
@ -235,7 +235,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun textColorPrimary(context: Context): Int { fun textColorPrimary(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_TEXT_COLOR_PRIMARY, ThemeStorePrefKeys.KEY_TEXT_COLOR_PRIMARY,
ATHUtil.resolveColor(context, android.R.attr.textColorPrimary) ATHUtils.resolveColor(context, android.R.attr.textColorPrimary)
) )
} }
@ -244,7 +244,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun textColorPrimaryInverse(context: Context): Int { fun textColorPrimaryInverse(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_TEXT_COLOR_PRIMARY_INVERSE, ThemeStorePrefKeys.KEY_TEXT_COLOR_PRIMARY_INVERSE,
ATHUtil.resolveColor(context, android.R.attr.textColorPrimaryInverse) ATHUtils.resolveColor(context, android.R.attr.textColorPrimaryInverse)
) )
} }
@ -253,7 +253,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun textColorSecondary(context: Context): Int { fun textColorSecondary(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_TEXT_COLOR_SECONDARY, ThemeStorePrefKeys.KEY_TEXT_COLOR_SECONDARY,
ATHUtil.resolveColor(context, android.R.attr.textColorSecondary) ATHUtils.resolveColor(context, android.R.attr.textColorSecondary)
) )
} }
@ -262,7 +262,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun textColorSecondaryInverse(context: Context): Int { fun textColorSecondaryInverse(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_TEXT_COLOR_SECONDARY_INVERSE, ThemeStorePrefKeys.KEY_TEXT_COLOR_SECONDARY_INVERSE,
ATHUtil.resolveColor(context, android.R.attr.textColorSecondaryInverse) ATHUtils.resolveColor(context, android.R.attr.textColorSecondaryInverse)
) )
} }
@ -271,7 +271,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
fun backgroundColor(context: Context): Int { fun backgroundColor(context: Context): Int {
return prefs(context).getInt( return prefs(context).getInt(
ThemeStorePrefKeys.KEY_BACKGROUND_COLOR, ThemeStorePrefKeys.KEY_BACKGROUND_COLOR,
ATHUtil.resolveColor(context, android.R.attr.colorBackground) ATHUtils.resolveColor(context, android.R.attr.colorBackground)
) )
} }

@ -6,26 +6,26 @@ package io.legado.app.lib.theme
internal interface ThemeStorePrefKeys { internal interface ThemeStorePrefKeys {
companion object { companion object {
val CONFIG_PREFS_KEY_DEFAULT = "app_themes" const val CONFIG_PREFS_KEY_DEFAULT = "app_themes"
val IS_CONFIGURED_KEY = "is_configured" const val IS_CONFIGURED_KEY = "is_configured"
val IS_CONFIGURED_VERSION_KEY = "is_configured_version" const val IS_CONFIGURED_VERSION_KEY = "is_configured_version"
val VALUES_CHANGED = "values_changed" const val VALUES_CHANGED = "values_changed"
val KEY_PRIMARY_COLOR = "primary_color" const val KEY_PRIMARY_COLOR = "primary_color"
val KEY_PRIMARY_COLOR_DARK = "primary_color_dark" const val KEY_PRIMARY_COLOR_DARK = "primary_color_dark"
val KEY_ACCENT_COLOR = "accent_color" const val KEY_ACCENT_COLOR = "accent_color"
val KEY_STATUS_BAR_COLOR = "status_bar_color" const val KEY_STATUS_BAR_COLOR = "status_bar_color"
val KEY_NAVIGATION_BAR_COLOR = "navigation_bar_color" const val KEY_NAVIGATION_BAR_COLOR = "navigation_bar_color"
val KEY_TEXT_COLOR_PRIMARY = "text_color_primary" const val KEY_TEXT_COLOR_PRIMARY = "text_color_primary"
val KEY_TEXT_COLOR_PRIMARY_INVERSE = "text_color_primary_inverse" const val KEY_TEXT_COLOR_PRIMARY_INVERSE = "text_color_primary_inverse"
val KEY_TEXT_COLOR_SECONDARY = "text_color_secondary" const val KEY_TEXT_COLOR_SECONDARY = "text_color_secondary"
val KEY_TEXT_COLOR_SECONDARY_INVERSE = "text_color_secondary_inverse" const val KEY_TEXT_COLOR_SECONDARY_INVERSE = "text_color_secondary_inverse"
val KEY_BACKGROUND_COLOR = "backgroundColor" const val KEY_BACKGROUND_COLOR = "backgroundColor"
val KEY_APPLY_PRIMARYDARK_STATUSBAR = "apply_primarydark_statusbar" const val KEY_APPLY_PRIMARYDARK_STATUSBAR = "apply_primarydark_statusbar"
val KEY_APPLY_PRIMARY_NAVBAR = "apply_primary_navbar" const val KEY_APPLY_PRIMARY_NAVBAR = "apply_primary_navbar"
val KEY_AUTO_GENERATE_PRIMARYDARK = "auto_generate_primarydark" const val KEY_AUTO_GENERATE_PRIMARYDARK = "auto_generate_primarydark"
} }
} }

@ -46,13 +46,13 @@ object TintHelper {
} }
fun setTintSelector(view: View, @ColorInt color: Int, darker: Boolean, useDarkTheme: Boolean) { fun setTintSelector(view: View, @ColorInt color: Int, darker: Boolean, useDarkTheme: Boolean) {
val isColorLight = ColorUtil.isColorLight(color) val isColorLight = ColorUtils.isColorLight(color)
val disabled = ContextCompat.getColor( val disabled = ContextCompat.getColor(
view.context, view.context,
if (useDarkTheme) R.color.ate_button_disabled_dark else R.color.ate_button_disabled_light if (useDarkTheme) R.color.ate_button_disabled_dark else R.color.ate_button_disabled_light
) )
val pressed = ColorUtil.shiftColor(color, if (darker) 0.9f else 1.1f) val pressed = ColorUtils.shiftColor(color, if (darker) 0.9f else 1.1f)
val activated = ColorUtil.shiftColor(color, if (darker) 1.1f else 0.9f) val activated = ColorUtils.shiftColor(color, if (darker) 1.1f else 0.9f)
val rippleColor = getDefaultRippleColor(view.context, isColorLight) val rippleColor = getDefaultRippleColor(view.context, isColorLight)
val textColor = ContextCompat.getColor( val textColor = ContextCompat.getColor(
view.context, view.context,
@ -107,7 +107,7 @@ object TintHelper {
var drawable: Drawable? = view.background var drawable: Drawable? = view.background
if (drawable != null) { if (drawable != null) {
drawable = createTintedDrawable(drawable, sl) drawable = createTintedDrawable(drawable, sl)
ViewUtil.setBackgroundCompat(view, drawable) ViewUtils.setBackgroundCompat(view, drawable)
} }
if (view is TextView && view !is Button) { if (view is TextView && view !is Button) {
@ -127,7 +127,7 @@ object TintHelper {
view: View, @ColorInt color: Int, view: View, @ColorInt color: Int,
background: Boolean background: Boolean
) { ) {
setTintAuto(view, color, background, ATHUtil.isWindowBackgroundDark(view.context)) setTintAuto(view, color, background, ATHUtils.isWindowBackgroundDark(view.context))
} }
fun setTintAuto( fun setTintAuto(
@ -175,7 +175,7 @@ object TintHelper {
view.context, view.context,
if (isDark) R.color.ripple_material_dark else R.color.ripple_material_light if (isDark) R.color.ripple_material_dark else R.color.ripple_material_light
) )
val checked = ColorUtil.adjustAlpha(color, 0.4f) val checked = ColorUtils.adjustAlpha(color, 0.4f)
val sl = ColorStateList( val sl = ColorStateList(
arrayOf( arrayOf(
intArrayOf(-android.R.attr.state_activated, -android.R.attr.state_checked), intArrayOf(-android.R.attr.state_activated, -android.R.attr.state_checked),
@ -195,7 +195,7 @@ object TintHelper {
var drawable: Drawable? = view.background var drawable: Drawable? = view.background
if (drawable != null) { if (drawable != null) {
drawable = createTintedDrawable(drawable, color) drawable = createTintedDrawable(drawable, color)
ViewUtil.setBackgroundCompat(view, drawable) ViewUtils.setBackgroundCompat(view, drawable)
} }
} }
} }
@ -209,7 +209,7 @@ object TintHelper {
intArrayOf(android.R.attr.state_enabled, android.R.attr.state_checked) intArrayOf(android.R.attr.state_enabled, android.R.attr.state_checked)
), intArrayOf( ), intArrayOf(
// Rdio button includes own alpha for disabled state // Rdio button includes own alpha for disabled state
ColorUtil.stripAlpha( ColorUtils.stripAlpha(
ContextCompat.getColor( ContextCompat.getColor(
radioButton.context, radioButton.context,
if (useDarker) R.color.ate_control_disabled_dark else R.color.ate_control_disabled_light if (useDarker) R.color.ate_control_disabled_dark else R.color.ate_control_disabled_light
@ -335,9 +335,9 @@ object TintHelper {
): Drawable? { ): Drawable? {
var tint = tint var tint = tint
if (useDarker) { if (useDarker) {
tint = ColorUtil.shiftColor(tint, 1.1f) tint = ColorUtils.shiftColor(tint, 1.1f)
} }
tint = ColorUtil.adjustAlpha(tint, if (compatSwitch && !thumb) 0.5f else 1.0f) tint = ColorUtils.adjustAlpha(tint, if (compatSwitch && !thumb) 0.5f else 1.0f)
val disabled: Int val disabled: Int
var normal: Int var normal: Int
if (thumb) { if (thumb) {
@ -362,7 +362,7 @@ object TintHelper {
// Stock switch includes its own alpha // Stock switch includes its own alpha
if (!compatSwitch) { if (!compatSwitch) {
normal = ColorUtil.stripAlpha(normal) normal = ColorUtils.stripAlpha(normal)
} }
val sl = ColorStateList( val sl = ColorStateList(

@ -10,7 +10,7 @@ import androidx.annotation.ColorInt
/** /**
* @author Karim Abou Zeid (kabouzeid) * @author Karim Abou Zeid (kabouzeid)
*/ */
object ViewUtil { object ViewUtils {
fun removeOnGlobalLayoutListener(v: View, listener: ViewTreeObserver.OnGlobalLayoutListener) { fun removeOnGlobalLayoutListener(v: View, listener: ViewTreeObserver.OnGlobalLayoutListener) {
v.viewTreeObserver.removeOnGlobalLayoutListener(listener) v.viewTreeObserver.removeOnGlobalLayoutListener(listener)
@ -21,7 +21,7 @@ object ViewUtil {
} }
fun setBackgroundTransition(view: View, newDrawable: Drawable): TransitionDrawable { fun setBackgroundTransition(view: View, newDrawable: Drawable): TransitionDrawable {
val transition = DrawableUtil.createTransitionDrawable(view.background, newDrawable) val transition = DrawableUtils.createTransitionDrawable(view.background, newDrawable)
setBackgroundCompat(view, transition) setBackgroundCompat(view, transition)
return transition return transition
} }
@ -32,7 +32,7 @@ object ViewUtil {
val start = oldColor ?: ColorDrawable(view.solidColor) val start = oldColor ?: ColorDrawable(view.solidColor)
val end = ColorDrawable(newColor) val end = ColorDrawable(newColor)
val transition = DrawableUtil.createTransitionDrawable(start, end) val transition = DrawableUtils.createTransitionDrawable(start, end)
setBackgroundCompat(view, transition) setBackgroundCompat(view, transition)

@ -4,7 +4,7 @@ import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.util.AttributeSet import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
import io.legado.app.lib.theme.ColorUtil import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.Selector import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.dp import io.legado.app.utils.dp
@ -26,7 +26,7 @@ class ATEAccentBgTextView : AppCompatTextView {
background = Selector.shapeBuild() background = Selector.shapeBuild()
.setCornerRadius(3.dp) .setCornerRadius(3.dp)
.setDefaultBgColor(ThemeStore.accentColor(context)) .setDefaultBgColor(ThemeStore.accentColor(context))
.setPressedBgColor(ColorUtil.darkenColor(ThemeStore.accentColor(context))) .setPressedBgColor(ColorUtils.darkenColor(ThemeStore.accentColor(context)))
.create() .create()
setTextColor(Color.WHITE) setTextColor(Color.WHITE)
} }

@ -4,13 +4,14 @@ import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.Switch import android.widget.Switch
import androidx.appcompat.widget.SwitchCompat
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATEStockSwitch : Switch { class ATEStockSwitch : SwitchCompat {
constructor(context: Context) : super(context) { constructor(context: Context) : super(context) {
init(context, null) init(context, null)

@ -4,13 +4,14 @@ import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.Switch import android.widget.Switch
import androidx.appcompat.widget.SwitchCompat
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATESwitch : Switch { class ATESwitch : SwitchCompat {
constructor(context: Context) : super(context) { constructor(context: Context) : super(context) {
init(context, null) init(context, null)

@ -1,5 +1,5 @@
<resources> <resources>
<style name="CAppTheme.NoActionBar"> <style name="AppTheme.Light.NoActionBar">
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>

@ -1,23 +1,25 @@
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
//**************************************************************Theme******************************************************************************//
<!-- 亮色主题 --> <!-- 亮色主题 -->
<style name="CAppTheme" parent="Base.AppTheme"> <style name="AppTheme.Light" parent="Base.AppTheme">
<item name="actionBarStyle">@style/AppTheme.AppBarOverlay.Light</item> <item name="actionBarStyle">@style/AppTheme.AppBarOverlay.Light</item>
</style> </style>
<!-- 暗色主题 --> <!-- 暗色主题 -->
<style name="CAppThemeBarDark" parent="Base.AppTheme"> <style name="AppTheme.Dark" parent="Base.AppTheme">
<item name="actionBarStyle">@style/AppTheme.AppBarOverlay.Dark</item> <item name="actionBarStyle">@style/AppTheme.AppBarOverlay.Dark</item>
</style> </style>
<!-- 透明主题 --> <!-- 透明主题 -->
<style name="CAppTransparentTheme" parent="Base.AppTheme"> <style name="AppTheme.Transparent" parent="Base.AppTheme">
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
</style> </style>
<!-- Welcome主题 --> <!-- Welcome主题 -->
<style name="CAppWelcomeTheme" parent="Base.AppTheme"> <style name="AppTheme.Welcome" parent="Base.AppTheme">
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
</style> </style>
@ -27,41 +29,54 @@
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="actionOverflowMenuStyle">@style/PopupMenu</item> <item name="actionOverflowMenuStyle">@style/Style.PopupMenu</item>
<item name="android:itemTextAppearance">@style/MenuItemTextStyle</item> <item name="android:itemTextAppearance">@style/Style.MenuItemText</item>
<item name="android:popupMenuStyle">@style/PopupMenu</item> <item name="android:popupMenuStyle">@style/Style.PopupMenu</item>
</style> </style>
<style name="NavigationViewStyle"> <style name="AppTheme.AppBarOverlay.Light" parent="ThemeOverlay.AppCompat.Light">
<item name="android:listPreferredItemHeightSmall">44dp</item> <item name="colorAccent">@color/md_grey_900</item>
</style>
<style name="AppTheme.AppBarOverlay.Dark" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorAccent">@color/md_grey_100</item>
</style> </style>
<style name="alertDialogTheme" parent="Theme.AppCompat.DayNight.Dialog.Alert"> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<item name="overlapAnchor">false</item>
<item name="colorAccent">@color/md_grey_900</item>
</style>
<style name="AppTheme.AlertDialog" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:background">@color/background_card</item> <item name="android:background">@color/background_card</item>
<item name="android:textColor">@color/tv_text_default</item> <item name="android:textColor">@color/tv_text_default</item>
<item name="android:textColorPrimary">@color/tv_text_default</item> <item name="android:textColorPrimary">@color/tv_text_default</item>
<item name="textColorAlertDialogListItem">@color/tv_text_default</item> <item name="textColorAlertDialogListItem">@color/tv_text_default</item>
</style>
//**************************************************************System Style******************************************************************************//
<style name="Style.NavigationView" parent="android:Widget">
<item name="android:listPreferredItemHeightSmall">44dp</item>
</style> </style>
<style name="MenuItemTextStyle" parent="@android:style/TextAppearance.Widget.IconMenu.Item"> <style name="Style.Toolbar.NoPadding" parent="Base.Widget.AppCompat.Toolbar">
<item name="contentInsetStartWithNavigation">0dp</item>
</style>
<style name="Style.MenuItemText" parent="@android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">@color/menu_color_default</item> <item name="android:textColor">@color/menu_color_default</item>
<item name="android:textSize">16sp</item> <item name="android:textSize">16sp</item>
</style> </style>
<style name="PopupMenu" parent="Widget.AppCompat.PopupMenu"> <style name="Style.PopupMenu" parent="Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@color/background_menu</item> <item name="android:popupBackground">@color/background_menu</item>
</style> </style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"> //**************************************************************Widget Style******************************************************************************//
<item name="overlapAnchor">false</item>
<item name="colorAccent">@color/md_grey_900</item>
</style>
<style name="NoPaddingToolbar" parent="Base.Widget.AppCompat.Toolbar">
<item name="contentInsetStartWithNavigation">0dp</item>
</style>
<style name="Style.Shadow.Top" parent="android:Widget"> <style name="Style.Shadow.Top" parent="android:Widget">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
@ -75,15 +90,6 @@
<item name="android:background">@drawable/bg_shadow_bottom</item> <item name="android:background">@drawable/bg_shadow_bottom</item>
</style> </style>
<style name="AppTheme.AppBarOverlay.Light" parent="ThemeOverlay.AppCompat.Light">
<item name="colorAccent">@color/md_grey_900</item>
</style>
<style name="AppTheme.AppBarOverlay.Dark" parent="ThemeOverlay.AppCompat.Dark">
<item name="colorAccent">@color/md_grey_100</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="Activity.Permission" parent="Theme.AppCompat.Light.NoActionBar"> <style name="Activity.Permission" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>

Loading…
Cancel
Save