From 57ef8d9b73a87a4892c5f76d9e3dd3cf9cd767af Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 15 Oct 2021 08:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/lib/theme/MaterialValueHelper.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/MaterialValueHelper.kt b/app/src/main/java/io/legado/app/lib/theme/MaterialValueHelper.kt index 47e0bf162..6b7f6f304 100644 --- a/app/src/main/java/io/legado/app/lib/theme/MaterialValueHelper.kt +++ b/app/src/main/java/io/legado/app/lib/theme/MaterialValueHelper.kt @@ -2,7 +2,6 @@ package io.legado.app.lib.theme -import android.annotation.SuppressLint import android.content.Context import android.graphics.drawable.GradientDrawable import androidx.annotation.ColorInt @@ -15,7 +14,6 @@ import io.legado.app.utils.dp /** * @author Karim Abou Zeid (kabouzeid) */ -@SuppressLint("PrivateResource") @ColorInt fun Context.getPrimaryTextColor(dark: Boolean): Int { return if (dark) { @@ -23,28 +21,31 @@ fun Context.getPrimaryTextColor(dark: Boolean): Int { } else ContextCompat.getColor(this, R.color.primary_text_default_material_dark) } -@SuppressLint("PrivateResource") @ColorInt fun Context.getSecondaryTextColor(dark: Boolean): Int { return if (dark) { ContextCompat.getColor(this, R.color.secondary_text_default_material_light) - } else ContextCompat.getColor(this, R.color.secondary_text_default_material_dark) + } else { + ContextCompat.getColor(this, R.color.secondary_text_default_material_dark) + } } -@SuppressLint("PrivateResource") @ColorInt fun Context.getPrimaryDisabledTextColor(dark: Boolean): Int { return if (dark) { ContextCompat.getColor(this, R.color.primary_text_disabled_material_light) - } else ContextCompat.getColor(this, R.color.primary_text_disabled_material_dark) + } else { + ContextCompat.getColor(this, R.color.primary_text_disabled_material_dark) + } } -@SuppressLint("PrivateResource") @ColorInt fun Context.getSecondaryDisabledTextColor(dark: Boolean): Int { return if (dark) { ContextCompat.getColor(this, R.color.secondary_text_disabled_material_light) - } else ContextCompat.getColor(this, R.color.secondary_text_disabled_material_dark) + } else { + ContextCompat.getColor(this, R.color.secondary_text_disabled_material_dark) + } } val Context.primaryColor: Int