mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Remove redundant highlight on add poll option button.
This commit is contained in:
parent
4438d513a2
commit
7e182ed662
3 changed files with 10 additions and 0 deletions
1
changelog.d/5178.bugfix
Normal file
1
changelog.d/5178.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Remove redundant highlight on add poll option button
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue