diff --git a/app/build.gradle b/app/build.gradle index 7eac96051..cae1dac53 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,13 +20,15 @@ def gitCommits = Integer.parseInt('git rev-list --count HEAD'.execute([], projec android { compileSdkVersion 29 signingConfigs { - myConfig { - storeFile file(RELEASE_STORE_FILE) - storePassword RELEASE_STORE_PASSWORD - keyAlias RELEASE_KEY_ALIAS - keyPassword RELEASE_KEY_PASSWORD - v1SigningEnabled true - v2SigningEnabled true + if (project.hasProperty("RELEASE_STORE_FILE")) { + myConfig { + storeFile file(RELEASE_STORE_FILE) + storePassword RELEASE_STORE_PASSWORD + keyAlias RELEASE_KEY_ALIAS + keyPassword RELEASE_KEY_PASSWORD + v1SigningEnabled true + v2SigningEnabled true + } } } defaultConfig { @@ -49,12 +51,16 @@ android { } buildTypes { release { - signingConfig signingConfigs.myConfig + if (project.hasProperty("RELEASE_STORE_FILE")) { + signingConfig signingConfigs.myConfig + } minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { - signingConfig signingConfigs.myConfig + if (project.hasProperty("RELEASE_STORE_FILE")) { + signingConfig signingConfigs.myConfig + } applicationIdSuffix '.debug' versionNameSuffix 'debug' minifyEnabled false diff --git a/app/src/main/java/io/legado/app/lib/theme/ATH.kt b/app/src/main/java/io/legado/app/lib/theme/ATH.kt index c625e1807..1b17de91e 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATH.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ATH.kt @@ -5,6 +5,7 @@ import android.app.Activity import android.app.ActivityManager import android.content.Context import android.graphics.Color +import android.graphics.drawable.ColorDrawable import android.os.Build import android.view.View import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR @@ -205,10 +206,7 @@ object ATH { .setSelectedColor(ThemeStore.accentColor(bottom_navigation_view.context)).create() itemIconTintList = colorStateList itemTextColor = colorStateList - itemBackgroundResource = when (AppConfig.isNightTheme) { - true -> R.drawable.item_bg_dark - false -> R.drawable.item_bg_light - } + itemBackground = ColorDrawable(ThemeStore.primaryColor(bottomBar.context)) } } diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index 6c87ff0af..477227214 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -20,7 +20,7 @@ import io.legado.app.utils.* class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener { - val items = arrayOf("极简","曜夜","经典") + val items = arrayOf("极简", "曜夜", "经典", "黑白", "A屏黑") override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.pref_config_theme) @@ -124,6 +124,24 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar putPrefInt("colorBackground", getCompatColor(R.color.md_grey_100)) putPrefBoolean("isNightTheme", false) } + 3 -> { + putPrefInt("colorPrimary", getCompatColor(R.color.white)) + putPrefInt("colorAccent", getCompatColor(R.color.black)) + putPrefInt("colorBackground", getCompatColor(R.color.white)) + putPrefBoolean("isNightTheme", false) + } + 4 -> { + putPrefInt("colorPrimaryNight", getCompatColor(R.color.black)) + putPrefInt( + "colorAccentNight", + getCompatColor(R.color.md_grey_600) + ) + putPrefInt( + "colorBackgroundNight", + getCompatColor(R.color.black) + ) + putPrefBoolean("isNightTheme", true) + } } App.INSTANCE.applyDayNight() recreateActivities() diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1e352f8e4..948cf5a47 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -77,7 +77,7 @@ 共%s个Text文件 加载中… 重试 - Web服务 + Web 服务 web编辑书源 http://%s:%d 离线下载 @@ -447,6 +447,7 @@ 切换显示样式 导入本地书籍需存储权限 夜间模式 + E-Ink 模式 本软件需要存储权限来存储备份书籍信息 再按一次退出程序 导入本地书籍需存储权限 diff --git a/app/src/main/res/xml/pref_main.xml b/app/src/main/res/xml/pref_main.xml index 297298599..f59dff9f7 100644 --- a/app/src/main/res/xml/pref_main.xml +++ b/app/src/main/res/xml/pref_main.xml @@ -18,6 +18,12 @@ android:title="@string/night_theme" app:iconSpaceReserved="false" /> + +