From c45aa72e4db7065b848ae919d8cc7b6e90dbba37 Mon Sep 17 00:00:00 2001 From: Shalika Pathirathna Date: Wed, 9 May 2018 14:21:59 +0900 Subject: Fix preview image overlaps a call button during video call If a device supports hiding the navigation bar and it is enabled, preview image overlaps a call button during video call. Because the preview layout doesn't care about the visibility of the navigation bar. To fix the problem, use APIs of WindowInsets that care about the visibility of the navigation bar. Bug: 80376182 Test: manual - Checked the preview image doesn't overlap a call button when the navigation bar is not visible. Change-Id: I72c9d504f0485c24a6be09a50869a8248745623f --- java/com/android/incallui/video/impl/VideoCallFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index 11b80ceb9..901facb01 100644 --- a/java/com/android/incallui/video/impl/VideoCallFragment.java +++ b/java/com/android/incallui/video/impl/VideoCallFragment.java @@ -541,13 +541,13 @@ public class VideoCallFragment extends Fragment return new Point(); } if (isLandscape()) { - int stableInsetEnd = + int systemWindowInsetEnd = getView().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL - ? getView().getRootWindowInsets().getStableInsetLeft() - : -getView().getRootWindowInsets().getStableInsetRight(); - return new Point(stableInsetEnd, 0); + ? getView().getRootWindowInsets().getSystemWindowInsetLeft() + : -getView().getRootWindowInsets().getSystemWindowInsetRight(); + return new Point(systemWindowInsetEnd, 0); } else { - return new Point(0, -getView().getRootWindowInsets().getStableInsetBottom()); + return new Point(0, -getView().getRootWindowInsets().getSystemWindowInsetBottom()); } } -- cgit v1.2.3