fix(QuickSwitch): NSME on InsetsState
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
1 parent
babe53bf2d
commit
2bc605058a
1 file changed
+19
-7
@@ -56,14 +56,26 @@ class HomeVisibilityState {
|
||||
override fun onDisplayInsetsChanged(insetsState: InsetsState) {
|
||||
val displayFrame = insetsState.displayFrame
|
||||
val bottomInset =
|
||||
insetsState
|
||||
.calculateInsets(
|
||||
displayFrame,
|
||||
displayFrame,
|
||||
WindowInsets.Type.navigationBars(),
|
||||
false,
|
||||
if (Utilities.ATLEAST_BAKLAVA_1) {
|
||||
insetsState
|
||||
.calculateInsets(
|
||||
displayFrame,
|
||||
displayFrame,
|
||||
WindowInsets.Type.navigationBars(),
|
||||
false,
|
||||
)
|
||||
.bottom
|
||||
} else {
|
||||
// pE-TODO(QuickSwitch-Baklava): Investigate
|
||||
val method = InsetsState::class.java.getMethod(
|
||||
"calculateInsets",
|
||||
android.graphics.Rect::class.java,
|
||||
Integer.TYPE,
|
||||
java.lang.Boolean.TYPE
|
||||
)
|
||||
.bottom
|
||||
val insets = method.invoke(insetsState, displayFrame, WindowInsets.Type.navigationBars(), false) as android.graphics.Insets
|
||||
insets.bottom
|
||||
}
|
||||
navbarInsetPosition = displayFrame.bottom - bottomInset
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user