Set callback for the color background in the tile

When the background of the tile changes from no ripple
(colorBackgroundDrawable) to ripple (mRipple), it sets the callback in
colorBackgroundDrawable to null. Need to make sure it's set back to the
RippleDrawable.

Test: manual
Fixes: 183888161
Change-Id: I7282296ca54e6f7d6ee5bec8dfbb5f6b0d1e12b0
This commit is contained in:
Fabian Kozynski
2021-04-07 17:48:56 -04:00
parent 2a29cb2584
commit 0f69d9608f

View File

@@ -118,7 +118,11 @@ open class QSTileViewHorizontal(
override fun setClickable(clickable: Boolean) {
super.setClickable(clickable)
background = if (clickable && mShowRippleEffect) {
mTileBackground
mRipple?.also {
// In case that the colorBackgroundDrawable was used as the background, make sure
// it has the correct callback instead of null
colorBackgroundDrawable?.callback = it
}
} else {
colorBackgroundDrawable
}