From e99157ca8c66ab703fcce25c66b93d5c12fb8676 Mon Sep 17 00:00:00 2001 From: HapeLee <1321903405@qq.com> Date: Thu, 11 Sep 2025 02:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=B6=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legato/kazusa/utils/ContextExtensions.kt | 7 ++++++- app/src/main/res/values-night/themes.xml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legato/kazusa/utils/ContextExtensions.kt b/app/src/main/java/io/legato/kazusa/utils/ContextExtensions.kt index 8804513d6..c1171f9c9 100644 --- a/app/src/main/java/io/legato/kazusa/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legato/kazusa/utils/ContextExtensions.kt @@ -437,5 +437,10 @@ val Context.bookshelfLayoutGrid: Int fun Context.themeColor(attr: Int): Int { val typedValue = TypedValue() theme.resolveAttribute(attr, typedValue, true) - return ContextCompat.getColor(this, typedValue.resourceId) + return if (typedValue.resourceId != 0) { + ContextCompat.getColor(this, typedValue.resourceId) + } else { + typedValue.data + } } + diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index fd4a0c3e6..29a7e2623 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -13,8 +13,8 @@ \ No newline at end of file