Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +48 −34 Original line number Original line Diff line number Diff line Loading @@ -195,9 +195,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final LifecycleRegistry mLifecycle = new LifecycleRegistry(this); private final LifecycleRegistry mLifecycle = new LifecycleRegistry(this); @VisibleForTesting @VisibleForTesting protected ArrayList<Action> mItems; protected final ArrayList<Action> mItems = new ArrayList<>(); @VisibleForTesting @VisibleForTesting protected ArrayList<Action> mOverflowItems; protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); private ActionsDialog mDialog; private ActionsDialog mDialog; Loading Loading @@ -453,12 +453,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, prepareDialog(); prepareDialog(); seedFavorites(); seedFavorites(); // If we only have 1 item and it's a simple press action, just do this action. if (mAdapter.getCount() == 1 && mAdapter.getItem(0) instanceof SinglePressAction && !(mAdapter.getItem(0) instanceof LongPressAction)) { ((SinglePressAction) mAdapter.getItem(0)).onPress(); } else { WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes(); WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes(); attrs.setTitle("ActionsDialog"); attrs.setTitle("ActionsDialog"); attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; Loading @@ -466,7 +460,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mDialog.show(); mDialog.show(); mWindowManagerFuncs.onGlobalActionsShown(); mWindowManagerFuncs.onGlobalActionsShown(); } } } @VisibleForTesting @VisibleForTesting protected boolean shouldShowAction(Action action) { protected boolean shouldShowAction(Action action) { Loading @@ -485,7 +478,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, */ */ @VisibleForTesting @VisibleForTesting protected int getMaxShownPowerItems() { protected int getMaxShownPowerItems() { if (shouldShowControls()) { if (shouldUseControlsLayout()) { return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns); return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns); } else { } else { return Integer.MAX_VALUE; return Integer.MAX_VALUE; Loading @@ -497,10 +490,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, * whether controls are enabled and whether the max number of shown items has been reached. * whether controls are enabled and whether the max number of shown items has been reached. */ */ private void addActionItem(Action action) { private void addActionItem(Action action) { if (mItems != null && shouldShowAction(action)) { if (shouldShowAction(action)) { if (mItems.size() < getMaxShownPowerItems()) { if (mItems.size() < getMaxShownPowerItems()) { mItems.add(action); mItems.add(action); } else if (mOverflowItems != null) { } else { mOverflowItems.add(action); mOverflowItems.add(action); } } } } Loading @@ -522,8 +515,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAirplaneModeOn = new AirplaneModeAction(); mAirplaneModeOn = new AirplaneModeAction(); onAirplaneModeChanged(); onAirplaneModeChanged(); mItems = new ArrayList<Action>(); mItems.clear(); mOverflowItems = new ArrayList<Action>(); mOverflowItems.clear(); String[] defaultActions = getDefaultActions(); String[] defaultActions = getDefaultActions(); // make sure emergency affordance action is first, if needed // make sure emergency affordance action is first, if needed Loading Loading @@ -588,6 +581,11 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } } } private void onRotate() { // re-allocate actions between main and overflow lists this.createActionItems(); } /** /** * Create the global actions dialog. * Create the global actions dialog. * * Loading @@ -599,11 +597,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAdapter = new MyAdapter(); mAdapter = new MyAdapter(); mOverflowAdapter = new MyOverflowAdapter(); mOverflowAdapter = new MyOverflowAdapter(); mDepthController.setShowingHomeControls(shouldShowControls()); mDepthController.setShowingHomeControls(shouldUseControlsLayout()); ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, getWalletPanelViewController(), mDepthController, mSysuiColorExtractor, getWalletPanelViewController(), mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, mStatusBarService, mNotificationShadeWindowController, shouldShowControls() ? mControlsUiController : null, mBlurUtils); shouldShowControls() ? mControlsUiController : null, mBlurUtils, shouldUseControlsLayout(), this::onRotate); dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. dialog.setKeyguardShowing(mKeyguardShowing); dialog.setKeyguardShowing(mKeyguardShowing); Loading Loading @@ -704,7 +703,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @Override @Override public boolean shouldBeSeparated() { public boolean shouldBeSeparated() { return !shouldShowControls(); return !shouldUseControlsLayout(); } } @Override @Override Loading @@ -712,7 +711,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, Context context, View convertView, ViewGroup parent, LayoutInflater inflater) { Context context, View convertView, ViewGroup parent, LayoutInflater inflater) { View v = super.create(context, convertView, parent, inflater); View v = super.create(context, convertView, parent, inflater); int textColor; int textColor; if (shouldShowControls()) { if (shouldUseControlsLayout()) { v.setBackgroundTintList(ColorStateList.valueOf(v.getResources().getColor( v.setBackgroundTintList(ColorStateList.valueOf(v.getResources().getColor( com.android.systemui.R.color.global_actions_emergency_background))); com.android.systemui.R.color.global_actions_emergency_background))); textColor = v.getResources().getColor( textColor = v.getResources().getColor( Loading Loading @@ -1152,7 +1151,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private int getActionLayoutId() { private int getActionLayoutId() { if (shouldShowControls()) { if (shouldUseControlsLayout()) { return com.android.systemui.R.layout.global_actions_grid_item_v2; return com.android.systemui.R.layout.global_actions_grid_item_v2; } } return com.android.systemui.R.layout.global_actions_grid_item; return com.android.systemui.R.layout.global_actions_grid_item; Loading Loading @@ -1275,12 +1274,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public class MyOverflowAdapter extends BaseAdapter { public class MyOverflowAdapter extends BaseAdapter { @Override @Override public int getCount() { public int getCount() { return mOverflowItems != null ? mOverflowItems.size() : 0; return mOverflowItems.size(); } } @Override @Override public Action getItem(int position) { public Action getItem(int position) { return mOverflowItems != null ? mOverflowItems.get(position) : null; return mOverflowItems.get(position); } } @Override @Override Loading Loading @@ -1888,7 +1887,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeDepthController mDepthController; private final NotificationShadeDepthController mDepthController; private final BlurUtils mBlurUtils; private final BlurUtils mBlurUtils; private final boolean mUseControlsLayout; private ListPopupWindow mOverflowPopup; private ListPopupWindow mOverflowPopup; private final Runnable mOnRotateCallback; private ControlsUiController mControlsUiController; private ControlsUiController mControlsUiController; private ViewGroup mControlsView; private ViewGroup mControlsView; Loading @@ -1898,7 +1899,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, NotificationShadeDepthController depthController, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, BlurUtils blurUtils) { ControlsUiController controlsUiController, BlurUtils blurUtils, boolean useControlsLayout, Runnable onRotateCallback) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); mContext = context; mContext = context; mAdapter = adapter; mAdapter = adapter; Loading @@ -1909,6 +1911,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mNotificationShadeWindowController = notificationShadeWindowController; mNotificationShadeWindowController = notificationShadeWindowController; mControlsUiController = controlsUiController; mControlsUiController = controlsUiController; mBlurUtils = blurUtils; mBlurUtils = blurUtils; mUseControlsLayout = useControlsLayout; mOnRotateCallback = onRotateCallback; // Window initialization // Window initialization Window window = getWindow(); Window window = getWindow(); Loading Loading @@ -2068,7 +2072,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } if (mBackgroundDrawable == null) { if (mBackgroundDrawable == null) { mBackgroundDrawable = new ScrimDrawable(); mBackgroundDrawable = new ScrimDrawable(); if (mControlsUiController != null) { if (mUseControlsLayout) { mScrimAlpha = 1.0f; mScrimAlpha = 1.0f; } else { } else { mScrimAlpha = mBlurUtils.supportsBlursOnWindows() mScrimAlpha = mBlurUtils.supportsBlursOnWindows() Loading @@ -2088,7 +2092,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private int getGlobalActionsLayoutId(Context context) { private int getGlobalActionsLayoutId(Context context) { if (mControlsUiController != null) { if (mUseControlsLayout) { return com.android.systemui.R.layout.global_actions_grid_v2; return com.android.systemui.R.layout.global_actions_grid_v2; } } Loading Loading @@ -2133,9 +2137,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (!(mBackgroundDrawable instanceof ScrimDrawable)) { if (!(mBackgroundDrawable instanceof ScrimDrawable)) { return; return; } } boolean hasControls = mControlsUiController != null; ((ScrimDrawable) mBackgroundDrawable).setColor( ((ScrimDrawable) mBackgroundDrawable).setColor( !hasControls && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate); !mUseControlsLayout && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate); View decorView = getWindow().getDecorView(); View decorView = getWindow().getDecorView(); if (colors.supportsDarkText()) { if (colors.supportsDarkText()) { decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | Loading Loading @@ -2177,7 +2181,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, .start(); .start(); ViewGroup root = (ViewGroup) mGlobalActionsLayout.getRootView(); ViewGroup root = (ViewGroup) mGlobalActionsLayout.getRootView(); root.setOnApplyWindowInsetsListener((v, windowInsets) -> { root.setOnApplyWindowInsetsListener((v, windowInsets) -> { if (mControlsUiController != null) { if (mUseControlsLayout) { root.setPadding(windowInsets.getStableInsetLeft(), root.setPadding(windowInsets.getStableInsetLeft(), windowInsets.getStableInsetTop(), windowInsets.getStableInsetTop(), windowInsets.getStableInsetRight(), windowInsets.getStableInsetRight(), Loading Loading @@ -2281,10 +2285,14 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public void refreshDialog() { public void refreshDialog() { initializeLayout(); initializeLayout(); mGlobalActionsLayout.updateList(); mGlobalActionsLayout.updateList(); if (mControlsUiController != null) { mControlsUiController.show(mControlsView); } } } public void onRotate(int from, int to) { public void onRotate(int from, int to) { if (mShowing) { if (mShowing) { mOnRotateCallback.run(); refreshDialog(); refreshDialog(); } } } } Loading Loading @@ -2317,4 +2325,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, && mControlsUiController.getAvailable() && mControlsUiController.getAvailable() && !mControlsServiceInfos.isEmpty(); && !mControlsServiceInfos.isEmpty(); } } // TODO: Remove legacy layout XML and classes. protected boolean shouldUseControlsLayout() { // always use new controls layout return true; } } } No newline at end of file Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +48 −34 Original line number Original line Diff line number Diff line Loading @@ -195,9 +195,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final LifecycleRegistry mLifecycle = new LifecycleRegistry(this); private final LifecycleRegistry mLifecycle = new LifecycleRegistry(this); @VisibleForTesting @VisibleForTesting protected ArrayList<Action> mItems; protected final ArrayList<Action> mItems = new ArrayList<>(); @VisibleForTesting @VisibleForTesting protected ArrayList<Action> mOverflowItems; protected final ArrayList<Action> mOverflowItems = new ArrayList<>(); private ActionsDialog mDialog; private ActionsDialog mDialog; Loading Loading @@ -453,12 +453,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, prepareDialog(); prepareDialog(); seedFavorites(); seedFavorites(); // If we only have 1 item and it's a simple press action, just do this action. if (mAdapter.getCount() == 1 && mAdapter.getItem(0) instanceof SinglePressAction && !(mAdapter.getItem(0) instanceof LongPressAction)) { ((SinglePressAction) mAdapter.getItem(0)).onPress(); } else { WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes(); WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes(); attrs.setTitle("ActionsDialog"); attrs.setTitle("ActionsDialog"); attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; attrs.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; Loading @@ -466,7 +460,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mDialog.show(); mDialog.show(); mWindowManagerFuncs.onGlobalActionsShown(); mWindowManagerFuncs.onGlobalActionsShown(); } } } @VisibleForTesting @VisibleForTesting protected boolean shouldShowAction(Action action) { protected boolean shouldShowAction(Action action) { Loading @@ -485,7 +478,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, */ */ @VisibleForTesting @VisibleForTesting protected int getMaxShownPowerItems() { protected int getMaxShownPowerItems() { if (shouldShowControls()) { if (shouldUseControlsLayout()) { return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns); return mResources.getInteger(com.android.systemui.R.integer.power_menu_max_columns); } else { } else { return Integer.MAX_VALUE; return Integer.MAX_VALUE; Loading @@ -497,10 +490,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, * whether controls are enabled and whether the max number of shown items has been reached. * whether controls are enabled and whether the max number of shown items has been reached. */ */ private void addActionItem(Action action) { private void addActionItem(Action action) { if (mItems != null && shouldShowAction(action)) { if (shouldShowAction(action)) { if (mItems.size() < getMaxShownPowerItems()) { if (mItems.size() < getMaxShownPowerItems()) { mItems.add(action); mItems.add(action); } else if (mOverflowItems != null) { } else { mOverflowItems.add(action); mOverflowItems.add(action); } } } } Loading @@ -522,8 +515,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAirplaneModeOn = new AirplaneModeAction(); mAirplaneModeOn = new AirplaneModeAction(); onAirplaneModeChanged(); onAirplaneModeChanged(); mItems = new ArrayList<Action>(); mItems.clear(); mOverflowItems = new ArrayList<Action>(); mOverflowItems.clear(); String[] defaultActions = getDefaultActions(); String[] defaultActions = getDefaultActions(); // make sure emergency affordance action is first, if needed // make sure emergency affordance action is first, if needed Loading Loading @@ -588,6 +581,11 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } } } private void onRotate() { // re-allocate actions between main and overflow lists this.createActionItems(); } /** /** * Create the global actions dialog. * Create the global actions dialog. * * Loading @@ -599,11 +597,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAdapter = new MyAdapter(); mAdapter = new MyAdapter(); mOverflowAdapter = new MyOverflowAdapter(); mOverflowAdapter = new MyOverflowAdapter(); mDepthController.setShowingHomeControls(shouldShowControls()); mDepthController.setShowingHomeControls(shouldUseControlsLayout()); ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, mOverflowAdapter, getWalletPanelViewController(), mDepthController, mSysuiColorExtractor, getWalletPanelViewController(), mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, mStatusBarService, mNotificationShadeWindowController, shouldShowControls() ? mControlsUiController : null, mBlurUtils); shouldShowControls() ? mControlsUiController : null, mBlurUtils, shouldUseControlsLayout(), this::onRotate); dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. dialog.setKeyguardShowing(mKeyguardShowing); dialog.setKeyguardShowing(mKeyguardShowing); Loading Loading @@ -704,7 +703,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, @Override @Override public boolean shouldBeSeparated() { public boolean shouldBeSeparated() { return !shouldShowControls(); return !shouldUseControlsLayout(); } } @Override @Override Loading @@ -712,7 +711,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, Context context, View convertView, ViewGroup parent, LayoutInflater inflater) { Context context, View convertView, ViewGroup parent, LayoutInflater inflater) { View v = super.create(context, convertView, parent, inflater); View v = super.create(context, convertView, parent, inflater); int textColor; int textColor; if (shouldShowControls()) { if (shouldUseControlsLayout()) { v.setBackgroundTintList(ColorStateList.valueOf(v.getResources().getColor( v.setBackgroundTintList(ColorStateList.valueOf(v.getResources().getColor( com.android.systemui.R.color.global_actions_emergency_background))); com.android.systemui.R.color.global_actions_emergency_background))); textColor = v.getResources().getColor( textColor = v.getResources().getColor( Loading Loading @@ -1152,7 +1151,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private int getActionLayoutId() { private int getActionLayoutId() { if (shouldShowControls()) { if (shouldUseControlsLayout()) { return com.android.systemui.R.layout.global_actions_grid_item_v2; return com.android.systemui.R.layout.global_actions_grid_item_v2; } } return com.android.systemui.R.layout.global_actions_grid_item; return com.android.systemui.R.layout.global_actions_grid_item; Loading Loading @@ -1275,12 +1274,12 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public class MyOverflowAdapter extends BaseAdapter { public class MyOverflowAdapter extends BaseAdapter { @Override @Override public int getCount() { public int getCount() { return mOverflowItems != null ? mOverflowItems.size() : 0; return mOverflowItems.size(); } } @Override @Override public Action getItem(int position) { public Action getItem(int position) { return mOverflowItems != null ? mOverflowItems.get(position) : null; return mOverflowItems.get(position); } } @Override @Override Loading Loading @@ -1888,7 +1887,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeWindowController mNotificationShadeWindowController; private final NotificationShadeDepthController mDepthController; private final NotificationShadeDepthController mDepthController; private final BlurUtils mBlurUtils; private final BlurUtils mBlurUtils; private final boolean mUseControlsLayout; private ListPopupWindow mOverflowPopup; private ListPopupWindow mOverflowPopup; private final Runnable mOnRotateCallback; private ControlsUiController mControlsUiController; private ControlsUiController mControlsUiController; private ViewGroup mControlsView; private ViewGroup mControlsView; Loading @@ -1898,7 +1899,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, NotificationShadeDepthController depthController, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, BlurUtils blurUtils) { ControlsUiController controlsUiController, BlurUtils blurUtils, boolean useControlsLayout, Runnable onRotateCallback) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); mContext = context; mContext = context; mAdapter = adapter; mAdapter = adapter; Loading @@ -1909,6 +1911,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mNotificationShadeWindowController = notificationShadeWindowController; mNotificationShadeWindowController = notificationShadeWindowController; mControlsUiController = controlsUiController; mControlsUiController = controlsUiController; mBlurUtils = blurUtils; mBlurUtils = blurUtils; mUseControlsLayout = useControlsLayout; mOnRotateCallback = onRotateCallback; // Window initialization // Window initialization Window window = getWindow(); Window window = getWindow(); Loading Loading @@ -2068,7 +2072,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } if (mBackgroundDrawable == null) { if (mBackgroundDrawable == null) { mBackgroundDrawable = new ScrimDrawable(); mBackgroundDrawable = new ScrimDrawable(); if (mControlsUiController != null) { if (mUseControlsLayout) { mScrimAlpha = 1.0f; mScrimAlpha = 1.0f; } else { } else { mScrimAlpha = mBlurUtils.supportsBlursOnWindows() mScrimAlpha = mBlurUtils.supportsBlursOnWindows() Loading @@ -2088,7 +2092,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private int getGlobalActionsLayoutId(Context context) { private int getGlobalActionsLayoutId(Context context) { if (mControlsUiController != null) { if (mUseControlsLayout) { return com.android.systemui.R.layout.global_actions_grid_v2; return com.android.systemui.R.layout.global_actions_grid_v2; } } Loading Loading @@ -2133,9 +2137,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, if (!(mBackgroundDrawable instanceof ScrimDrawable)) { if (!(mBackgroundDrawable instanceof ScrimDrawable)) { return; return; } } boolean hasControls = mControlsUiController != null; ((ScrimDrawable) mBackgroundDrawable).setColor( ((ScrimDrawable) mBackgroundDrawable).setColor( !hasControls && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate); !mUseControlsLayout && colors.supportsDarkText() ? Color.WHITE : Color.BLACK, animate); View decorView = getWindow().getDecorView(); View decorView = getWindow().getDecorView(); if (colors.supportsDarkText()) { if (colors.supportsDarkText()) { decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR | Loading Loading @@ -2177,7 +2181,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, .start(); .start(); ViewGroup root = (ViewGroup) mGlobalActionsLayout.getRootView(); ViewGroup root = (ViewGroup) mGlobalActionsLayout.getRootView(); root.setOnApplyWindowInsetsListener((v, windowInsets) -> { root.setOnApplyWindowInsetsListener((v, windowInsets) -> { if (mControlsUiController != null) { if (mUseControlsLayout) { root.setPadding(windowInsets.getStableInsetLeft(), root.setPadding(windowInsets.getStableInsetLeft(), windowInsets.getStableInsetTop(), windowInsets.getStableInsetTop(), windowInsets.getStableInsetRight(), windowInsets.getStableInsetRight(), Loading Loading @@ -2281,10 +2285,14 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public void refreshDialog() { public void refreshDialog() { initializeLayout(); initializeLayout(); mGlobalActionsLayout.updateList(); mGlobalActionsLayout.updateList(); if (mControlsUiController != null) { mControlsUiController.show(mControlsView); } } } public void onRotate(int from, int to) { public void onRotate(int from, int to) { if (mShowing) { if (mShowing) { mOnRotateCallback.run(); refreshDialog(); refreshDialog(); } } } } Loading Loading @@ -2317,4 +2325,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, && mControlsUiController.getAvailable() && mControlsUiController.getAvailable() && !mControlsServiceInfos.isEmpty(); && !mControlsServiceInfos.isEmpty(); } } // TODO: Remove legacy layout XML and classes. protected boolean shouldUseControlsLayout() { // always use new controls layout return true; } } } No newline at end of file