diff --git a/packages/SystemUI/res/drawable/control_background_ripple.xml b/packages/SystemUI/res/drawable/control_background_ripple.xml new file mode 100644 index 0000000000000..37914e2728117 --- /dev/null +++ b/packages/SystemUI/res/drawable/control_background_ripple.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index 6e1fd2072b328..b83e500fbaeb0 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -50,6 +50,7 @@ app:layout_constraintBottom_toBottomOf="@+id/icon" app:layout_constraintStart_toEndOf="@+id/icon" /> + + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@id/barrier"/> + + + /> - - - - - + app:layout_constraintBottom_toBottomOf="parent"/> diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlAdapter.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlAdapter.kt index 563c2f677801b..764fda05354cf 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlAdapter.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlAdapter.kt @@ -68,6 +68,8 @@ class ControlAdapter( width = ViewGroup.LayoutParams.MATCH_PARENT } elevation = this@ControlAdapter.elevation + background = parent.context.getDrawable( + R.drawable.control_background_ripple) } ) { id, favorite -> model?.changeFavoriteStatus(id, favorite) @@ -137,10 +139,7 @@ private class ControlHolder(view: View, val favoriteCallback: ModelFavoriteChang private val title: TextView = itemView.requireViewById(R.id.title) private val subtitle: TextView = itemView.requireViewById(R.id.subtitle) private val removed: TextView = itemView.requireViewById(R.id.status) - private val favorite: CheckBox = itemView.requireViewById(R.id.favorite) - private val favoriteFrame: ViewGroup = itemView - .requireViewById(R.id.favorite_container) - .apply { + private val favorite: CheckBox = itemView.requireViewById(R.id.favorite).apply { visibility = View.VISIBLE } @@ -155,7 +154,7 @@ private class ControlHolder(view: View, val favoriteCallback: ModelFavoriteChang favorite.setOnClickListener { favoriteCallback(data.control.controlId, favorite.isChecked) } - favoriteFrame.setOnClickListener { favorite.performClick() } + itemView.setOnClickListener { favorite.performClick() } applyRenderInfo(renderInfo) }