Merge "Fix wrong 3 button order in landscape mode sometimes" into main
This commit is contained in:
commit
aa366d03cd
3 files changed
+15
-15
No files matched your search
@@ -88,10 +88,10 @@ import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton;
|
||||
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory;
|
||||
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter;
|
||||
import com.android.launcher3.util.DimensionUtils;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
import com.android.launcher3.util.window.WindowManagerProxy;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
import com.android.systemui.shared.rotation.FloatingRotationButton;
|
||||
import com.android.systemui.shared.rotation.RotationButton;
|
||||
@@ -144,6 +144,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
private int mState;
|
||||
|
||||
private final TaskbarActivityContext mContext;
|
||||
private final WindowManagerProxy mWindowManagerProxy;
|
||||
private final FrameLayout mNavButtonsView;
|
||||
private final LinearLayout mNavButtonContainer;
|
||||
// Used for IME+A11Y buttons
|
||||
@@ -198,10 +199,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
this::onComputeInsetsForSeparateWindow;
|
||||
private final RecentsHitboxExtender mHitboxExtender = new RecentsHitboxExtender();
|
||||
private ImageView mRecentsButton;
|
||||
private DisplayController mDisplayController;
|
||||
|
||||
public NavbarButtonsViewController(TaskbarActivityContext context, FrameLayout navButtonsView) {
|
||||
mContext = context;
|
||||
mWindowManagerProxy = WindowManagerProxy.INSTANCE.get(mContext);
|
||||
mNavButtonsView = navButtonsView;
|
||||
mNavButtonContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
|
||||
mEndContextualContainer = mNavButtonsView.findViewById(R.id.end_contextual_buttons);
|
||||
@@ -232,8 +233,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
TaskbarManager.isPhoneMode(deviceProfile));
|
||||
mNavButtonsView.getLayoutParams().height = p.y;
|
||||
|
||||
mDisplayController = DisplayController.INSTANCE.get(mContext);
|
||||
|
||||
mIsImeRenderingNavButtons =
|
||||
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
|
||||
if (!mIsImeRenderingNavButtons) {
|
||||
@@ -738,7 +737,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
NavButtonLayoutter navButtonLayoutter =
|
||||
NavButtonLayoutFactory.Companion.getUiLayoutter(
|
||||
dp, mNavButtonsView, res, isInKidsMode, isInSetup, isThreeButtonNav,
|
||||
TaskbarManager.isPhoneMode(dp), mDisplayController.getInfo().rotation);
|
||||
TaskbarManager.isPhoneMode(dp),
|
||||
mWindowManagerProxy.getRotation(mContext));
|
||||
navButtonLayoutter.layoutButtons(dp, isContextualButtonShowing());
|
||||
updateNavButtonColor();
|
||||
return;
|
||||
|
||||
@@ -57,14 +57,11 @@ open class PhoneLandscapeNavLayoutter(
|
||||
marginStart = 0
|
||||
}
|
||||
|
||||
// Swap recents and back button
|
||||
navButtonContainer.addView(recentsButton)
|
||||
navButtonContainer.addView(homeButton)
|
||||
navButtonContainer.addView(backButton)
|
||||
|
||||
navButtonContainer.layoutParams = navContainerParams
|
||||
navButtonContainer.gravity = Gravity.CENTER
|
||||
|
||||
addThreeButtons()
|
||||
|
||||
// Add the spaces in between the nav buttons
|
||||
val spaceInBetween: Int =
|
||||
resources.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween_phone)
|
||||
@@ -85,4 +82,11 @@ open class PhoneLandscapeNavLayoutter(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open fun addThreeButtons() {
|
||||
// Swap recents and back button
|
||||
navButtonContainer.addView(recentsButton)
|
||||
navButtonContainer.addView(homeButton)
|
||||
navButtonContainer.addView(backButton)
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ package com.android.launcher3.taskbar.navbutton
|
||||
import android.content.res.Resources
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import com.android.launcher3.DeviceProfile
|
||||
|
||||
class PhoneSeascapeNavLayoutter(
|
||||
resources: Resources,
|
||||
@@ -34,10 +33,7 @@ class PhoneSeascapeNavLayoutter(
|
||||
startContextualContainer
|
||||
) {
|
||||
|
||||
override fun layoutButtons(dp: DeviceProfile, isContextualButtonShowing: Boolean) {
|
||||
// TODO(b/230395757): Polish pending, this is just to make it usable
|
||||
super.layoutButtons(dp, isContextualButtonShowing)
|
||||
navButtonContainer.removeAllViews()
|
||||
override fun addThreeButtons() {
|
||||
// Flip ordering of back and recents buttons
|
||||
navButtonContainer.addView(backButton)
|
||||
navButtonContainer.addView(homeButton)
|
||||
|
||||
Reference in new issue
Block a user