优化强调色和文字颜色一样是文字颜色的显示
This commit is contained in:
@@ -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()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user