Fix reaction overlay shade with gesture nav.

fork-5.53.8
Rashad Sookram 2022-02-28 17:01:09 -05:00 zatwierdzone przez Alex Hart
rodzic f6cdf459bb
commit c27f5787fe
1 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -177,8 +177,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
bottomNavigationBarHeight = ViewUtil.getNavigationBarHeight(this);
}
boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
if (isLandscape) {
if (zeroNavigationBarHeightForConfiguration()) {
bottomNavigationBarHeight = 0;
}
@ -421,6 +420,20 @@ public final class ConversationReactionOverlay extends FrameLayout {
return bottomPanel.getHeight() + (emojiDrawer != null && emojiDrawer.getVisibility() == VISIBLE ? emojiDrawer.getHeight() : 0);
}
/**
* Returns true when the device is in a configuration where the navigation bar doesn't take up
* space at the bottom of the screen.
*/
private boolean zeroNavigationBarHeightForConfiguration() {
boolean isLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
if (Build.VERSION.SDK_INT >= 29) {
return getRootWindowInsets().getSystemGestureInsets().bottom == 0 && isLandscape;
} else {
return isLandscape;
}
}
@RequiresApi(api = 21)
private void updateSystemUiOnShow(@NonNull Activity activity) {
Window window = activity.getWindow();