Loading core/java/android/inputmethodservice/NavigationBarController.java +40 −24 Original line number Diff line number Diff line Loading @@ -266,33 +266,49 @@ final class NavigationBarController { } final boolean insetChanged = !Objects.equals(systemInsets, mLastInsets); if (zOrderChanged || insetChanged) { final NavigationBarFrame that = mNavigationBarFrame; that.post(() -> { if (!that.isAttachedToWindow()) { scheduleRelayout(); } } } private void scheduleRelayout() { // Capture the current frame object in case the object is replaced or cleared later. final NavigationBarFrame frame = mNavigationBarFrame; frame.post(() -> { if (mDestroyed) { return; } if (!frame.isAttachedToWindow()) { return; } final Window window = mService.mWindow.getWindow(); if (window == null) { return; } final View decor = window.peekDecorView(); if (decor == null) { return; } if (!(decor instanceof ViewGroup)) { return; } final ViewGroup decorGroup = (ViewGroup) decor; final Insets currentSystemInsets = getSystemInsets(); if (!Objects.equals(currentSystemInsets, mLastInsets)) { that.setLayoutParams( new FrameLayout.LayoutParams( frame.setLayoutParams(new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, currentSystemInsets.bottom, Gravity.BOTTOM)); mLastInsets = currentSystemInsets; } if (decor instanceof ViewGroup) { ViewGroup decorGroup = (ViewGroup) decor; final View navbarBackgroundView = window.getNavigationBarBackgroundView(); if (navbarBackgroundView != null && decorGroup.indexOfChild(navbarBackgroundView) > decorGroup.indexOfChild(that)) { decorGroup.bringChildToFront(that); } > decorGroup.indexOfChild(frame)) { decorGroup.bringChildToFront(frame); } }); } } } private boolean isGesturalNavigationEnabled() { final Resources resources = mService.getResources(); Loading Loading
core/java/android/inputmethodservice/NavigationBarController.java +40 −24 Original line number Diff line number Diff line Loading @@ -266,33 +266,49 @@ final class NavigationBarController { } final boolean insetChanged = !Objects.equals(systemInsets, mLastInsets); if (zOrderChanged || insetChanged) { final NavigationBarFrame that = mNavigationBarFrame; that.post(() -> { if (!that.isAttachedToWindow()) { scheduleRelayout(); } } } private void scheduleRelayout() { // Capture the current frame object in case the object is replaced or cleared later. final NavigationBarFrame frame = mNavigationBarFrame; frame.post(() -> { if (mDestroyed) { return; } if (!frame.isAttachedToWindow()) { return; } final Window window = mService.mWindow.getWindow(); if (window == null) { return; } final View decor = window.peekDecorView(); if (decor == null) { return; } if (!(decor instanceof ViewGroup)) { return; } final ViewGroup decorGroup = (ViewGroup) decor; final Insets currentSystemInsets = getSystemInsets(); if (!Objects.equals(currentSystemInsets, mLastInsets)) { that.setLayoutParams( new FrameLayout.LayoutParams( frame.setLayoutParams(new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, currentSystemInsets.bottom, Gravity.BOTTOM)); mLastInsets = currentSystemInsets; } if (decor instanceof ViewGroup) { ViewGroup decorGroup = (ViewGroup) decor; final View navbarBackgroundView = window.getNavigationBarBackgroundView(); if (navbarBackgroundView != null && decorGroup.indexOfChild(navbarBackgroundView) > decorGroup.indexOfChild(that)) { decorGroup.bringChildToFront(that); } > decorGroup.indexOfChild(frame)) { decorGroup.bringChildToFront(frame); } }); } } } private boolean isGesturalNavigationEnabled() { final Resources resources = mService.getResources(); Loading