Update Nav Bar Attrs in onViewAttached

This is necessary because the EdgeBackGestureHandler will only be
enabled after the view is attached. If there's no other configuration
updates, the view may hold the wrong attrs due to disabled edge back
gesture handler.

This only causes bug when the system config updated a little but caused
nav bar recreation, e.g., dark mode settings change.

Bug: 262194023
Test: See the reproduce steps in the bug.
Change-Id: I8d47e161bf32bb6b5cc8ed560650ce05c396165e
This commit is contained in:
Yunfan Chen
2023-01-18 15:07:50 +09:00
parent 859bea2861
commit ea243019f4

View File

@@ -745,6 +745,7 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
setWindowVisible(isNavBarWindowVisible());
mView.setBehavior(mBehavior);
setNavBarMode(mNavBarMode);
repositionNavigationBar(mCurrentRotation);
mView.setUpdateActiveTouchRegionsCallback(
() -> mOverviewProxyService.onActiveNavBarRegionChanges(
getButtonLocations(