Merge branch 'eink' of https://github.com/FadeApp/legado into FadeApp-eink

# Conflicts:
#	app/src/main/java/io/legado/app/lib/theme/ATH.kt
#	app/src/main/java/io/legado/app/utils/ContextExtensions.kt
pull/83/head
kunfei 5 years ago
parent 32d66a88a4
commit 7b10b26726
  1. 6
      app/build.gradle
  2. 6
      app/src/main/java/io/legado/app/lib/theme/ATH.kt
  3. 20
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  4. 1
      app/src/main/res/values/strings.xml
  5. 6
      app/src/main/res/xml/pref_main.xml

@ -20,6 +20,7 @@ def gitCommits = Integer.parseInt('git rev-list --count HEAD'.execute([], projec
android { android {
compileSdkVersion 29 compileSdkVersion 29
signingConfigs { signingConfigs {
if (project.hasProperty("RELEASE_STORE_FILE")) {
myConfig { myConfig {
storeFile file(RELEASE_STORE_FILE) storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD storePassword RELEASE_STORE_PASSWORD
@ -29,6 +30,7 @@ android {
v2SigningEnabled true v2SigningEnabled true
} }
} }
}
defaultConfig { defaultConfig {
applicationId "io.legado.app" applicationId "io.legado.app"
minSdkVersion 21 minSdkVersion 21
@ -49,12 +51,16 @@ android {
} }
buildTypes { buildTypes {
release { release {
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.myConfig signingConfig signingConfigs.myConfig
}
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
debug { debug {
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.myConfig signingConfig signingConfigs.myConfig
}
applicationIdSuffix '.debug' applicationIdSuffix '.debug'
versionNameSuffix 'debug' versionNameSuffix 'debug'
minifyEnabled false minifyEnabled false

@ -5,6 +5,7 @@ import android.app.Activity
import android.app.ActivityManager import android.app.ActivityManager
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Build import android.os.Build
import android.view.View import android.view.View
import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
@ -205,10 +206,7 @@ object ATH {
.setSelectedColor(ThemeStore.accentColor(bottom_navigation_view.context)).create() .setSelectedColor(ThemeStore.accentColor(bottom_navigation_view.context)).create()
itemIconTintList = colorStateList itemIconTintList = colorStateList
itemTextColor = colorStateList itemTextColor = colorStateList
itemBackgroundResource = when (AppConfig.isNightTheme) { itemBackground = ColorDrawable(ThemeStore.primaryColor(bottomBar.context))
true -> R.drawable.item_bg_dark
false -> R.drawable.item_bg_light
}
} }
} }

@ -20,7 +20,7 @@ import io.legado.app.utils.*
class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener { class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener {
val items = arrayOf("极简","曜夜","经典") val items = arrayOf("极简", "曜夜", "经典", "黑白", "A屏黑")
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_config_theme) addPreferencesFromResource(R.xml.pref_config_theme)
@ -124,6 +124,24 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar
putPrefInt("colorBackground", getCompatColor(R.color.md_grey_100)) putPrefInt("colorBackground", getCompatColor(R.color.md_grey_100))
putPrefBoolean("isNightTheme", false) 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() App.INSTANCE.applyDayNight()
recreateActivities() recreateActivities()

@ -447,6 +447,7 @@
<string name="switch_display_style">切换显示样式</string> <string name="switch_display_style">切换显示样式</string>
<string name="import_per">导入本地书籍需存储权限</string> <string name="import_per">导入本地书籍需存储权限</string>
<string name="night_theme">夜间模式</string> <string name="night_theme">夜间模式</string>
<string name="eink_theme">E-Ink 模式</string>
<string name="get_storage_per">本软件需要存储权限来存储备份书籍信息</string> <string name="get_storage_per">本软件需要存储权限来存储备份书籍信息</string>
<string name="double_click_exit">再按一次退出程序</string> <string name="double_click_exit">再按一次退出程序</string>
<string name="import_book_per">导入本地书籍需存储权限</string> <string name="import_book_per">导入本地书籍需存储权限</string>

@ -18,6 +18,12 @@
android:title="@string/night_theme" android:title="@string/night_theme"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="isEInkMode"
android:title="@string/eink_theme"
app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATESwitchPreference <io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="webService" android:key="webService"

Loading…
Cancel
Save