HabitCardView: Fix confetti position in API 36+
This commit is contained in:
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…
Reference in New Issue
Block a user