From 72715eddbf039a6b95a26b7564cf0e63d9f11a98 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 24 Aug 2020 18:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BF=BB=E9=A1=B5=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E6=8B=A9=E9=A2=9C=E8=89=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/lib/theme/view/ATERadioNoButton.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt index 0a93266b6..1b6731098 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt @@ -34,7 +34,6 @@ class ATERadioNoButton(context: Context, attrs: AttributeSet) : isBottomBackground -> { val isLight = ColorUtils.isColorLight(context.bottomBackground) val textColor = context.getPrimaryTextColor(isLight) - setTextColor(textColor) background = Selector.shapeBuild() .setCornerRadius(2.dp) .setStrokeWidth(2.dp) @@ -42,15 +41,28 @@ class ATERadioNoButton(context: Context, attrs: AttributeSet) : .setCheckedStrokeColor(context.accentColor) .setDefaultStrokeColor(textColor) .create() + setTextColor( + Selector.colorBuild() + .setDefaultColor(textColor) + .setCheckedColor(context.getPrimaryTextColor(ColorUtils.isColorLight(context.accentColor))) + .create() + ) } else -> { + val textColor = context.getCompatColor(R.color.primaryText) background = Selector.shapeBuild() .setCornerRadius(2.dp) .setStrokeWidth(2.dp) .setCheckedBgColor(context.accentColor) .setCheckedStrokeColor(context.accentColor) - .setDefaultStrokeColor(context.getCompatColor(R.color.primaryText)) + .setDefaultStrokeColor(textColor) .create() + setTextColor( + Selector.colorBuild() + .setDefaultColor(textColor) + .setCheckedColor(context.getPrimaryTextColor(ColorUtils.isColorLight(context.accentColor))) + .create() + ) } }