Make the whole cell clickable

This commit is contained in:
Benoit Marty 2020-01-21 15:48:35 +01:00
parent ef0b438a89
commit da9b9f4864
2 changed files with 7 additions and 0 deletions

View file

@ -44,6 +44,12 @@ abstract class FormSwitchItem : VectorEpoxyModel<FormSwitchItem.Holder>() {
var summary: String? = null
override fun bind(holder: Holder) {
holder.view.setOnClickListener {
if (enabled) {
holder.switchView.toggle()
}
}
holder.titleView.text = title
holder.summaryView.setTextOrHide(summary)

View file

@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?riotx_background"
android:foreground="?attr/selectableItemBackground"
android:minHeight="@dimen/item_form_min_height">
<TextView