Fix boosts buttons in RTL.

fork-5.53.8
Cody Henthorne 2021-11-22 20:58:31 -05:00 zatwierdzone przez Greyson Parrelli
rodzic 511abd67c6
commit 061b87ead0
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -122,6 +122,15 @@ data class Boost(
private val boost6: MaterialButton = itemView.findViewById(R.id.boost_6)
private val custom: AppCompatEditText = itemView.findViewById(R.id.boost_custom)
private val boostButtons: List<MaterialButton>
get() {
return if (ViewUtil.isLtr(context)) {
listOf(boost1, boost2, boost3, boost4, boost5, boost6)
} else {
listOf(boost3, boost2, boost1, boost6, boost5, boost4)
}
}
private var filter: MoneyFilter? = null
init {
@ -131,7 +140,7 @@ data class Boost(
override fun bind(model: SelectionModel) {
itemView.isEnabled = model.isEnabled
model.boosts.zip(listOf(boost1, boost2, boost3, boost4, boost5, boost6)).forEach { (boost, button) ->
model.boosts.zip(boostButtons).forEach { (boost, button) ->
button.isSelected = boost == model.selectedBoost && !model.isCustomAmountFocused
button.text = FiatMoneyUtil.format(
context.resources,