Loading packages/SystemUI/res/values/flags.xml +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ <bool name="flag_lockscreen_animations">false</bool> <bool name="flag_toast_style">false</bool> <bool name="flag_navigation_bar_overlay">false</bool> </resources> packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java +8 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.FeatureFlags; import java.util.function.Consumer; Loading @@ -31,16 +32,22 @@ import javax.inject.Inject; public class NavigationBarOverlayController { protected final Context mContext; protected final FeatureFlags mFeatureFlags; @Inject public NavigationBarOverlayController(Context context) { public NavigationBarOverlayController(Context context, FeatureFlags featureFlags) { mContext = context; mFeatureFlags = featureFlags; } public Context getContext() { return mContext; } public boolean isNavigationBarOverlayEnabled() { return mFeatureFlags.isNavigationBarOverlayEnabled(); } /** * Initialize the controller with visibility change callback and light/dark icon color. */ Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java +1 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ public final class NavigationBarTransitions extends BarTransitions implements buttonDispatchers.valueAt(i).setDarkIntensity(darkIntensity); } mView.getRotationButtonController().setDarkIntensity(darkIntensity); Dependency.get(NavigationBarOverlayController.class).setDarkIntensity(darkIntensity); for (DarkIntensityListener listener : mDarkIntensityListeners) { listener.onDarkIntensity(darkIntensity); Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +22 −11 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ public class NavigationBarView extends FrameLayout implements private NotificationPanelViewController mPanelView; private FloatingRotationButton mFloatingRotationButton; private RotationButtonController mRotationButtonController; private NavigationBarOverlayController mNavBarOverlayController; /** * Helper that is responsible for showing the right toast when a disallowed activity operation Loading Loading @@ -339,8 +340,11 @@ public class NavigationBarView extends FrameLayout implements isGesturalMode ? mFloatingRotationButton : rotateSuggestionButton, mRotationButtonListener); Dependency.get(NavigationBarOverlayController.class).init( mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init( mNavbarOverlayVisibilityChangeCallback, mLightIconColor, mDarkIconColor); } mConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); Loading Loading @@ -431,8 +435,9 @@ public class NavigationBarView extends FrameLayout implements // The visibility of the navigation bar buttons is dependent on the transient state of // the navigation bar. Dependency.get(NavigationBarOverlayController.class).setButtonState( isTransient, /* force */ false); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.setButtonState(isTransient, /* force */ false); } } void onBarTransition(int newMode) { Loading Loading @@ -666,7 +671,9 @@ public class NavigationBarView extends FrameLayout implements } mImeVisible = visible; mRotationButtonController.getRotationButton().setCanShowRotationButton(!mImeVisible); Dependency.get(NavigationBarOverlayController.class).setCanShow(!mImeVisible); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.setCanShow(!mImeVisible); } } public void setDisabledFlags(int disabledFlags) { Loading Loading @@ -999,10 +1006,9 @@ public class NavigationBarView extends FrameLayout implements } else { updateButtonLocation(getRotateSuggestionButton(), inScreenSpace); } final NavigationBarOverlayController navBarButtonsController = Dependency.get(NavigationBarOverlayController.class); if (navBarButtonsController.isVisible()) { updateButtonLocation(navBarButtonsController.getCurrentView(), inScreenSpace); if (mNavBarOverlayController.isNavigationBarOverlayEnabled() && mNavBarOverlayController.isVisible()) { updateButtonLocation(mNavBarOverlayController.getCurrentView(), inScreenSpace); } return mTmpRegion; } Loading Loading @@ -1230,7 +1236,9 @@ public class NavigationBarView extends FrameLayout implements if (mRotationButtonController != null) { mRotationButtonController.registerListeners(); } Dependency.get(NavigationBarOverlayController.class).registerListeners(); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.registerListeners(); } getViewTreeObserver().addOnComputeInternalInsetsListener(mOnComputeInternalInsetsListener); updateNavButtonIcons(); Loading @@ -1247,7 +1255,10 @@ public class NavigationBarView extends FrameLayout implements if (mRotationButtonController != null) { mRotationButtonController.unregisterListeners(); } Dependency.get(NavigationBarOverlayController.class).unregisterListeners(); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.unregisterListeners(); } mEdgeBackGestureHandler.onNavBarDetached(); getViewTreeObserver().removeOnComputeInternalInsetsListener( Loading packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,8 @@ public class FeatureFlags { public boolean isMonetEnabled() { return mFlagReader.isEnabled(R.bool.flag_monet); } public boolean isNavigationBarOverlayEnabled() { return mFlagReader.isEnabled(R.bool.flag_navigation_bar_overlay); } } Loading
packages/SystemUI/res/values/flags.xml +2 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,6 @@ <bool name="flag_lockscreen_animations">false</bool> <bool name="flag_toast_style">false</bool> <bool name="flag_navigation_bar_overlay">false</bool> </resources>
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java +8 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.FeatureFlags; import java.util.function.Consumer; Loading @@ -31,16 +32,22 @@ import javax.inject.Inject; public class NavigationBarOverlayController { protected final Context mContext; protected final FeatureFlags mFeatureFlags; @Inject public NavigationBarOverlayController(Context context) { public NavigationBarOverlayController(Context context, FeatureFlags featureFlags) { mContext = context; mFeatureFlags = featureFlags; } public Context getContext() { return mContext; } public boolean isNavigationBarOverlayEnabled() { return mFeatureFlags.isNavigationBarOverlayEnabled(); } /** * Initialize the controller with visibility change callback and light/dark icon color. */ Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarTransitions.java +1 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ public final class NavigationBarTransitions extends BarTransitions implements buttonDispatchers.valueAt(i).setDarkIntensity(darkIntensity); } mView.getRotationButtonController().setDarkIntensity(darkIntensity); Dependency.get(NavigationBarOverlayController.class).setDarkIntensity(darkIntensity); for (DarkIntensityListener listener : mDarkIntensityListeners) { listener.onDarkIntensity(darkIntensity); Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +22 −11 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ public class NavigationBarView extends FrameLayout implements private NotificationPanelViewController mPanelView; private FloatingRotationButton mFloatingRotationButton; private RotationButtonController mRotationButtonController; private NavigationBarOverlayController mNavBarOverlayController; /** * Helper that is responsible for showing the right toast when a disallowed activity operation Loading Loading @@ -339,8 +340,11 @@ public class NavigationBarView extends FrameLayout implements isGesturalMode ? mFloatingRotationButton : rotateSuggestionButton, mRotationButtonListener); Dependency.get(NavigationBarOverlayController.class).init( mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.init( mNavbarOverlayVisibilityChangeCallback, mLightIconColor, mDarkIconColor); } mConfiguration = new Configuration(); mTmpLastConfiguration = new Configuration(); Loading Loading @@ -431,8 +435,9 @@ public class NavigationBarView extends FrameLayout implements // The visibility of the navigation bar buttons is dependent on the transient state of // the navigation bar. Dependency.get(NavigationBarOverlayController.class).setButtonState( isTransient, /* force */ false); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.setButtonState(isTransient, /* force */ false); } } void onBarTransition(int newMode) { Loading Loading @@ -666,7 +671,9 @@ public class NavigationBarView extends FrameLayout implements } mImeVisible = visible; mRotationButtonController.getRotationButton().setCanShowRotationButton(!mImeVisible); Dependency.get(NavigationBarOverlayController.class).setCanShow(!mImeVisible); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.setCanShow(!mImeVisible); } } public void setDisabledFlags(int disabledFlags) { Loading Loading @@ -999,10 +1006,9 @@ public class NavigationBarView extends FrameLayout implements } else { updateButtonLocation(getRotateSuggestionButton(), inScreenSpace); } final NavigationBarOverlayController navBarButtonsController = Dependency.get(NavigationBarOverlayController.class); if (navBarButtonsController.isVisible()) { updateButtonLocation(navBarButtonsController.getCurrentView(), inScreenSpace); if (mNavBarOverlayController.isNavigationBarOverlayEnabled() && mNavBarOverlayController.isVisible()) { updateButtonLocation(mNavBarOverlayController.getCurrentView(), inScreenSpace); } return mTmpRegion; } Loading Loading @@ -1230,7 +1236,9 @@ public class NavigationBarView extends FrameLayout implements if (mRotationButtonController != null) { mRotationButtonController.registerListeners(); } Dependency.get(NavigationBarOverlayController.class).registerListeners(); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.registerListeners(); } getViewTreeObserver().addOnComputeInternalInsetsListener(mOnComputeInternalInsetsListener); updateNavButtonIcons(); Loading @@ -1247,7 +1255,10 @@ public class NavigationBarView extends FrameLayout implements if (mRotationButtonController != null) { mRotationButtonController.unregisterListeners(); } Dependency.get(NavigationBarOverlayController.class).unregisterListeners(); if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) { mNavBarOverlayController.unregisterListeners(); } mEdgeBackGestureHandler.onNavBarDetached(); getViewTreeObserver().removeOnComputeInternalInsetsListener( Loading
packages/SystemUI/src/com/android/systemui/statusbar/FeatureFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,4 +82,8 @@ public class FeatureFlags { public boolean isMonetEnabled() { return mFlagReader.isEnabled(R.bool.flag_monet); } public boolean isNavigationBarOverlayEnabled() { return mFlagReader.isEnabled(R.bool.flag_navigation_bar_overlay); } }