HabitCardView: Fix confetti position in API 36+

pull/2128/head
Alinson S. Xavier 6 months ago
parent 45b100aad9
commit fa670b19b7

@ -234,9 +234,15 @@ class HabitCardView(
val containerLocation = IntArray(2)
this.getLocationOnScreen(containerLocation)
val relButtonLocation = getRelativeButtonLocation(timestamp)
val windowInsets = rootWindowInsets
val statusBarHeight = if (SDK_INT <= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
windowInsets?.systemWindowInsetTop ?: 0
} else {
0
}
return PointF(
containerLocation[0].toFloat() + relButtonLocation.x,
containerLocation[1].toFloat() - relButtonLocation.y
containerLocation[1].toFloat() + relButtonLocation.y - statusBarHeight
)
}

Loading…
Cancel
Save