Merge "Update nav bar insets when in extractView" into udc-dev

This commit is contained in:
Cosmin Băieș
2023-05-23 10:07:54 +00:00
committed by Android (Google) Code Review

View File

@@ -246,8 +246,7 @@ final class NavigationBarController {
@Override @Override
public void updateTouchableInsets(@NonNull InputMethodService.Insets originalInsets, public void updateTouchableInsets(@NonNull InputMethodService.Insets originalInsets,
@NonNull ViewTreeObserver.InternalInsetsInfo dest) { @NonNull ViewTreeObserver.InternalInsetsInfo dest) {
if (!mImeDrawsImeNavBar || mNavigationBarFrame == null if (!mImeDrawsImeNavBar || mNavigationBarFrame == null) {
|| mService.isExtractViewShown()) {
return; return;
} }
@@ -255,6 +254,10 @@ final class NavigationBarController {
if (systemInsets != null) { if (systemInsets != null) {
final Window window = mService.mWindow.getWindow(); final Window window = mService.mWindow.getWindow();
final View decor = window.getDecorView(); final View decor = window.getDecorView();
// If the extract view is shown, everything is touchable, so no need to update
// touchable insets, but we still update normal insets below.
if (!mService.isExtractViewShown()) {
Region touchableRegion = null; Region touchableRegion = null;
final View inputFrame = mService.mInputFrame; final View inputFrame = mService.mInputFrame;
switch (originalInsets.touchableInsets) { switch (originalInsets.touchableInsets) {
@@ -302,6 +305,7 @@ final class NavigationBarController {
dest.touchableRegion.set(touchableRegion); dest.touchableRegion.set(touchableRegion);
dest.setTouchableInsets( dest.setTouchableInsets(
ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION); ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
}
// TODO(b/215443343): See if we can use View#OnLayoutChangeListener(). // TODO(b/215443343): See if we can use View#OnLayoutChangeListener().
// TODO(b/215443343): See if we can replace DecorView#mNavigationColorViewState.view // TODO(b/215443343): See if we can replace DecorView#mNavigationColorViewState.view