Merge "Make sure touch only goes to the nearest button when it makes sense" into main
This commit is contained in:
@@ -30,6 +30,7 @@ import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_BA
|
||||
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_HOME;
|
||||
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_IME_SWITCH;
|
||||
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_RECENTS;
|
||||
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_SPACE;
|
||||
import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_KEYGUARD;
|
||||
import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_SMALL_SCREEN;
|
||||
import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
|
||||
@@ -79,6 +80,7 @@ import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Space;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -207,6 +209,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
this::onComputeInsetsForSeparateWindow;
|
||||
private final RecentsHitboxExtender mHitboxExtender = new RecentsHitboxExtender();
|
||||
private ImageView mRecentsButton;
|
||||
private Space mSpace;
|
||||
|
||||
public NavbarButtonsViewController(TaskbarActivityContext context,
|
||||
@Nullable Context navigationBarPanelContext, NearestTouchFrame navButtonsView) {
|
||||
@@ -432,6 +435,11 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
mPropertyHolders.add(new StatePropertyHolder(mA11yButton,
|
||||
flags -> (flags & FLAG_A11Y_VISIBLE) != 0
|
||||
&& (flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0));
|
||||
|
||||
mSpace = new Space(mNavButtonsView.getContext());
|
||||
mSpace.setOnClickListener(view -> navButtonController.onButtonClick(BUTTON_SPACE, view));
|
||||
mSpace.setOnLongClickListener(view ->
|
||||
navButtonController.onButtonLongClick(BUTTON_SPACE, view));
|
||||
}
|
||||
|
||||
private void parseSystemUiFlags(int sysUiStateFlags) {
|
||||
@@ -760,7 +768,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
NavButtonLayoutFactory.Companion.getUiLayoutter(
|
||||
dp, mNavButtonsView, mImeSwitcherButton,
|
||||
mControllers.rotationButtonController.getRotationButton(),
|
||||
mA11yButton, res, isInKidsMode, isInSetup, isThreeButtonNav,
|
||||
mA11yButton, mSpace, res, isInKidsMode, isInSetup, isThreeButtonNav,
|
||||
mContext.isPhoneMode(), mWindowManagerProxy.getRotation(mContext));
|
||||
navButtonLayoutter.layoutButtons(mContext, isA11yButtonPersistent());
|
||||
updateButtonsBackground();
|
||||
|
||||
@@ -102,6 +102,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
static final int BUTTON_A11Y = BUTTON_IME_SWITCH << 1;
|
||||
static final int BUTTON_QUICK_SETTINGS = BUTTON_A11Y << 1;
|
||||
static final int BUTTON_NOTIFICATIONS = BUTTON_QUICK_SETTINGS << 1;
|
||||
static final int BUTTON_SPACE = BUTTON_NOTIFICATIONS << 1;
|
||||
|
||||
private static final int SCREEN_UNPIN_COMBO = BUTTON_BACK | BUTTON_RECENTS;
|
||||
private int mLongPressedButtons = 0;
|
||||
@@ -123,6 +124,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
}
|
||||
|
||||
public void onButtonClick(@TaskbarButton int buttonType, View view) {
|
||||
if (buttonType == BUTTON_SPACE) {
|
||||
return;
|
||||
}
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
@@ -156,6 +160,9 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
}
|
||||
|
||||
public boolean onButtonLongClick(@TaskbarButton int buttonType, View view) {
|
||||
if (buttonType == BUTTON_SPACE) {
|
||||
return false;
|
||||
}
|
||||
// Provide the same haptic feedback that the system offers for virtual keys.
|
||||
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
switch (buttonType) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter
|
||||
@@ -46,7 +47,8 @@ abstract class AbstractNavButtonLayoutter(
|
||||
protected val startContextualContainer: ViewGroup,
|
||||
protected val imeSwitcher: ImageView?,
|
||||
protected val rotationButton: RotationButton?,
|
||||
protected val a11yButton: ImageView?
|
||||
protected val a11yButton: ImageView?,
|
||||
protected val space: Space
|
||||
) : NavButtonLayoutter {
|
||||
protected val homeButton: ImageView? = navButtonContainer.findViewById(R.id.home)
|
||||
protected val recentsButton: ImageView? = navButtonContainer.findViewById(R.id.recent_apps)
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.taskbar.TaskbarActivityContext
|
||||
import com.android.launcher3.taskbar.navbutton.LayoutResourceHelper.*
|
||||
@@ -37,7 +38,8 @@ class KidsNavLayoutter(
|
||||
startContextualContainer: ViewGroup,
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -46,7 +48,8 @@ class KidsNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
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.*
|
||||
@@ -60,6 +61,7 @@ class NavButtonLayoutFactory {
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
resources: Resources,
|
||||
isKidsMode: Boolean,
|
||||
isInSetup: Boolean,
|
||||
@@ -86,7 +88,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
} else if (surfaceRotation == ROTATION_90) {
|
||||
navButtonsView.setIsVertical(true)
|
||||
@@ -97,7 +100,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
} else {
|
||||
navButtonsView.setIsVertical(true)
|
||||
@@ -108,7 +112,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -120,7 +125,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
}
|
||||
deviceProfile.isTaskbarPresent -> {
|
||||
@@ -133,7 +139,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
}
|
||||
isKidsMode -> {
|
||||
@@ -144,7 +151,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
}
|
||||
else ->
|
||||
@@ -155,7 +163,8 @@ class NavButtonLayoutFactory {
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.widget.FrameLayout;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -42,7 +43,10 @@ public class NearestTouchFrame extends FrameLayout {
|
||||
private final List<View> mClickableChildren = new ArrayList<>();
|
||||
private final List<View> mAttachedChildren = new ArrayList<>();
|
||||
private final boolean mIsActive;
|
||||
private final int[] mTmpInt = new int[2];
|
||||
|
||||
// Offset (as the base) to translate window cords to view cords.
|
||||
private final int[] mWindowOffset = new int[2];
|
||||
private boolean mIsVertical;
|
||||
private View mTouchingChild;
|
||||
private final Map<View, Rect> mTouchableRegions = new HashMap<>();
|
||||
@@ -52,8 +56,11 @@ public class NearestTouchFrame extends FrameLayout {
|
||||
*/
|
||||
private final Comparator<View> mChildRegionComparator =
|
||||
(view1, view2) -> {
|
||||
int startingCoordView1 = mIsVertical ? view1.getTop() : view1.getLeft();
|
||||
int startingCoordView2 = mIsVertical ? view2.getTop() : view2.getLeft();
|
||||
int leftTopIndex = mIsVertical ? 1 : 0;
|
||||
view1.getLocationInWindow(mTmpInt);
|
||||
int startingCoordView1 = mTmpInt[leftTopIndex] - mWindowOffset[leftTopIndex];
|
||||
view2.getLocationInWindow(mTmpInt);
|
||||
int startingCoordView2 = mTmpInt[leftTopIndex] - mWindowOffset[leftTopIndex];
|
||||
|
||||
return startingCoordView1 - startingCoordView2;
|
||||
};
|
||||
@@ -74,6 +81,7 @@ public class NearestTouchFrame extends FrameLayout {
|
||||
mAttachedChildren.clear();
|
||||
mTouchableRegions.clear();
|
||||
addClickableChildren(this);
|
||||
getLocationInWindow(mWindowOffset);
|
||||
cacheClosestChildLocations();
|
||||
}
|
||||
|
||||
@@ -147,8 +155,9 @@ public class NearestTouchFrame extends FrameLayout {
|
||||
}
|
||||
|
||||
private Rect getChildsBounds(View child) {
|
||||
int left = child.getLeft();
|
||||
int top = child.getTop();
|
||||
child.getLocationInWindow(mTmpInt);
|
||||
int left = mTmpInt[0] - mWindowOffset[0];
|
||||
int top = mTmpInt[1] - mWindowOffset[1];
|
||||
int right = left + child.getWidth();
|
||||
int bottom = top + child.getHeight();
|
||||
return new Rect(left, top, right, bottom);
|
||||
@@ -194,6 +203,7 @@ public class NearestTouchFrame extends FrameLayout {
|
||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||
pw.println(prefix + "NearestTouchFrame:");
|
||||
|
||||
pw.println(String.format("%s\tmWindowOffset=%s", prefix, Arrays.toString(mWindowOffset)));
|
||||
pw.println(String.format("%s\tmIsVertical=%s", prefix, mIsVertical));
|
||||
pw.println(String.format("%s\tmTouchingChild=%s", prefix, mTouchingChild));
|
||||
pw.println(String.format("%s\tmTouchableRegions=%s", prefix,
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.content.res.Resources
|
||||
import android.view.ViewGroup
|
||||
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
|
||||
|
||||
@@ -31,7 +32,8 @@ class PhoneGestureLayoutter(
|
||||
startContextualContainer: ViewGroup,
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -40,7 +42,8 @@ class PhoneGestureLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
|
||||
+10
-4
@@ -19,9 +19,11 @@ package com.android.launcher3.taskbar.navbutton
|
||||
import android.content.res.Resources
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.taskbar.TaskbarActivityContext
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
@@ -34,6 +36,7 @@ open class PhoneLandscapeNavLayoutter(
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -42,7 +45,8 @@ open class PhoneLandscapeNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
@@ -60,7 +64,7 @@ open class PhoneLandscapeNavLayoutter(
|
||||
val navButtonContainerHeight = contentWidth - contextualButtonHeight * 2
|
||||
|
||||
val navContainerParams = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, navButtonContainerHeight.toInt())
|
||||
MATCH_PARENT, navButtonContainerHeight.toInt())
|
||||
navContainerParams.apply {
|
||||
topMargin =
|
||||
(contextualButtonHeight + contentPadding + roundedCornerContentMargin).toInt()
|
||||
@@ -125,6 +129,8 @@ open class PhoneLandscapeNavLayoutter(
|
||||
val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding)
|
||||
repositionContextualContainer(startContextualContainer, buttonSize,
|
||||
roundedCornerContentMargin + contentPadding, 0, Gravity.TOP)
|
||||
repositionContextualContainer(endContextualContainer, buttonSize,
|
||||
0, roundedCornerContentMargin + contentPadding, Gravity.BOTTOM)
|
||||
|
||||
if (imeSwitcher != null) {
|
||||
startContextualContainer.addView(imeSwitcher)
|
||||
@@ -138,13 +144,13 @@ open class PhoneLandscapeNavLayoutter(
|
||||
startContextualContainer.addView(rotationButton.currentView)
|
||||
rotationButton.currentView.layoutParams = getParamsToCenterView()
|
||||
}
|
||||
endContextualContainer.addView(space, MATCH_PARENT, MATCH_PARENT)
|
||||
}
|
||||
|
||||
override fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int,
|
||||
barAxisMarginTop: Int, barAxisMarginBottom: Int,
|
||||
gravity: Int) {
|
||||
val contextualContainerParams = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, buttonSize)
|
||||
val contextualContainerParams = FrameLayout.LayoutParams(MATCH_PARENT, buttonSize)
|
||||
contextualContainerParams.apply {
|
||||
marginStart = 0
|
||||
marginEnd = 0
|
||||
|
||||
@@ -19,9 +19,11 @@ package com.android.launcher3.taskbar.navbutton
|
||||
import android.content.res.Resources
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.taskbar.TaskbarActivityContext
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
@@ -34,6 +36,7 @@ class PhonePortraitNavLayoutter(
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?,
|
||||
space: Space
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -42,7 +45,8 @@ class PhonePortraitNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
@@ -110,9 +114,12 @@ class PhonePortraitNavLayoutter(
|
||||
endContextualContainer.removeAllViews()
|
||||
startContextualContainer.removeAllViews()
|
||||
|
||||
repositionContextualContainer(startContextualContainer, contextualButtonWidth.toInt(),
|
||||
roundedCornerContentMargin + contentPadding, 0, Gravity.START)
|
||||
repositionContextualContainer(endContextualContainer, contextualButtonWidth.toInt(), 0,
|
||||
roundedCornerContentMargin + contentPadding, Gravity.END)
|
||||
|
||||
startContextualContainer.addView(space, MATCH_PARENT, MATCH_PARENT)
|
||||
if (imeSwitcher != null) {
|
||||
endContextualContainer.addView(imeSwitcher)
|
||||
imeSwitcher.layoutParams = getParamsToCenterView()
|
||||
|
||||
@@ -19,8 +19,10 @@ package com.android.launcher3.taskbar.navbutton
|
||||
import android.content.res.Resources
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
|
||||
@@ -31,7 +33,8 @@ class PhoneSeascapeNavLayoutter(
|
||||
startContextualContainer: ViewGroup,
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
) :
|
||||
PhoneLandscapeNavLayoutter(
|
||||
resources,
|
||||
@@ -40,7 +43,8 @@ class PhoneSeascapeNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun addThreeButtons() {
|
||||
@@ -57,9 +61,12 @@ class PhoneSeascapeNavLayoutter(
|
||||
val roundedCornerContentMargin = resources.getDimensionPixelSize(
|
||||
R.dimen.taskbar_phone_rounded_corner_content_margin)
|
||||
val contentPadding = resources.getDimensionPixelSize(R.dimen.taskbar_phone_content_padding)
|
||||
repositionContextualContainer(startContextualContainer, buttonSize,
|
||||
roundedCornerContentMargin + contentPadding, 0, Gravity.TOP)
|
||||
repositionContextualContainer(endContextualContainer, buttonSize, 0,
|
||||
roundedCornerContentMargin + contentPadding, Gravity.BOTTOM)
|
||||
|
||||
startContextualContainer.addView(space, MATCH_PARENT, MATCH_PARENT)
|
||||
if (imeSwitcher != null) {
|
||||
endContextualContainer.addView(imeSwitcher)
|
||||
imeSwitcher.layoutParams = getParamsToCenterView()
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.taskbar.TaskbarActivityContext
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
@@ -34,7 +35,8 @@ class SetupNavLayoutter(
|
||||
startContextualContainer: ViewGroup,
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?
|
||||
a11yButton: ImageView?,
|
||||
space: Space,
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -43,7 +45,8 @@ class SetupNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.taskbar.TaskbarActivityContext
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
@@ -37,7 +38,8 @@ class TaskbarNavLayoutter(
|
||||
startContextualContainer: ViewGroup,
|
||||
imeSwitcher: ImageView?,
|
||||
rotationButton: RotationButton?,
|
||||
a11yButton: ImageView?
|
||||
a11yButton: ImageView?,
|
||||
space: Space
|
||||
) :
|
||||
AbstractNavButtonLayoutter(
|
||||
resources,
|
||||
@@ -46,7 +48,8 @@ class TaskbarNavLayoutter(
|
||||
startContextualContainer,
|
||||
imeSwitcher,
|
||||
rotationButton,
|
||||
a11yButton
|
||||
a11yButton,
|
||||
space
|
||||
) {
|
||||
|
||||
override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) {
|
||||
|
||||
+4
-1
@@ -9,6 +9,7 @@ import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import androidx.test.runner.AndroidJUnit4
|
||||
import com.android.launcher3.DeviceProfile
|
||||
import com.android.launcher3.R
|
||||
@@ -38,6 +39,7 @@ class NavButtonLayoutFactoryTest {
|
||||
private val mockImeSwitcher: ImageView = mock()
|
||||
private val mockRotationButton: RotationButton = mock()
|
||||
private val mockA11yButton: ImageView = mock()
|
||||
private val mockSpace: Space = mock()
|
||||
|
||||
private var surfaceRotation = Surface.ROTATION_0
|
||||
|
||||
@@ -201,7 +203,8 @@ class NavButtonLayoutFactoryTest {
|
||||
surfaceRotation = surfaceRotation,
|
||||
imeSwitcher = mockImeSwitcher,
|
||||
rotationButton = mockRotationButton,
|
||||
a11yButton = mockA11yButton
|
||||
a11yButton = mockA11yButton,
|
||||
space = mockSpace,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<item type="id" name="ime_switcher" />
|
||||
<item type="id" name="accessibility_button" />
|
||||
<item type="id" name="rotate_suggestion" />
|
||||
<item type="id" name="space" />
|
||||
<!-- /Do not change, must be kept in sync with sysui navbar button IDs for tests! -->
|
||||
|
||||
<item type="id" name="quick_settings_button" />
|
||||
|
||||
Reference in New Issue
Block a user