Remove redundant highlight on add poll option button.

This commit is contained in:
Onuray Sahin 2022-02-07 17:35:26 +03:00
parent 4438d513a2
commit 7e182ed662
3 changed files with 10 additions and 0 deletions

1
changelog.d/5178.bugfix Normal file
View file

@ -0,0 +1 @@
Remove redundant highlight on add poll option button

View file

@ -15,10 +15,12 @@
*/
package im.vector.app.core.ui.list
import android.content.res.ColorStateList
import android.graphics.Typeface
import android.view.Gravity
import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes
import androidx.core.content.ContextCompat
import com.airbnb.epoxy.EpoxyAttribute
import com.airbnb.epoxy.EpoxyModelClass
import com.google.android.material.button.MaterialButton
@ -55,6 +57,9 @@ abstract class GenericButtonItem : VectorEpoxyModel<GenericButtonItem.Holder>()
@EpoxyAttribute
var bold: Boolean = false
@EpoxyAttribute
var highlight: Boolean = true
override fun bind(holder: Holder) {
super.bind(holder)
holder.button.text = text
@ -70,6 +75,9 @@ abstract class GenericButtonItem : VectorEpoxyModel<GenericButtonItem.Holder>()
val textStyle = if (bold) Typeface.BOLD else Typeface.NORMAL
holder.button.setTypeface(null, textStyle)
holder.button.rippleColor = if (highlight) ColorStateList.valueOf(ThemeUtils.getColor(holder.view.context, R.attr.colorSecondary)) else
ContextCompat.getColorStateList(holder.view.context, android.R.color.transparent)
holder.button.onClick(buttonClickAction)
}

View file

@ -121,6 +121,7 @@ class CreatePollController @Inject constructor(
textColor(host.colorProvider.getColor(R.color.palette_element_green))
gravity(Gravity.START)
bold(true)
highlight(false)
buttonClickAction {
host.callback?.onAddOption()
}