Snap for 7566880 from 56c33c3cb863afa8d8ad0d227277a6e4df24a9f8 to sc-release
Change-Id: I8d1c2ebee9c6bce87f79f9a3538f0806885a4741
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index 7ab371b..fac4d52 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -266,20 +266,32 @@
Gravity.apply(Gravity.CENTER, outWidth, outHeight, potentialTaskRect, outRect);
}
- private PointF getTaskDimension(Context context, DeviceProfile dp) {
+ private static PointF getTaskDimension(Context context, DeviceProfile dp) {
PointF dimension = new PointF();
+ getTaskDimension(context, dp, dimension);
+ return dimension;
+ }
+
+ /**
+ * Gets the dimension of the task in the current system state.
+ */
+ public static void getTaskDimension(Context context, DeviceProfile dp, PointF out) {
if (dp.isMultiWindowMode) {
WindowBounds bounds = SplitScreenBounds.INSTANCE.getSecondaryWindowBounds(context);
- dimension.x = bounds.availableSize.x;
- dimension.y = bounds.availableSize.y;
+ if (TaskView.CLIP_STATUS_AND_NAV_BARS) {
+ out.x = bounds.availableSize.x;
+ out.y = bounds.availableSize.y;
+ } else {
+ out.x = bounds.availableSize.x + bounds.insets.left + bounds.insets.right;
+ out.y = bounds.availableSize.y + bounds.insets.top + bounds.insets.bottom;
+ }
} else if (TaskView.CLIP_STATUS_AND_NAV_BARS) {
- dimension.x = dp.availableWidthPx;
- dimension.y = dp.availableHeightPx;
+ out.x = dp.availableWidthPx;
+ out.y = dp.availableHeightPx;
} else {
- dimension.x = dp.widthPx;
- dimension.y = dp.heightPx;
+ out.x = dp.widthPx;
+ out.y = dp.heightPx;
}
- return dimension;
}
/**
diff --git a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
index c515bdf..7cfd151 100644
--- a/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
+++ b/quickstep/src/com/android/quickstep/util/RecentsOrientedState.java
@@ -25,6 +25,7 @@
import static com.android.launcher3.states.RotationHelper.ALLOW_ROTATION_PREFERENCE_KEY;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SettingsCache.ROTATION_SETTING_URI;
+import static com.android.quickstep.BaseActivityInterface.getTaskDimension;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -49,7 +50,6 @@
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.SettingsCache;
-import com.android.launcher3.util.WindowBounds;
import com.android.quickstep.BaseActivityInterface;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.views.TaskView;
@@ -401,12 +401,7 @@
fullHeight -= insets.top + insets.bottom;
}
- if (dp.isMultiWindowMode) {
- WindowBounds bounds = SplitScreenBounds.INSTANCE.getSecondaryWindowBounds(mContext);
- outPivot.set(bounds.availableSize.x, bounds.availableSize.y);
- } else {
- outPivot.set(fullWidth, fullHeight);
- }
+ getTaskDimension(mContext, dp, outPivot);
float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height());
// We also scale the preview as part of fullScreenParams, so account for that as well.
if (fullWidth > 0) {
diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
index a88b8b7..1c2534d 100644
--- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java
+++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java
@@ -278,12 +278,7 @@
mIgnoreDragGesture |= absDeltaY > mConfig.getScaledPagingTouchSlop();
if (!mIsDragging && !mIgnoreDragGesture && mRv.supportsFastScrolling()) {
- // condition #1: triggering thumb is distance, angle based
- if ((isNearThumb(mDownX, mLastY)
- && absDeltaY > mConfig.getScaledPagingTouchSlop()
- && absDeltaY > absDeltaX)
- // condition#2: Fastscroll function is now time based
- || (isNearScrollBar(mDownX) && ev.getEventTime() - mDownTimeStampMillis
+ if ((isNearThumb(mDownX, mLastY) && ev.getEventTime() - mDownTimeStampMillis
> FASTSCROLL_THRESHOLD_MILLIS)) {
calcTouchOffsetAndPrepToFastScroll(mDownY, mLastY);
}
@@ -433,9 +428,6 @@
}
private void updatePopupY(int lastTouchY) {
- if (!mPopupVisible) {
- return;
- }
int height = mPopupView.getHeight();
// Aligns the rounded corner of the pop up with the top of the thumb.
float top = mRv.getScrollBarTop() + lastTouchY + (getScrollThumbRadius() / 2f)
diff --git a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
index 47f30be..d3a0190 100644
--- a/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/PendingAppWidgetHostView.java
@@ -85,7 +85,6 @@
setBackgroundResource(R.drawable.pending_widget_bg);
setWillNotDraw(false);
- setElevation(getResources().getDimension(R.dimen.pending_widget_elevation));
updateAppWidget(null);
setOnClickListener(ItemClickHandler.INSTANCE);