修复翻页模式选择颜色问题

pull/332/head
gedoor 4 years ago
parent bb9e22f870
commit 72715eddbf
  1. 16
      app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt

@ -34,7 +34,6 @@ class ATERadioNoButton(context: Context, attrs: AttributeSet) :
isBottomBackground -> { isBottomBackground -> {
val isLight = ColorUtils.isColorLight(context.bottomBackground) val isLight = ColorUtils.isColorLight(context.bottomBackground)
val textColor = context.getPrimaryTextColor(isLight) val textColor = context.getPrimaryTextColor(isLight)
setTextColor(textColor)
background = Selector.shapeBuild() background = Selector.shapeBuild()
.setCornerRadius(2.dp) .setCornerRadius(2.dp)
.setStrokeWidth(2.dp) .setStrokeWidth(2.dp)
@ -42,15 +41,28 @@ class ATERadioNoButton(context: Context, attrs: AttributeSet) :
.setCheckedStrokeColor(context.accentColor) .setCheckedStrokeColor(context.accentColor)
.setDefaultStrokeColor(textColor) .setDefaultStrokeColor(textColor)
.create() .create()
setTextColor(
Selector.colorBuild()
.setDefaultColor(textColor)
.setCheckedColor(context.getPrimaryTextColor(ColorUtils.isColorLight(context.accentColor)))
.create()
)
} }
else -> { else -> {
val textColor = context.getCompatColor(R.color.primaryText)
background = Selector.shapeBuild() background = Selector.shapeBuild()
.setCornerRadius(2.dp) .setCornerRadius(2.dp)
.setStrokeWidth(2.dp) .setStrokeWidth(2.dp)
.setCheckedBgColor(context.accentColor) .setCheckedBgColor(context.accentColor)
.setCheckedStrokeColor(context.accentColor) .setCheckedStrokeColor(context.accentColor)
.setDefaultStrokeColor(context.getCompatColor(R.color.primaryText)) .setDefaultStrokeColor(textColor)
.create() .create()
setTextColor(
Selector.colorBuild()
.setDefaultColor(textColor)
.setCheckedColor(context.getPrimaryTextColor(ColorUtils.isColorLight(context.accentColor)))
.create()
)
} }
} }

Loading…
Cancel
Save