From d230d79bc75af035260ffd11ae67807a241389dc Mon Sep 17 00:00:00 2001 From: 1552980358 <1552980358@qq.com> Date: Wed, 9 Sep 2020 12:16:41 +0800 Subject: [PATCH] Theme.kt: Modify functions into assigning style Signed-off-by: 1552980358 <1552980358@qq.com> --- .../main/java/io/legado/app/constant/Theme.kt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/Theme.kt b/app/src/main/java/io/legado/app/constant/Theme.kt index 720c339f9..896e73ea0 100644 --- a/app/src/main/java/io/legado/app/constant/Theme.kt +++ b/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): Theme { - return if (ColorUtils.isColorLight(backgroundColor)) { - Light - } else { - Dark - } - } + fun getTheme(backgroundColor: Int) = + if (ColorUtils.isColorLight(backgroundColor)) Light + else Dark + } } \ No newline at end of file