Skip to content
Snippets Groups Projects
Commit 2e67cf72 authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez Committed by Android (Google) Code Review
Browse files

Merge "Updating long-press effect dimensions after re-layouts." into main

parents b2ca6049 31267a62
No related branches found
No related tags found
No related merge requests found
......@@ -332,6 +332,21 @@ open class QSTileViewImpl @JvmOverloads constructor(
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
super.onLayout(changed, l, t, r, b)
updateHeight()
maybeUpdateLongPressEffectDimensions()
}
private fun maybeUpdateLongPressEffectDimensions() {
if (!isLongClickable || longPressEffect == null) return
val actualHeight = if (heightOverride != HeightOverrideable.NO_OVERRIDE) {
heightOverride
} else {
measuredHeight
}
initialLongPressProperties?.height = actualHeight.toFloat()
initialLongPressProperties?.width = measuredWidth.toFloat()
finalLongPressProperties?.height = LONG_PRESS_EFFECT_HEIGHT_SCALE * actualHeight
finalLongPressProperties?.width = LONG_PRESS_EFFECT_WIDTH_SCALE * measuredWidth
}
override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment