summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-04-30 16:48:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-30 16:48:43 +0000
commit287f5d5aef7638d336a557aa53b90fc1af665079 (patch)
treeb44436f27ba87fb82f1aeac139cc20034a1525b4
parent32d475bca46577d4482d083fc42f8a5e6f82fea0 (diff)
parent8d86cf0bcc17e51c6fd303ec473ab91ea72af44f (diff)
downloadandroid_packages_apps_Trebuchet-287f5d5aef7638d336a557aa53b90fc1af665079.tar.gz
android_packages_apps_Trebuchet-287f5d5aef7638d336a557aa53b90fc1af665079.tar.bz2
android_packages_apps_Trebuchet-287f5d5aef7638d336a557aa53b90fc1af665079.zip
Merge "Fix some MW visual issues" into ub-launcher3-qt-dev
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java2
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java7
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java2
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java15
4 files changed, 20 insertions, 6 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java
index e5747dc71..624b3dc77 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java
@@ -137,7 +137,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
Rect targetRect = new Rect();
mHelper.getSwipeUpDestinationAndLength(mActivity.getDeviceProfile(), mActivity, targetRect);
clipHelper.updateTargetRect(targetRect);
- clipHelper.prepareAnimation(false /* isOpening */);
+ clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */);
ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams()
.setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView));
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java
index 5b9400201..f95f9c27e 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskViewUtils.java
@@ -26,8 +26,11 @@ import android.content.ComponentName;
import android.graphics.RectF;
import android.view.View;
+import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.ItemInfo;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.MultiValueUpdateListener;
@@ -134,7 +137,9 @@ public final class TaskViewUtils {
{
inOutHelper.setTaskAlphaCallback((t, alpha) -> mTaskAlpha.value);
- inOutHelper.prepareAnimation(true /* isOpening */);
+ inOutHelper.prepareAnimation(
+ BaseActivity.fromContext(v.getContext()).getDeviceProfile(),
+ true /* isOpening */);
inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(),
targetSet.apps.length == 0 ? null : targetSet.apps[0]);
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 52d301ca9..030827f52 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -730,7 +730,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
if (runningTaskTarget != null) {
mClipAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
}
- mClipAnimationHelper.prepareAnimation(false /* isOpening */);
+ mClipAnimationHelper.prepareAnimation(dp, false /* isOpening */);
initTransitionEndpoints(dp);
mRecentsAnimationWrapper.setController(targetSet);
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
index 1242d79dc..cb2bf1f79 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -81,6 +81,7 @@ public class ClipAnimationHelper {
private final RectF mClipRectF = new RectF();
private final RectFEvaluator mRectFEvaluator = new RectFEvaluator();
private final Matrix mTmpMatrix = new Matrix();
+ private final Rect mTmpRect = new Rect();
private final RectF mTmpRectF = new RectF();
private final RectF mCurrentRectWithInsets = new RectF();
// Corner radius of windows, in pixels
@@ -89,6 +90,8 @@ public class ClipAnimationHelper {
private final float mTaskCornerRadius;
// If windows can have real time rounded corners.
private final boolean mSupportsRoundedCornersOnWindows;
+ // Whether or not to actually use the rounded cornders on windows
+ private boolean mUseRoundedCornersOnWindows;
// Corner radius currently applied to transformed window.
private float mCurrentCornerRadius;
@@ -103,6 +106,7 @@ public class ClipAnimationHelper {
mWindowCornerRadius = getWindowCornerRadius(context.getResources());
mSupportsRoundedCornersOnWindows = supportsRoundedCornersOnWindows(context.getResources());
mTaskCornerRadius = TaskCornerRadius.get(context);
+ mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows;
}
private void updateSourceStack(RemoteAnimationTargetCompat target) {
@@ -144,8 +148,9 @@ public class ClipAnimationHelper {
mSourceRect.set(scaledTargetRect);
}
- public void prepareAnimation(boolean isOpening) {
+ public void prepareAnimation(DeviceProfile dp, boolean isOpening) {
mBoostModeTargetLayers = isOpening ? MODE_OPENING : MODE_CLOSING;
+ mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows && !dp.isMultiWindowMode;
}
public RectF applyTransform(RemoteAnimationTargetSet targetSet, TransformParams params) {
@@ -177,7 +182,9 @@ public class ClipAnimationHelper {
for (int i = 0; i < targetSet.unfilteredApps.length; i++) {
RemoteAnimationTargetCompat app = targetSet.unfilteredApps[i];
mTmpMatrix.setTranslate(app.position.x, app.position.y);
- Rect crop = app.sourceContainerBounds;
+ Rect crop = mTmpRect;
+ crop.set(app.sourceContainerBounds);
+ crop.offsetTo(0, 0);
float alpha = 1f;
int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers);
float cornerRadius = 0f;
@@ -188,7 +195,9 @@ public class ClipAnimationHelper {
mTmpMatrix.postTranslate(app.position.x, app.position.y);
mClipRectF.roundOut(crop);
if (mSupportsRoundedCornersOnWindows) {
- cornerRadius = Utilities.mapRange(params.progress, mWindowCornerRadius,
+ float windowCornerRadius = mUseRoundedCornersOnWindows
+ ? mWindowCornerRadius : 0;
+ cornerRadius = Utilities.mapRange(params.progress, windowCornerRadius,
mTaskCornerRadius);
mCurrentCornerRadius = cornerRadius;
}