mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
HabitCardView: Fix confetti position in API 36+
This commit is contained in:
@@ -234,9 +234,15 @@ class HabitCardView(
|
|||||||
val containerLocation = IntArray(2)
|
val containerLocation = IntArray(2)
|
||||||
this.getLocationOnScreen(containerLocation)
|
this.getLocationOnScreen(containerLocation)
|
||||||
val relButtonLocation = getRelativeButtonLocation(timestamp)
|
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(
|
return PointF(
|
||||||
containerLocation[0].toFloat() + relButtonLocation.x,
|
containerLocation[0].toFloat() + relButtonLocation.x,
|
||||||
containerLocation[1].toFloat() - relButtonLocation.y
|
containerLocation[1].toFloat() + relButtonLocation.y - statusBarHeight
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user