Remove redundant highlight on add poll option button.
This commit is contained in:
parent
4438d513a2
commit
7e182ed662
|
@ -0,0 +1 @@
|
||||||
|
Remove redundant highlight on add poll option button
|
|
@ -15,10 +15,12 @@
|
||||||
*/
|
*/
|
||||||
package im.vector.app.core.ui.list
|
package im.vector.app.core.ui.list
|
||||||
|
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.Typeface
|
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 +57,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 +75,9 @@ 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) ColorStateList.valueOf(ThemeUtils.getColor(holder.view.context, R.attr.colorSecondary)) else
|
||||||
|
ContextCompat.getColorStateList(holder.view.context, android.R.color.transparent)
|
||||||
|
|
||||||
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