Skip to content

Commit

Permalink
[ADVSEG-7648] End icon not clearing (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlepinski authored Dec 5, 2024
1 parent 9a9a45d commit dbba059
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ internal class TextInputView(
default = model.viewInfo.iconEnd
)

val errorDrawable = when (resolved) {
val endDrawable = when (resolved) {
is TextInputInfo.IconEnd.Floating ->
resolved.icon.getDrawable(context, isEnabled)
else -> null
}

errorDrawable?.let {
val size = spToPx(context, model.viewInfo.textAppearance.fontSize).toInt()
endDrawable?.let {
val size = spToPx(context, model.viewInfo.textAppearance.fontSize).toInt()
it.setBounds(0, 0, size, size)
}

if (isLayoutRtl) {
setCompoundDrawables(it, null, null, null)
} else {
setCompoundDrawables(null, null, it, null)
}
if (isLayoutRtl) {
setCompoundDrawables(endDrawable, null, null, null)
} else {
setCompoundDrawables(null, null, endDrawable, null)
}
}
}
Expand Down

0 comments on commit dbba059

Please sign in to comment.