Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupController.kt +15 −8 Original line number Diff line number Diff line Loading @@ -38,10 +38,17 @@ class TaskbarDividerPopupController(private val context: TaskbarActivityContext) view.post { val popupView = createAndPopulate(view, context) popupView.requestFocus() popupView.onCloseCallback = { context.onPopupVisibilityChanged(false) popupView.onCloseCallback = callback@{ didPreferenceChange -> context.dragLayer.post { context.onPopupVisibilityChanged(false) } if (!didPreferenceChange) { return@callback } if (launcherPrefs.get(TASKBAR_PINNING)) { animateTransientToPersistentTaskBar() animateTransientToPersistentTaskbar() } else { animatePersistentToTransientTaskbar() } Loading @@ -55,7 +62,7 @@ class TaskbarDividerPopupController(private val context: TaskbarActivityContext) } // TODO(b/265436799): provide animation/transition from transient taskbar to persistent one private fun animateTransientToPersistentTaskBar() {} private fun animateTransientToPersistentTaskbar() {} // TODO(b/265436799): provide animation/transition from persistent taskbar to transient one private fun animatePersistentToTransientTaskbar() {} Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt +15 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.launcher3.taskbar import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.graphics.Rect import android.util.AttributeSet import android.view.Gravity Loading @@ -42,6 +43,9 @@ constructor( companion object { private const val TAG = "TaskbarDividerPopupView" private const val DIVIDER_POPUP_CLOSING_DELAY = 500L private const val SETTINGS_PACKAGE_NAME = "com.android.settings" private const val CHANGE_NAVIGATION_MODE_ACTION = "com.android.settings.NAVIGATION_MODE_SETTINGS" @JvmStatic fun createAndPopulate( Loading Loading @@ -71,7 +75,7 @@ constructor( private var didPreferenceChange = false /** Callback invoked when the pinning popup view is closing. */ var onCloseCallback: () -> Unit = {} var onCloseCallback: (preferenceChanged: Boolean) -> Unit = {} /** * Callback invoked when the user preference changes in popup view. Preference change will be Loading @@ -98,12 +102,21 @@ constructor( super.onFinishInflate() val taskbarSwitchOption = findViewById<LinearLayout>(R.id.taskbar_switch_option) val alwaysShowTaskbarSwitch = findViewById<Switch>(R.id.taskbar_pinning_switch) val navigationModeChangeOption = findViewById<LinearLayout>(R.id.navigation_mode_switch_option) alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn taskbarSwitchOption.setOnClickListener { alwaysShowTaskbarSwitch.isClickable = true alwaysShowTaskbarSwitch.isChecked = !alwaysShowTaskbarOn onClickAlwaysShowTaskbarSwitchOption() } navigationModeChangeOption.setOnClickListener { context.startActivity( Intent(CHANGE_NAVIGATION_MODE_ACTION) .setPackage(SETTINGS_PACKAGE_NAME) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) ) } } /** Orient object as usual and then center object horizontally. */ Loading Loading @@ -156,9 +169,7 @@ constructor( } override fun closeComplete() { if (didPreferenceChange) { onCloseCallback() } onCloseCallback(didPreferenceChange) super.closeComplete() } Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupController.kt +15 −8 Original line number Diff line number Diff line Loading @@ -38,10 +38,17 @@ class TaskbarDividerPopupController(private val context: TaskbarActivityContext) view.post { val popupView = createAndPopulate(view, context) popupView.requestFocus() popupView.onCloseCallback = { context.onPopupVisibilityChanged(false) popupView.onCloseCallback = callback@{ didPreferenceChange -> context.dragLayer.post { context.onPopupVisibilityChanged(false) } if (!didPreferenceChange) { return@callback } if (launcherPrefs.get(TASKBAR_PINNING)) { animateTransientToPersistentTaskBar() animateTransientToPersistentTaskbar() } else { animatePersistentToTransientTaskbar() } Loading @@ -55,7 +62,7 @@ class TaskbarDividerPopupController(private val context: TaskbarActivityContext) } // TODO(b/265436799): provide animation/transition from transient taskbar to persistent one private fun animateTransientToPersistentTaskBar() {} private fun animateTransientToPersistentTaskbar() {} // TODO(b/265436799): provide animation/transition from persistent taskbar to transient one private fun animatePersistentToTransientTaskbar() {} Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDividerPopupView.kt +15 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.launcher3.taskbar import android.annotation.SuppressLint import android.content.Context import android.content.Intent import android.graphics.Rect import android.util.AttributeSet import android.view.Gravity Loading @@ -42,6 +43,9 @@ constructor( companion object { private const val TAG = "TaskbarDividerPopupView" private const val DIVIDER_POPUP_CLOSING_DELAY = 500L private const val SETTINGS_PACKAGE_NAME = "com.android.settings" private const val CHANGE_NAVIGATION_MODE_ACTION = "com.android.settings.NAVIGATION_MODE_SETTINGS" @JvmStatic fun createAndPopulate( Loading Loading @@ -71,7 +75,7 @@ constructor( private var didPreferenceChange = false /** Callback invoked when the pinning popup view is closing. */ var onCloseCallback: () -> Unit = {} var onCloseCallback: (preferenceChanged: Boolean) -> Unit = {} /** * Callback invoked when the user preference changes in popup view. Preference change will be Loading @@ -98,12 +102,21 @@ constructor( super.onFinishInflate() val taskbarSwitchOption = findViewById<LinearLayout>(R.id.taskbar_switch_option) val alwaysShowTaskbarSwitch = findViewById<Switch>(R.id.taskbar_pinning_switch) val navigationModeChangeOption = findViewById<LinearLayout>(R.id.navigation_mode_switch_option) alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn taskbarSwitchOption.setOnClickListener { alwaysShowTaskbarSwitch.isClickable = true alwaysShowTaskbarSwitch.isChecked = !alwaysShowTaskbarOn onClickAlwaysShowTaskbarSwitchOption() } navigationModeChangeOption.setOnClickListener { context.startActivity( Intent(CHANGE_NAVIGATION_MODE_ACTION) .setPackage(SETTINGS_PACKAGE_NAME) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) ) } } /** Orient object as usual and then center object horizontally. */ Loading Loading @@ -156,9 +169,7 @@ constructor( } override fun closeComplete() { if (didPreferenceChange) { onCloseCallback() } onCloseCallback(didPreferenceChange) super.closeComplete() } Loading