Merge pull request #5179 from vector-im/feature/ons/fix_poll_option_animation
Remove redundant highlight on add poll option button
This commit is contained in:
commit
e71063222b
|
@ -0,0 +1 @@
|
||||||
|
Remove redundant highlight on add poll option button
|
|
@ -19,6 +19,7 @@ import android.graphics.Typeface
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import com.airbnb.epoxy.EpoxyAttribute
|
import com.airbnb.epoxy.EpoxyAttribute
|
||||||
import com.airbnb.epoxy.EpoxyModelClass
|
import com.airbnb.epoxy.EpoxyModelClass
|
||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
|
@ -55,6 +56,9 @@ abstract class GenericButtonItem : VectorEpoxyModel<GenericButtonItem.Holder>()
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var bold: Boolean = false
|
var bold: Boolean = false
|
||||||
|
|
||||||
|
@EpoxyAttribute
|
||||||
|
var highlight: Boolean = true
|
||||||
|
|
||||||
override fun bind(holder: Holder) {
|
override fun bind(holder: Holder) {
|
||||||
super.bind(holder)
|
super.bind(holder)
|
||||||
holder.button.text = text
|
holder.button.text = text
|
||||||
|
@ -70,6 +74,12 @@ abstract class GenericButtonItem : VectorEpoxyModel<GenericButtonItem.Holder>()
|
||||||
val textStyle = if (bold) Typeface.BOLD else Typeface.NORMAL
|
val textStyle = if (bold) Typeface.BOLD else Typeface.NORMAL
|
||||||
holder.button.setTypeface(null, textStyle)
|
holder.button.setTypeface(null, textStyle)
|
||||||
|
|
||||||
|
holder.button.rippleColor = if (highlight) {
|
||||||
|
ContextCompat.getColorStateList(holder.view.context, R.color.mtrl_btn_text_btn_ripple_color)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
holder.button.onClick(buttonClickAction)
|
holder.button.onClick(buttonClickAction)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ class CreatePollController @Inject constructor(
|
||||||
textColor(host.colorProvider.getColor(R.color.palette_element_green))
|
textColor(host.colorProvider.getColor(R.color.palette_element_green))
|
||||||
gravity(Gravity.START)
|
gravity(Gravity.START)
|
||||||
bold(true)
|
bold(true)
|
||||||
|
highlight(false)
|
||||||
buttonClickAction {
|
buttonClickAction {
|
||||||
host.callback?.onAddOption()
|
host.callback?.onAddOption()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue