Merge remote-tracking branch 'origin/master' into desirepath

pull/32/head
Invinciblelee 6 years ago
commit afb58c356a
  1. 6
      app/build.gradle
  2. 1
      app/src/main/AndroidManifest.xml
  3. 13
      app/src/main/java/io/legado/app/App.kt
  4. 22
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  5. 15
      app/src/main/java/io/legado/app/lib/theme/prefs/ATEPreferenceCategory.kt
  6. 37
      app/src/main/java/io/legado/app/lib/theme/prefs/ATESwitchPreference.kt
  7. 36
      app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt
  8. 15
      app/src/main/java/io/legado/app/ui/config/ConfigFragment.kt
  9. 14
      app/src/main/java/io/legado/app/ui/config/ConfigViewModel.kt
  10. 86
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  11. 3
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  12. 3
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceFragment.kt
  13. 3
      app/src/main/java/io/legado/app/ui/main/findbook/FindBookFragment.kt
  14. 38
      app/src/main/java/io/legado/app/ui/main/myconfig/MyConfigFragment.kt
  15. 2
      app/src/main/java/io/legado/app/ui/widget/TitleBar.kt
  16. 28
      app/src/main/java/io/legado/app/utils/MenuExtensions.kt
  17. 21
      app/src/main/res/layout/activity_config.xml
  18. 1
      app/src/main/res/layout/activity_search.xml
  19. 13
      app/src/main/res/layout/fragment_my_config.xml
  20. 6
      app/src/main/res/xml/pref_config.xml
  21. 101
      app/src/main/res/xml/pref_config_theme.xml

