优化强调色和文字颜色一样是文字颜色的显示

pull/1835/head
kunfei 3 years ago
parent d66cace0a7
commit b54029b9a7
  1. 9
      app/src/main/java/io/legado/app/ui/widget/text/AccentStrokeTextView.kt

@ -37,16 +37,21 @@ class AccentStrokeTextView(context: Context, attrs: AttributeSet) :
} else { } else {
context.getCompatColor(R.color.disabled) context.getCompatColor(R.color.disabled)
} }
val accentColor = if (isInEditMode) {
context.getCompatColor(R.color.accent)
} else {
ThemeStore.accentColor(context)
}
background = Selector.shapeBuild() background = Selector.shapeBuild()
.setCornerRadius(radius) .setCornerRadius(radius)
.setStrokeWidth(1.dpToPx()) .setStrokeWidth(1.dpToPx())
.setDisabledStrokeColor(disableColor) .setDisabledStrokeColor(disableColor)
.setDefaultStrokeColor(ThemeStore.accentColor(context)) .setDefaultStrokeColor(accentColor)
.setPressedBgColor(context.getCompatColor(R.color.transparent30)) .setPressedBgColor(context.getCompatColor(R.color.transparent30))
.create() .create()
setTextColor( setTextColor(
Selector.colorBuild() Selector.colorBuild()
.setDefaultColor(ThemeStore.accentColor(context)) .setDefaultColor(accentColor)
.setDisabledColor(disableColor) .setDisabledColor(disableColor)
.create() .create()
) )

Loading…
Cancel
Save