Merge "Use DisplayController.Info to determine if it's a tablet" into udc-qpr-dev am: 96fc36f614
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23835676 Change-Id: Ia4b95d8ace26619a0993eddbdb4139f872035cc1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -239,7 +239,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
|
|||||||
public void onDisplayInfoChanged(Context context, Info info, int flags) {
|
public void onDisplayInfoChanged(Context context, Info info, int flags) {
|
||||||
if ((flags & (CHANGE_ROTATION | CHANGE_NAVIGATION_MODE)) != 0) {
|
if ((flags & (CHANGE_ROTATION | CHANGE_NAVIGATION_MODE)) != 0) {
|
||||||
mMode = info.navigationMode;
|
mMode = info.navigationMode;
|
||||||
mNavBarPosition = new NavBarPosition(mContext, mMode, info);
|
mNavBarPosition = new NavBarPosition(mMode, info);
|
||||||
|
|
||||||
if (mMode == NO_BUTTON) {
|
if (mMode == NO_BUTTON) {
|
||||||
mExclusionListener.register();
|
mExclusionListener.register();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class FallbackNavBarTouchController implements TouchController,
|
|||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
NavigationMode sysUINavigationMode = DisplayController.getNavigationMode(mActivity);
|
NavigationMode sysUINavigationMode = DisplayController.getNavigationMode(mActivity);
|
||||||
if (sysUINavigationMode == NavigationMode.NO_BUTTON) {
|
if (sysUINavigationMode == NavigationMode.NO_BUTTON) {
|
||||||
NavBarPosition navBarPosition = new NavBarPosition(mActivity, sysUINavigationMode,
|
NavBarPosition navBarPosition = new NavBarPosition(sysUINavigationMode,
|
||||||
DisplayController.INSTANCE.get(mActivity).getInfo());
|
DisplayController.INSTANCE.get(mActivity).getInfo());
|
||||||
mTriggerSwipeUpTracker = new TriggerSwipeUpTouchTracker(mActivity,
|
mTriggerSwipeUpTracker = new TriggerSwipeUpTouchTracker(mActivity,
|
||||||
true /* disableHorizontalSwipe */, navBarPosition,
|
true /* disableHorizontalSwipe */, navBarPosition,
|
||||||
|
|||||||
@@ -60,12 +60,11 @@ public class NavBarGestureHandler implements OnTouchListener,
|
|||||||
NavBarGestureHandler(Context context) {
|
NavBarGestureHandler(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
DisplayController.Info displayInfo = DisplayController.INSTANCE.get(mContext).getInfo();
|
DisplayController.Info displayInfo = DisplayController.INSTANCE.get(mContext).getInfo();
|
||||||
final int displayRotation = displayInfo.rotation;
|
|
||||||
Point currentSize = displayInfo.currentSize;
|
Point currentSize = displayInfo.currentSize;
|
||||||
mDisplaySize.set(currentSize.x, currentSize.y);
|
mDisplaySize.set(currentSize.x, currentSize.y);
|
||||||
mSwipeUpTouchTracker =
|
mSwipeUpTouchTracker =
|
||||||
new TriggerSwipeUpTouchTracker(context, true /*disableHorizontalSwipe*/,
|
new TriggerSwipeUpTouchTracker(context, true /*disableHorizontalSwipe*/,
|
||||||
new NavBarPosition(mContext, NavigationMode.NO_BUTTON, displayRotation),
|
new NavBarPosition(NavigationMode.NO_BUTTON, displayInfo),
|
||||||
null /*onInterceptTouch*/, this);
|
null /*onInterceptTouch*/, this);
|
||||||
mMotionPauseDetector = new MotionPauseDetector(context);
|
mMotionPauseDetector = new MotionPauseDetector(context);
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,7 @@
|
|||||||
package com.android.quickstep.util;
|
package com.android.quickstep.util;
|
||||||
|
|
||||||
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
|
import static com.android.launcher3.util.NavigationMode.NO_BUTTON;
|
||||||
import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
|
|
||||||
import com.android.launcher3.util.DisplayController.Info;
|
import com.android.launcher3.util.DisplayController.Info;
|
||||||
@@ -29,26 +27,22 @@ import com.android.launcher3.util.NavigationMode;
|
|||||||
*/
|
*/
|
||||||
public class NavBarPosition {
|
public class NavBarPosition {
|
||||||
|
|
||||||
private final boolean mIsLargeScreen;
|
private final boolean mIsTablet;
|
||||||
private final NavigationMode mMode;
|
private final NavigationMode mMode;
|
||||||
private final int mDisplayRotation;
|
private final int mDisplayRotation;
|
||||||
|
|
||||||
public NavBarPosition(Context context, NavigationMode mode, Info info) {
|
public NavBarPosition(NavigationMode mode, Info info) {
|
||||||
this(context, mode, info.rotation);
|
mIsTablet = info.isTablet(info.realBounds);
|
||||||
}
|
|
||||||
|
|
||||||
public NavBarPosition(Context context, NavigationMode mode, int displayRotation) {
|
|
||||||
mIsLargeScreen = isLargeScreen(context);
|
|
||||||
mMode = mode;
|
mMode = mode;
|
||||||
mDisplayRotation = displayRotation;
|
mDisplayRotation = info.rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRightEdge() {
|
public boolean isRightEdge() {
|
||||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_90 && !mIsLargeScreen;
|
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_90 && !mIsTablet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLeftEdge() {
|
public boolean isLeftEdge() {
|
||||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_270 && !mIsLargeScreen;
|
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_270 && !mIsTablet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getRotation() {
|
public float getRotation() {
|
||||||
|
|||||||
Reference in New Issue
Block a user