Merge "Use DisplayController.Info to determine if it's a tablet" into udc-qpr-dev
This commit is contained in:
@@ -239,7 +239,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
|
||||
public void onDisplayInfoChanged(Context context, Info info, int flags) {
|
||||
if ((flags & (CHANGE_ROTATION | CHANGE_NAVIGATION_MODE)) != 0) {
|
||||
mMode = info.navigationMode;
|
||||
mNavBarPosition = new NavBarPosition(mContext, mMode, info);
|
||||
mNavBarPosition = new NavBarPosition(mMode, info);
|
||||
|
||||
if (mMode == NO_BUTTON) {
|
||||
mExclusionListener.register();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FallbackNavBarTouchController implements TouchController,
|
||||
mActivity = activity;
|
||||
NavigationMode sysUINavigationMode = DisplayController.getNavigationMode(mActivity);
|
||||
if (sysUINavigationMode == NavigationMode.NO_BUTTON) {
|
||||
NavBarPosition navBarPosition = new NavBarPosition(mActivity, sysUINavigationMode,
|
||||
NavBarPosition navBarPosition = new NavBarPosition(sysUINavigationMode,
|
||||
DisplayController.INSTANCE.get(mActivity).getInfo());
|
||||
mTriggerSwipeUpTracker = new TriggerSwipeUpTouchTracker(mActivity,
|
||||
true /* disableHorizontalSwipe */, navBarPosition,
|
||||
|
||||
@@ -60,12 +60,11 @@ public class NavBarGestureHandler implements OnTouchListener,
|
||||
NavBarGestureHandler(Context context) {
|
||||
mContext = context;
|
||||
DisplayController.Info displayInfo = DisplayController.INSTANCE.get(mContext).getInfo();
|
||||
final int displayRotation = displayInfo.rotation;
|
||||
Point currentSize = displayInfo.currentSize;
|
||||
mDisplaySize.set(currentSize.x, currentSize.y);
|
||||
mSwipeUpTouchTracker =
|
||||
new TriggerSwipeUpTouchTracker(context, true /*disableHorizontalSwipe*/,
|
||||
new NavBarPosition(mContext, NavigationMode.NO_BUTTON, displayRotation),
|
||||
new NavBarPosition(NavigationMode.NO_BUTTON, displayInfo),
|
||||
null /*onInterceptTouch*/, this);
|
||||
mMotionPauseDetector = new MotionPauseDetector(context);
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package com.android.quickstep.util;
|
||||
|
||||
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 com.android.launcher3.util.DisplayController.Info;
|
||||
@@ -29,26 +27,22 @@ import com.android.launcher3.util.NavigationMode;
|
||||
*/
|
||||
public class NavBarPosition {
|
||||
|
||||
private final boolean mIsLargeScreen;
|
||||
private final boolean mIsTablet;
|
||||
private final NavigationMode mMode;
|
||||
private final int mDisplayRotation;
|
||||
|
||||
public NavBarPosition(Context context, NavigationMode mode, Info info) {
|
||||
this(context, mode, info.rotation);
|
||||
}
|
||||
|
||||
public NavBarPosition(Context context, NavigationMode mode, int displayRotation) {
|
||||
mIsLargeScreen = isLargeScreen(context);
|
||||
public NavBarPosition(NavigationMode mode, Info info) {
|
||||
mIsTablet = info.isTablet(info.realBounds);
|
||||
mMode = mode;
|
||||
mDisplayRotation = displayRotation;
|
||||
mDisplayRotation = info.rotation;
|
||||
}
|
||||
|
||||
public boolean isRightEdge() {
|
||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_90 && !mIsLargeScreen;
|
||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_90 && !mIsTablet;
|
||||
}
|
||||
|
||||
public boolean isLeftEdge() {
|
||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_270 && !mIsLargeScreen;
|
||||
return mMode != NO_BUTTON && mDisplayRotation == Surface.ROTATION_270 && !mIsTablet;
|
||||
}
|
||||
|
||||
public float getRotation() {
|
||||
|
||||
Reference in New Issue
Block a user