Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +21 −32 Original line number Diff line number Diff line Loading @@ -317,14 +317,14 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0)); // Rotation button RotationButton rotationButton = new RotationButtonImpl( addButton(mEndContextualContainer, R.id.rotate_suggestion, R.layout.taskbar_contextual_button)); rotationButton.hide(); mControllers.rotationButtonController.setRotationButton(rotationButton, null); } else { } else if (!mIsImeRenderingNavButtons) { View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK, mStartContextualContainer, mControllers.navButtonController, R.id.back); imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90); // Only show when IME is visible. mPropertyHolders.add(new StatePropertyHolder(imeDownButton, flags -> (flags & FLAG_IME_VISIBLE) != 0)); } mFloatingRotationButton = new FloatingRotationButton( ENABLE_TASKBAR_NAVBAR_UNIFICATION ? mNavigationBarPanelContext : mContext, R.string.accessibility_rotate_button, Loading @@ -340,16 +340,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mControllers.rotationButtonController.setRotationButton(mFloatingRotationButton, mRotationButtonListener); if (!mIsImeRenderingNavButtons) { View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK, mStartContextualContainer, mControllers.navButtonController, R.id.back); imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90); // Only show when IME is visible. mPropertyHolders.add(new StatePropertyHolder(imeDownButton, flags -> (flags & FLAG_IME_VISIBLE) != 0)); } } applyState(); mPropertyHolders.forEach(StatePropertyHolder::endAnimation); Loading Loading @@ -791,7 +781,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT NavButtonLayoutter navButtonLayoutter = NavButtonLayoutFactory.Companion.getUiLayoutter( dp, mNavButtonsView, mImeSwitcherButton, mControllers.rotationButtonController.getRotationButton(), mA11yButton, mSpace, res, isInKidsMode, isInSetup, isThreeButtonNav, mContext.isPhoneMode(), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(mContext, isA11yButtonPersistent()); Loading quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt +22 −17 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.widget.Space import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter import com.android.systemui.shared.rotation.RotationButton /** * Meant to be a simple container for data subclasses will need Loading @@ -46,7 +45,6 @@ abstract class AbstractNavButtonLayoutter( protected val endContextualContainer: ViewGroup, protected val startContextualContainer: ViewGroup, protected val imeSwitcher: ImageView?, protected val rotationButton: RotationButton?, protected val a11yButton: ImageView?, protected val space: Space? ) : NavButtonLayoutter { Loading @@ -66,17 +64,24 @@ abstract class AbstractNavButtonLayoutter( } fun getParamsToCenterView(): FrameLayout.LayoutParams { val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) params.gravity = Gravity.CENTER return params; return params } open fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) open fun repositionContextualContainer( contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int ) { val contextualContainerParams = FrameLayout.LayoutParams(buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) contextualContainerParams.apply { marginStart = barAxisMarginStart marginEnd = barAxisMarginEnd Loading quickstep/src/com/android/launcher3/taskbar/navbutton/KidsNavLayoutter.kt +23 −25 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.widget.Space import com.android.launcher3.R import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.* import com.android.systemui.shared.rotation.RotationButton class KidsNavLayoutter( resources: Resources, Loading @@ -37,7 +36,6 @@ class KidsNavLayoutter( endContextualContainer: ViewGroup, startContextualContainer: ViewGroup, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space? ) : Loading @@ -47,7 +45,6 @@ class KidsNavLayoutter( endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) { Loading Loading @@ -105,11 +102,16 @@ class KidsNavLayoutter( endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) val contextualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, WRAP_CONTENT, 0, 0, Gravity.END) repositionContextualContainer(startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START) repositionContextualContainer( startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START ) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading @@ -119,9 +121,5 @@ class KidsNavLayoutter( endContextualContainer.addView(a11yButton) a11yButton.layoutParams = getParamsToCenterView() } if (rotationButton != null) { endContextualContainer.addView(rotationButton.currentView) rotationButton.currentView.layoutParams = getParamsToCenterView() } } } quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt +3 −10 Original line number Diff line number Diff line Loading @@ -25,10 +25,11 @@ import android.widget.LinearLayout import android.widget.Space import com.android.launcher3.DeviceProfile import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.* import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_END_CONTEXTUAL_BUTTONS import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_END_NAV_BUTTONS import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_START_CONTEXTUAL_BUTTONS import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.Companion import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter import com.android.systemui.shared.rotation.RotationButton /** * Select the correct layout for nav buttons Loading Loading @@ -58,7 +59,6 @@ class NavButtonLayoutFactory { deviceProfile: DeviceProfile, navButtonsView: NearestTouchFrame, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space?, resources: Resources, Loading Loading @@ -86,7 +86,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -98,7 +97,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -110,7 +108,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -123,7 +120,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -138,7 +134,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -150,7 +145,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -162,7 +156,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt +16 −19 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.Space import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.systemui.shared.rotation.RotationButton /** Layoutter for showing gesture navigation on phone screen. No buttons here, no-op container */ class PhoneGestureLayoutter( Loading @@ -31,7 +30,6 @@ class PhoneGestureLayoutter( endContextualContainer: ViewGroup, startContextualContainer: ViewGroup, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space? ) : Loading @@ -41,7 +39,6 @@ class PhoneGestureLayoutter( endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) { Loading Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +21 −32 Original line number Diff line number Diff line Loading @@ -317,14 +317,14 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0)); // Rotation button RotationButton rotationButton = new RotationButtonImpl( addButton(mEndContextualContainer, R.id.rotate_suggestion, R.layout.taskbar_contextual_button)); rotationButton.hide(); mControllers.rotationButtonController.setRotationButton(rotationButton, null); } else { } else if (!mIsImeRenderingNavButtons) { View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK, mStartContextualContainer, mControllers.navButtonController, R.id.back); imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90); // Only show when IME is visible. mPropertyHolders.add(new StatePropertyHolder(imeDownButton, flags -> (flags & FLAG_IME_VISIBLE) != 0)); } mFloatingRotationButton = new FloatingRotationButton( ENABLE_TASKBAR_NAVBAR_UNIFICATION ? mNavigationBarPanelContext : mContext, R.string.accessibility_rotate_button, Loading @@ -340,16 +340,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT mControllers.rotationButtonController.setRotationButton(mFloatingRotationButton, mRotationButtonListener); if (!mIsImeRenderingNavButtons) { View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK, mStartContextualContainer, mControllers.navButtonController, R.id.back); imeDownButton.setRotation(Utilities.isRtl(resources) ? 90 : -90); // Only show when IME is visible. mPropertyHolders.add(new StatePropertyHolder(imeDownButton, flags -> (flags & FLAG_IME_VISIBLE) != 0)); } } applyState(); mPropertyHolders.forEach(StatePropertyHolder::endAnimation); Loading Loading @@ -791,7 +781,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT NavButtonLayoutter navButtonLayoutter = NavButtonLayoutFactory.Companion.getUiLayoutter( dp, mNavButtonsView, mImeSwitcherButton, mControllers.rotationButtonController.getRotationButton(), mA11yButton, mSpace, res, isInKidsMode, isInSetup, isThreeButtonNav, mContext.isPhoneMode(), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(mContext, isA11yButtonPersistent()); Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/AbstractNavButtonLayoutter.kt +22 −17 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.widget.Space import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter import com.android.systemui.shared.rotation.RotationButton /** * Meant to be a simple container for data subclasses will need Loading @@ -46,7 +45,6 @@ abstract class AbstractNavButtonLayoutter( protected val endContextualContainer: ViewGroup, protected val startContextualContainer: ViewGroup, protected val imeSwitcher: ImageView?, protected val rotationButton: RotationButton?, protected val a11yButton: ImageView?, protected val space: Space? ) : NavButtonLayoutter { Loading @@ -66,17 +64,24 @@ abstract class AbstractNavButtonLayoutter( } fun getParamsToCenterView(): FrameLayout.LayoutParams { val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) val params = FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) params.gravity = Gravity.CENTER return params; return params } open fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int) { val contextualContainerParams = FrameLayout.LayoutParams( buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) open fun repositionContextualContainer( contextualContainer: ViewGroup, buttonSize: Int, barAxisMarginStart: Int, barAxisMarginEnd: Int, gravity: Int ) { val contextualContainerParams = FrameLayout.LayoutParams(buttonSize, ViewGroup.LayoutParams.MATCH_PARENT) contextualContainerParams.apply { marginStart = barAxisMarginStart marginEnd = barAxisMarginEnd Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/KidsNavLayoutter.kt +23 −25 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.widget.Space import com.android.launcher3.R import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.* import com.android.systemui.shared.rotation.RotationButton class KidsNavLayoutter( resources: Resources, Loading @@ -37,7 +36,6 @@ class KidsNavLayoutter( endContextualContainer: ViewGroup, startContextualContainer: ViewGroup, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space? ) : Loading @@ -47,7 +45,6 @@ class KidsNavLayoutter( endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) { Loading Loading @@ -105,11 +102,16 @@ class KidsNavLayoutter( endContextualContainer.removeAllViews() startContextualContainer.removeAllViews() val contextualMargin = resources.getDimensionPixelSize( R.dimen.taskbar_contextual_button_padding) val contextualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_padding) repositionContextualContainer(endContextualContainer, WRAP_CONTENT, 0, 0, Gravity.END) repositionContextualContainer(startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START) repositionContextualContainer( startContextualContainer, WRAP_CONTENT, contextualMargin, contextualMargin, Gravity.START ) if (imeSwitcher != null) { startContextualContainer.addView(imeSwitcher) Loading @@ -119,9 +121,5 @@ class KidsNavLayoutter( endContextualContainer.addView(a11yButton) a11yButton.layoutParams = getParamsToCenterView() } if (rotationButton != null) { endContextualContainer.addView(rotationButton.currentView) rotationButton.currentView.layoutParams = getParamsToCenterView() } } }
quickstep/src/com/android/launcher3/taskbar/navbutton/NavButtonLayoutFactory.kt +3 −10 Original line number Diff line number Diff line Loading @@ -25,10 +25,11 @@ import android.widget.LinearLayout import android.widget.Space import com.android.launcher3.DeviceProfile import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.* import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_END_CONTEXTUAL_BUTTONS import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_END_NAV_BUTTONS import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.ID_START_CONTEXTUAL_BUTTONS import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.Companion import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter import com.android.systemui.shared.rotation.RotationButton /** * Select the correct layout for nav buttons Loading Loading @@ -58,7 +59,6 @@ class NavButtonLayoutFactory { deviceProfile: DeviceProfile, navButtonsView: NearestTouchFrame, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space?, resources: Resources, Loading Loading @@ -86,7 +86,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -98,7 +97,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -110,7 +108,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -123,7 +120,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -138,7 +134,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -150,7 +145,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading @@ -162,7 +156,6 @@ class NavButtonLayoutFactory { endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) Loading
quickstep/src/com/android/launcher3/taskbar/navbutton/PhoneGestureLayoutter.kt +16 −19 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.Space import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.systemui.shared.rotation.RotationButton /** Layoutter for showing gesture navigation on phone screen. No buttons here, no-op container */ class PhoneGestureLayoutter( Loading @@ -31,7 +30,6 @@ class PhoneGestureLayoutter( endContextualContainer: ViewGroup, startContextualContainer: ViewGroup, imeSwitcher: ImageView?, rotationButton: RotationButton?, a11yButton: ImageView?, space: Space? ) : Loading @@ -41,7 +39,6 @@ class PhoneGestureLayoutter( endContextualContainer, startContextualContainer, imeSwitcher, rotationButton, a11yButton, space ) { Loading