@ -81,8 +81,9 @@ dependencies {
//androidX
implementation 'androidx.core:core-ktx:1.2.0-alpha01'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.preference:preference:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'com.google.android.material:material:1.1.0-alpha07'
//lifecycle
def lifecycle_version = '2.0.0'
@ -121,4 +122,7 @@ dependencies {
//Glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
//
implementation 'com.jaredrummler:colorpicker:1.1.0'
}

@ -41,6 +41,7 @@
<activity android:name=".help.permission.PermissionActivity"
android:theme="@style/Activity.Permission"/>
<activity android:name=".ui.config.ConfigActivity"/>
</application>
</manifest>

@ -13,6 +13,7 @@ import io.legado.app.constant.AppConst.channelIdReadAloud
import io.legado.app.constant.AppConst.channelIdWeb
import io.legado.app.data.AppDatabase
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.getPrefInt
import java.util.*
@ -63,15 +64,15 @@ class App : Application() {
fun upThemeStore() {
if (getPrefBoolean("isNightTheme", false)) {
ThemeStore.editTheme(this)
.primaryColor(getPrefInt("colorPrimaryNight", resources.getColor(R.color.md_grey_800)))
.accentColor(getPrefInt("colorAccentNight", resources.getColor(R.color.md_pink_800)))
.backgroundColor(getPrefInt("colorBackgroundNight", resources.getColor(R.color.md_grey_800)))
.primaryColor(getPrefInt("colorPrimaryNight", getCompatColor(R.color.colorPrimary)))
.accentColor(getPrefInt("colorAccentNight", getCompatColor(R.color.colorAccent)))
.backgroundColor(getPrefInt("colorBackgroundNight", getCompatColor(R.color.md_grey_800)))
.apply()
} else {
ThemeStore.editTheme(this)
.primaryColor(getPrefInt("colorPrimary", resources.getColor(R.color.md_grey_100)))
.accentColor(getPrefInt("colorAccent", resources.getColor(R.color.md_pink_600)))
.backgroundColor(getPrefInt("colorBackground", resources.getColor(R.color.md_grey_100)))
.primaryColor(getPrefInt("colorPrimary", getCompatColor(R.color.colorPrimary)))
.accentColor(getPrefInt("colorAccent", getCompatColor(R.color.colorAccent)))
.backgroundColor(getPrefInt("colorBackground", getCompatColor(R.color.md_grey_100)))
.apply()
}
}

@ -7,16 +7,11 @@ import android.view.MenuItem
import android.view.View
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.view.menu.MenuItemImpl
import androidx.core.view.forEach
import androidx.lifecycle.ViewModel
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.DrawableUtils
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.getPrimaryTextColor
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.setIconColor
abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
@ -37,21 +32,8 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
final override fun onCreateOptionsMenu(menu: Menu?): Boolean {
return menu?.let {
if (it is MenuBuilder) {
it.setOptionalIconsVisible(true)
}
val bool = onCompatCreateOptionsMenu(it)
val primaryTextColor = getPrimaryTextColor(ColorUtils.isColorLight(ThemeStore.primaryColor(this)))
val defaultTextColor = getCompatColor(R.color.tv_text_default)
menu.forEach { item ->
(item as MenuItemImpl).let { impl ->
//overflow:展开的item
DrawableUtils.setTint(
impl.icon,
if (impl.requiresOverflow()) defaultTextColor else primaryTextColor
)
}
}
it.setIconColor(this)
bool
} ?: super.onCreateOptionsMenu(menu)
}

@ -2,11 +2,11 @@ package io.legado.app.lib.theme.prefs
import android.content.Context
import android.os.Build
import android.preference.PreferenceCategory
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceViewHolder
import io.legado.app.lib.theme.ThemeStore
@ -26,10 +26,13 @@ class ATEPreferenceCategory : PreferenceCategory {
constructor(context: Context) : super(context)
override fun onBindView(view: View) {
super.onBindView(view)
if (view is TextView) {
view.setTextColor(ThemeStore.accentColor(view.getContext()))//设置title文本的颜色
override fun onBindViewHolder(holder: PreferenceViewHolder?) {
super.onBindViewHolder(holder)
holder?.let {
val view = it.itemView
if (view is TextView) {
view.setTextColor(ThemeStore.accentColor(view.getContext()))//设置title文本的颜色
}
}
}

@ -2,17 +2,17 @@ package io.legado.app.lib.theme.prefs
import android.content.Context
import android.os.Build
import android.preference.SwitchPreference
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.Switch
import androidx.annotation.RequiresApi
import androidx.preference.PreferenceViewHolder
import androidx.preference.SwitchPreferenceCompat
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ThemeStore
import java.util.*
class ATESwitchPreference : SwitchPreference {
class ATESwitchPreference : SwitchPreferenceCompat {
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(
@ -28,25 +28,26 @@ class ATESwitchPreference : SwitchPreference {
constructor(context: Context) : super(context)
override fun onBindView(view: View) {
super.onBindView(view)
if (view is ViewGroup) {
val queue = LinkedList<ViewGroup>()
queue.add(view)
while (!queue.isEmpty()) {
val current = queue.removeFirst()
for (i in 0 until current.childCount) {
if (current.getChildAt(i) is Switch) {
ATH.setTint(current.getChildAt(i), ThemeStore.accentColor(view.getContext()))
return
} else if (current.getChildAt(i) is ViewGroup) {
queue.addLast(current.getChildAt(i) as ViewGroup)
override fun onBindViewHolder(holder: PreferenceViewHolder?) {
super.onBindViewHolder(holder)
holder?.let {
val view = it.itemView
if (view is ViewGroup) {
val queue = LinkedList<ViewGroup>()
queue.add(view)
while (!queue.isEmpty()) {
val current = queue.removeFirst()
for (i in 0 until current.childCount) {
if (current.getChildAt(i) is Switch) {
ATH.setTint(current.getChildAt(i), ThemeStore.accentColor(view.getContext()))
return
} else if (current.getChildAt(i) is ViewGroup) {
queue.addLast(current.getChildAt(i) as ViewGroup)
}
}
}
}
}
}
}

@ -0,0 +1,36 @@
package io.legado.app.ui.config
import android.os.Bundle
import io.legado.app.R
import io.legado.app.base.BaseActivity
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_config.*
import kotlinx.android.synthetic.main.view_titlebar.*
class ConfigActivity : BaseActivity<ConfigViewModel>() {
override val viewModel: ConfigViewModel
get() = getViewModel(ConfigViewModel::class.java)
override val layoutID: Int
get() = R.layout.activity_config
override fun onViewModelCreated(viewModel: ConfigViewModel, savedInstanceState: Bundle?) {
intent.getIntExtra("configType", -1).let {
if (it != -1) viewModel.configType = it
}
this.setSupportActionBar(toolbar)
when (viewModel.configType) {
ConfigViewModel.TYPE_CONFIG -> {
title_bar.title = "设置"
supportFragmentManager.beginTransaction().replace(R.id.configFrameLayout, ConfigFragment()).commit()
}
ConfigViewModel.TYPE_THEME_CONFIG -> {
title_bar.title = "主题设置"
supportFragmentManager.beginTransaction().replace(R.id.configFrameLayout, ThemeConfigFragment())
.commit()
}
}
}
}

@ -0,0 +1,15 @@
package io.legado.app.ui.config
import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
class ConfigFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_config)
}
}

@ -0,0 +1,14 @@
package io.legado.app.ui.config
import android.app.Application
import androidx.lifecycle.AndroidViewModel
class ConfigViewModel(application: Application) : AndroidViewModel(application) {
companion object {
val TYPE_CONFIG = 0
val TYPE_THEME_CONFIG = 1
}
var configType: Int = TYPE_CONFIG
}

@ -0,0 +1,86 @@
package io.legado.app.ui.config
import android.content.SharedPreferences
import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.App
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.putPrefInt
import io.legado.app.utils.upTint
class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedPreferenceChangeListener {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_config_theme)
}
override fun onResume() {
super.onResume()
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
}
override fun onPause() {
preferenceManager.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
super.onPause()
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
sharedPreferences ?: return
when (key) {
"colorPrimary", "colorAccent", "colorBackground" -> if (!ColorUtils.isColorLight(
sharedPreferences.getInt(
"colorBackground",
App.INSTANCE.getCompatColor(R.color.md_grey_100)
)
)
) {
AlertDialog.Builder(App.INSTANCE)
.setTitle("白天背景太暗")
.setMessage("将会恢复默认背景?")
.setPositiveButton(R.string.ok) { dialog, which ->
App.INSTANCE.putPrefInt("colorBackground", App.INSTANCE.getCompatColor(R.color.md_grey_100))
upTheme(false)
}
.setNegativeButton(R.string.cancel) { dialogInterface, i -> upTheme(false) }
.show().upTint
} else {
upTheme(false)
}
"colorPrimaryNight", "colorAccentNight", "colorBackgroundNight" -> if (ColorUtils.isColorLight(
sharedPreferences.getInt(
"colorBackgroundNight",
App.INSTANCE.getCompatColor(R.color.md_grey_800)
)
)
) {
AlertDialog.Builder(App.INSTANCE)
.setTitle("夜间背景太亮")
.setMessage("将会恢复默认背景?")
.setPositiveButton(R.string.ok) { dialog, which ->
App.INSTANCE.putPrefInt(
"colorBackgroundNight",
App.INSTANCE.getCompatColor(R.color.md_grey_800)
)
upTheme(true)
}
.setNegativeButton(R.string.cancel) { dialogInterface, i -> upTheme(true) }
.show()
} else {
upTheme(true)
}
}
}
private fun upTheme(isNightTheme: Boolean) {
if (App.INSTANCE.getPrefBoolean("isNightTheme", false) == isNightTheme) {
App.INSTANCE.upThemeStore()
}
}
}

@ -6,7 +6,9 @@ import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.App
import io.legado.app.R
import io.legado.app.utils.setIconColor
import kotlinx.android.synthetic.main.view_titlebar.*
class BookshelfFragment : Fragment(R.layout.fragment_bookshelf), Toolbar.OnMenuItemClickListener {
@ -15,6 +17,7 @@ class BookshelfFragment : Fragment(R.layout.fragment_bookshelf), Toolbar.OnMenuI
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "BookshelfFragment")
toolbar.inflateMenu(R.menu.bookshelf)
toolbar.menu.setIconColor(App.INSTANCE)
toolbar.setOnMenuItemClickListener(this)
}

@ -6,7 +6,9 @@ import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.App
import io.legado.app.R
import io.legado.app.utils.setIconColor
import kotlinx.android.synthetic.main.view_titlebar.*
class BookSourceFragment : Fragment(R.layout.fragment_book_source), Toolbar.OnMenuItemClickListener {
@ -15,6 +17,7 @@ class BookSourceFragment : Fragment(R.layout.fragment_book_source), Toolbar.OnMe
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "BookSourceFragment")
toolbar.inflateMenu(R.menu.book_source)
toolbar.menu.setIconColor(App.INSTANCE)
toolbar.setOnMenuItemClickListener(this)
}

@ -6,7 +6,9 @@ import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import io.legado.app.App
import io.legado.app.R
import io.legado.app.utils.setIconColor
import kotlinx.android.synthetic.main.view_titlebar.*
class FindBookFragment : Fragment(R.layout.fragment_find_book), Toolbar.OnMenuItemClickListener {
@ -15,6 +17,7 @@ class FindBookFragment : Fragment(R.layout.fragment_find_book), Toolbar.OnMenuIt
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "FindBookFragment")
toolbar.inflateMenu(R.menu.find_book)
toolbar.menu.setIconColor(App.INSTANCE)
toolbar.setOnMenuItemClickListener(this)
}

@ -1,20 +1,18 @@
package io.legado.app.ui.main.myconfig
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.view.menu.MenuItemImpl
import androidx.appcompat.widget.Toolbar
import androidx.core.view.forEach
import androidx.fragment.app.Fragment
import io.legado.app.App
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.DrawableUtils
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.getPrimaryTextColor
import io.legado.app.utils.getCompatColor
import io.legado.app.ui.config.ConfigActivity
import io.legado.app.ui.config.ConfigViewModel
import io.legado.app.utils.setIconColor
import kotlinx.android.synthetic.main.fragment_my_config.*
import kotlinx.android.synthetic.main.view_titlebar.*
class MyConfigFragment : Fragment(R.layout.fragment_my_config), Toolbar.OnMenuItemClickListener {
@ -23,25 +21,13 @@ class MyConfigFragment : Fragment(R.layout.fragment_my_config), Toolbar.OnMenuIt
super.onViewCreated(view, savedInstanceState)
Log.e("TAG", "MyConfigFragment")
toolbar.inflateMenu(R.menu.my_config)
toolbar.menu?.let {
if (it is MenuBuilder) {
it.setOptionalIconsVisible(true)
}
context?.let { context ->
val primaryTextColor = getPrimaryTextColor(ColorUtils.isColorLight(ThemeStore.primaryColor(context)))
val defaultTextColor = getCompatColor(R.color.tv_text_default)
it.forEach { item ->
(item as MenuItemImpl).let { impl ->
//overflow:展开的item
DrawableUtils.setTint(
impl.icon,
if (impl.requiresOverflow()) defaultTextColor else primaryTextColor
)
}
}
}
}
toolbar.menu.setIconColor(App.INSTANCE)
toolbar.setOnMenuItemClickListener(this)
tv_theme_config.setOnClickListener {
val intent = Intent(context, ConfigActivity::class.java)
intent.putExtra("configType", ConfigViewModel.TYPE_THEME_CONFIG)
startActivity(intent)
}
}
override fun onMenuItemClick(item: MenuItem?): Boolean {

@ -14,6 +14,7 @@ import androidx.appcompat.widget.Toolbar
import androidx.core.graphics.drawable.DrawableCompat
import com.google.android.material.appbar.AppBarLayout
import io.legado.app.R
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.getStatusBarHeight
import org.jetbrains.anko.bottomPadding
import org.jetbrains.anko.topPadding
@ -40,6 +41,7 @@ class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, a
init {
inflate(context, R.layout.view_titlebar, this)
setBackgroundColor(ThemeStore.primaryColor(context))
toolbar = findViewById(R.id.toolbar)
val a = context.obtainStyledAttributes(
attrs, R.styleable.TitleBar,

@ -1,2 +1,30 @@
package io.legado.app.utils
import android.content.Context
import android.view.Menu
import androidx.appcompat.view.menu.MenuBuilder
import androidx.appcompat.view.menu.MenuItemImpl
import androidx.core.view.forEach
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.DrawableUtils
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.getPrimaryTextColor
fun Menu.setIconColor(context: Context): Menu = this.let { menu ->
if (menu is MenuBuilder) {
menu.setOptionalIconsVisible(true)
}
val primaryTextColor = context.getPrimaryTextColor(ColorUtils.isColorLight(ThemeStore.primaryColor(context)))
val defaultTextColor = context.getCompatColor(R.color.tv_text_default)
menu.forEach { item ->
(item as MenuItemImpl).let { impl ->
//overflow:展开的item
DrawableUtils.setTint(
impl.icon,
if (impl.requiresOverflow()) defaultTextColor else primaryTextColor
)
}
}
return menu
}

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:title="设置"/>
<LinearLayout
android:id="@+id/configFrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
</LinearLayout>

@ -10,7 +10,6 @@
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent"
app:title="搜索"/>

@ -13,5 +13,18 @@
app:layout_constraintTop_toTopOf="parent"
app:title="我的"/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/title_bar">
<TextView
android:id="@+id/tv_theme_config"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="@string/theme_setting"/>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen
>
</androidx.preference.PreferenceScreen>

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="immersionStatusBar"
android:summary="@string/status_bar_immersion"
android:title="@string/immersion_status_bar"
app:iconSpaceReserved="false"/>
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="navigationBarColorChange"
android:summary="@string/navigation_bar_color_change_s"
android:title="@string/navigation_bar_color_change"
app:iconSpaceReserved="false"/>
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="true"
android:key="behaviorMain"
android:summary="@string/behavior_main_s"
android:title="@string/behavior_main_t"
app:iconSpaceReserved="false"/>
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="false"
android:key="E-InkMode"
android:summary="@string/e_ink_mode_detail"
android:title="@string/e_ink_mode"
app:iconSpaceReserved="false"/>
<Preference
android:key="defaultTheme"
android:summary="@string/restore_default_theme"
android:title="@string/default_theme"
app:iconSpaceReserved="false"/>
<io.legado.app.lib.theme.prefs.ATEPreferenceCategory
android:title="白天"
app:iconSpaceReserved="false">
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_grey_100"
android:key="colorPrimary"
android:summary="白天,主色调"
android:title="主色调"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_pink_600"
android:key="colorAccent"
android:summary="白天,强调色"
android:title="强调色"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_grey_100"
android:key="colorBackground"
android:summary="白天,背景色"
android:title="背景色"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
</io.legado.app.lib.theme.prefs.ATEPreferenceCategory>
<io.legado.app.lib.theme.prefs.ATEPreferenceCategory
android:title="夜间"
app:iconSpaceReserved="false">
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_grey_800"
android:key="colorPrimaryNight"
android:summary="夜间,主色调"
android:title="主色调"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_pink_800"
android:key="colorAccentNight"
android:summary="夜间,强调色"
android:title="强调色"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
android:defaultValue="@color/md_grey_800"
android:key="colorBackgroundNight"
android:summary="夜间,背景色"
android:title="背景色"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false"/>
</io.legado.app.lib.theme.prefs.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen>
Loading…
Cancel
Save