Theme.kt: Modify functions into assigning style

Signed-off-by: 1552980358 <1552980358@qq.com>
pull/368/head
1552980358 4 years ago
parent 8a8df59e21
commit d230d79bc7
  1. 19
      app/src/main/java/io/legado/app/constant/Theme.kt

@ -7,18 +7,13 @@ enum class Theme {
Dark, Light, Auto, Transparent;
companion object {
fun getTheme(): Theme {
return if (AppConfig.isNightTheme) {
Dark
} else Light
}
fun getTheme() =
if (AppConfig.isNightTheme) Dark
else Light
fun getTheme(backgroundColor: Int) =
if (ColorUtils.isColorLight(backgroundColor)) Light
else Dark
fun getTheme(backgroundColor: Int): Theme {
return if (ColorUtils.isColorLight(backgroundColor)) {
Light
} else {
Dark
}
}
}
}
Loading…
Cancel
Save