Loading packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt +16 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.controls.CustomIconCache import com.android.systemui.controls.controller.ControlsControllerImpl import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.ui.ControlsDialog import com.android.systemui.controls.ui.ControlsUiController import com.android.systemui.globalactions.GlobalActionsComponent import com.android.systemui.settings.CurrentUserTracker import com.android.systemui.util.LifecycleActivity Loading @@ -42,9 +44,10 @@ import javax.inject.Inject */ class ControlsEditingActivity @Inject constructor( private val controller: ControlsControllerImpl, broadcastDispatcher: BroadcastDispatcher, private val broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent, private val customIconCache: CustomIconCache private val customIconCache: CustomIconCache, private val uiController: ControlsUiController ) : LifecycleActivity() { companion object { Loading @@ -59,6 +62,7 @@ class ControlsEditingActivity @Inject constructor( private lateinit var model: FavoritesModel private lateinit var subtitle: TextView private lateinit var saveButton: View private var backToGlobalActions = true private val currentUserTracker = object : CurrentUserTracker(broadcastDispatcher) { private val startingUser = controller.currentUserId Loading @@ -82,6 +86,11 @@ class ControlsEditingActivity @Inject constructor( structure = it } ?: run(this::finish) backToGlobalActions = intent.getBooleanExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, true ) bindViews() bindButtons() Loading @@ -100,7 +109,11 @@ class ControlsEditingActivity @Inject constructor( } override fun onBackPressed() { if (backToGlobalActions) { globalActionsComponent.handleShowGlobalActionsMenu() } else { ControlsDialog(applicationContext, broadcastDispatcher).show(uiController) } animateExitAndFinish() } Loading packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt +21 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ import com.android.systemui.controls.ControlsServiceInfo import com.android.systemui.controls.TooltipManager import com.android.systemui.controls.controller.ControlsControllerImpl import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.ui.ControlsDialog import com.android.systemui.controls.ui.ControlsUiController import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.globalactions.GlobalActionsComponent import com.android.systemui.settings.CurrentUserTracker Loading @@ -53,8 +55,9 @@ class ControlsFavoritingActivity @Inject constructor( @Main private val executor: Executor, private val controller: ControlsControllerImpl, private val listingController: ControlsListingController, broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent private val broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent, private val uiController: ControlsUiController ) : LifecycleActivity() { companion object { Loading Loading @@ -89,6 +92,7 @@ class ControlsFavoritingActivity @Inject constructor( private lateinit var comparator: Comparator<StructureContainer> private var cancelLoadRunnable: Runnable? = null private var isPagerLoaded = false private var backToGlobalActions = true private val currentUserTracker = object : CurrentUserTracker(broadcastDispatcher) { private val startingUser = controller.currentUserId Loading @@ -114,7 +118,7 @@ class ControlsFavoritingActivity @Inject constructor( override fun onBackPressed() { if (!fromProviderSelector) { globalActionsComponent.handleShowGlobalActionsMenu() openControlsOrigin() } animateExitAndFinish() } Loading @@ -129,6 +133,11 @@ class ControlsFavoritingActivity @Inject constructor( component = intent.getParcelableExtra<ComponentName>(Intent.EXTRA_COMPONENT_NAME) fromProviderSelector = intent.getBooleanExtra(EXTRA_FROM_PROVIDER_SELECTOR, false) backToGlobalActions = intent.getBooleanExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, true ) bindViews() } Loading Loading @@ -330,9 +339,17 @@ class ControlsFavoritingActivity @Inject constructor( ) } animateExitAndFinish() globalActionsComponent.handleShowGlobalActionsMenu() openControlsOrigin() } } } private fun openControlsOrigin() { if (backToGlobalActions) { globalActionsComponent.handleShowGlobalActionsMenu() } else { ControlsDialog(applicationContext, broadcastDispatcher).show(uiController) } } override fun onPause() { Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsDialog.kt +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class ControlsDialog @Inject constructor( val vg = requireViewById<ViewGroup>(com.android.systemui.R.id.global_actions_controls) vg.alpha = 0f controller.show(vg, { /* do nothing */ }, false /* startedFromGlobalActions */) controller.show(vg, { dismiss() }, false /* startedFromGlobalActions */) vg.animate() .alpha(1f) Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ interface ControlsUiController { companion object { public const val TAG = "ControlsUiController" public const val EXTRA_ANIMATE = "extra_animate" public const val BACK_TO_GLOBAL_ACTIONS = "back_to_global_actions" } fun show(parent: ViewGroup, onDismiss: Runnable, startedFromGlobalActions: Boolean) Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ class ControlsUiControllerImpl @Inject constructor ( private fun startActivity(context: Context, intent: Intent) { // Force animations when transitioning from a dialog to an activity intent.putExtra(ControlsUiController.EXTRA_ANIMATE, true) intent.putExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, controlActionCoordinator.startedFromGlobalActions ) onDismiss.run() activityStarter.dismissKeyguardThenExecute({ Loading Loading
packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt +16 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.controls.CustomIconCache import com.android.systemui.controls.controller.ControlsControllerImpl import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.ui.ControlsDialog import com.android.systemui.controls.ui.ControlsUiController import com.android.systemui.globalactions.GlobalActionsComponent import com.android.systemui.settings.CurrentUserTracker import com.android.systemui.util.LifecycleActivity Loading @@ -42,9 +44,10 @@ import javax.inject.Inject */ class ControlsEditingActivity @Inject constructor( private val controller: ControlsControllerImpl, broadcastDispatcher: BroadcastDispatcher, private val broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent, private val customIconCache: CustomIconCache private val customIconCache: CustomIconCache, private val uiController: ControlsUiController ) : LifecycleActivity() { companion object { Loading @@ -59,6 +62,7 @@ class ControlsEditingActivity @Inject constructor( private lateinit var model: FavoritesModel private lateinit var subtitle: TextView private lateinit var saveButton: View private var backToGlobalActions = true private val currentUserTracker = object : CurrentUserTracker(broadcastDispatcher) { private val startingUser = controller.currentUserId Loading @@ -82,6 +86,11 @@ class ControlsEditingActivity @Inject constructor( structure = it } ?: run(this::finish) backToGlobalActions = intent.getBooleanExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, true ) bindViews() bindButtons() Loading @@ -100,7 +109,11 @@ class ControlsEditingActivity @Inject constructor( } override fun onBackPressed() { if (backToGlobalActions) { globalActionsComponent.handleShowGlobalActionsMenu() } else { ControlsDialog(applicationContext, broadcastDispatcher).show(uiController) } animateExitAndFinish() } Loading
packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt +21 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ import com.android.systemui.controls.ControlsServiceInfo import com.android.systemui.controls.TooltipManager import com.android.systemui.controls.controller.ControlsControllerImpl import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.ui.ControlsDialog import com.android.systemui.controls.ui.ControlsUiController import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.globalactions.GlobalActionsComponent import com.android.systemui.settings.CurrentUserTracker Loading @@ -53,8 +55,9 @@ class ControlsFavoritingActivity @Inject constructor( @Main private val executor: Executor, private val controller: ControlsControllerImpl, private val listingController: ControlsListingController, broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent private val broadcastDispatcher: BroadcastDispatcher, private val globalActionsComponent: GlobalActionsComponent, private val uiController: ControlsUiController ) : LifecycleActivity() { companion object { Loading Loading @@ -89,6 +92,7 @@ class ControlsFavoritingActivity @Inject constructor( private lateinit var comparator: Comparator<StructureContainer> private var cancelLoadRunnable: Runnable? = null private var isPagerLoaded = false private var backToGlobalActions = true private val currentUserTracker = object : CurrentUserTracker(broadcastDispatcher) { private val startingUser = controller.currentUserId Loading @@ -114,7 +118,7 @@ class ControlsFavoritingActivity @Inject constructor( override fun onBackPressed() { if (!fromProviderSelector) { globalActionsComponent.handleShowGlobalActionsMenu() openControlsOrigin() } animateExitAndFinish() } Loading @@ -129,6 +133,11 @@ class ControlsFavoritingActivity @Inject constructor( component = intent.getParcelableExtra<ComponentName>(Intent.EXTRA_COMPONENT_NAME) fromProviderSelector = intent.getBooleanExtra(EXTRA_FROM_PROVIDER_SELECTOR, false) backToGlobalActions = intent.getBooleanExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, true ) bindViews() } Loading Loading @@ -330,9 +339,17 @@ class ControlsFavoritingActivity @Inject constructor( ) } animateExitAndFinish() globalActionsComponent.handleShowGlobalActionsMenu() openControlsOrigin() } } } private fun openControlsOrigin() { if (backToGlobalActions) { globalActionsComponent.handleShowGlobalActionsMenu() } else { ControlsDialog(applicationContext, broadcastDispatcher).show(uiController) } } override fun onPause() { Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsDialog.kt +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class ControlsDialog @Inject constructor( val vg = requireViewById<ViewGroup>(com.android.systemui.R.id.global_actions_controls) vg.alpha = 0f controller.show(vg, { /* do nothing */ }, false /* startedFromGlobalActions */) controller.show(vg, { dismiss() }, false /* startedFromGlobalActions */) vg.animate() .alpha(1f) Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiController.kt +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ interface ControlsUiController { companion object { public const val TAG = "ControlsUiController" public const val EXTRA_ANIMATE = "extra_animate" public const val BACK_TO_GLOBAL_ACTIONS = "back_to_global_actions" } fun show(parent: ViewGroup, onDismiss: Runnable, startedFromGlobalActions: Boolean) Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +4 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,10 @@ class ControlsUiControllerImpl @Inject constructor ( private fun startActivity(context: Context, intent: Intent) { // Force animations when transitioning from a dialog to an activity intent.putExtra(ControlsUiController.EXTRA_ANIMATE, true) intent.putExtra( ControlsUiController.BACK_TO_GLOBAL_ACTIONS, controlActionCoordinator.startedFromGlobalActions ) onDismiss.run() activityStarter.dismissKeyguardThenExecute({ Loading