Merge "Make taps on the row toggle switches"

This commit is contained in:
TreeHugger Robot
2019-11-22 18:26:37 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 2 deletions

View File

@@ -46,7 +46,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:orientation="horizontal" >
android:orientation="horizontal"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground" >
<ImageView
android:id="@+id/icon"

View File

@@ -20,7 +20,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:orientation="horizontal" >
android:clickable="true"
android:orientation="horizontal"
android:foreground="?android:attr/selectableItemBackground" >
<!-- This is where an icon would go *if we wanted one* **wink** -->
<Space

View File

@@ -129,6 +129,8 @@ class AppControlView(c: Context, attrs: AttributeSet) : LinearLayout(c, attrs) {
iconView = findViewById(R.id.icon)
channelName = findViewById(R.id.app_name)
switch = findViewById(R.id.toggle)
setOnClickListener { switch.toggle() }
}
}
@@ -156,6 +158,7 @@ class ChannelRow(c: Context, attrs: AttributeSet) : LinearLayout(c, attrs) {
controller.proposeEditForChannel(it, if (b) it.importance else IMPORTANCE_NONE)
}
}
setOnClickListener { switch.toggle() }
}
private fun updateViews() {