From 57543276b18de8e95e609813ebe1359547722473 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 19 May 2020 11:23:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/AppConfig.kt | 7 ++++++- .../java/io/legado/app/ui/config/ThemeConfigFragment.kt | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 547322cce..f47ec213a 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -1,5 +1,6 @@ package io.legado.app.help +import android.annotation.SuppressLint import android.content.Context import android.content.pm.PackageManager import io.legado.app.App @@ -122,7 +123,11 @@ object AppConfig { } var elevation: Int - get() = App.INSTANCE.getPrefInt("elevation", -1) + @SuppressLint("PrivateResource") + get() = App.INSTANCE.getPrefInt( + "elevation", + App.INSTANCE.resources.getDimension(R.dimen.design_appbar_elevation).toInt() + ) set(value) { App.INSTANCE.putPrefInt("elevation", value) } 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 7b163b3e6..488fe3b05 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 @@ -1,5 +1,6 @@ package io.legado.app.ui.config +import android.annotation.SuppressLint import android.content.SharedPreferences import android.os.Build import android.os.Bundle @@ -115,6 +116,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar } + @SuppressLint("PrivateResource") override fun onPreferenceTreeClick(preference: Preference?): Boolean { when (preference?.key) { "defaultTheme" -> alert(title = "切换默认主题") {