Snap for 5228332 from 6a4b70c773 to qt-release

Change-Id: I10976485735562a993f3dea38c410156f802b169
This commit is contained in:
android-build-team Robot
2019-01-13 04:06:09 +00:00
4 changed files with 41 additions and 7 deletions
+2
View File
@@ -20,6 +20,8 @@
<dimen name="task_thumbnail_half_top_margin">12dp</dimen>
<dimen name="task_thumbnail_icon_size">48dp</dimen>
<dimen name="task_corner_radius">8dp</dimen>
<!-- For screens without rounded corners -->
<dimen name="task_corner_radius_small">2dp</dimen>
<dimen name="recents_page_spacing">10dp</dimen>
<dimen name="recents_clear_all_deadzone_vertical_margin">70dp</dimen>
<dimen name="quickscrub_adjacent_visible_width">20dp</dimen>
@@ -629,9 +629,12 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
// Animate window corner radius from 100% to windowCornerRadius.
float windowCornerRadius = RecentsModel.INSTANCE.get(mLauncher)
.getWindowCornerRadius();
float circleRadius = iconWidth / 2f;
float windowRadius = Utilities.mapRange(easePercent, circleRadius,
windowCornerRadius);
float windowRadius = 0;
if (RecentsModel.INSTANCE.get(mLauncher).supportsRoundedCornersOnWindows()) {
float circleRadius = iconWidth / 2f;
windowRadius = Utilities.mapRange(easePercent, circleRadius,
windowCornerRadius);
}
// Animate the window crop so that it starts off as a square, and then reveals
// horizontally.
@@ -66,6 +66,7 @@ public class RecentsModel extends TaskStackChangeListener {
private final TaskThumbnailCache mThumbnailCache;
private float mWindowCornerRadius = -1;
private Boolean mSupportsRoundedCornersOnWindows;
private RecentsModel(Context context) {
@@ -200,6 +201,26 @@ public class RecentsModel extends TaskStackChangeListener {
return mWindowCornerRadius;
}
public boolean supportsRoundedCornersOnWindows() {
if (mSupportsRoundedCornersOnWindows == null) {
if (mSystemUiProxy != null) {
try {
mSupportsRoundedCornersOnWindows =
mSystemUiProxy.supportsRoundedCornersOnWindows();
} catch (RemoteException e) {
Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner "
+ "radius");
return false;
}
} else {
Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius");
return false;
}
}
return mSupportsRoundedCornersOnWindows;
}
public void onTrimMemory(int level) {
if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
mThumbnailCache.getHighResLoadingState().setVisible(false);
@@ -87,6 +87,8 @@ public class ClipAnimationHelper {
private final float mWindowCornerRadius;
// Corner radius of windows when they're in overview mode.
private final float mTaskCornerRadius;
// If windows can have real time rounded corners.
private final boolean mSupportsRoundedCornersOnWindows;
// Corner radius currently applied to transformed window.
private float mCurrentCornerRadius;
@@ -103,8 +105,12 @@ public class ClipAnimationHelper {
(t, a1) -> a1;
public ClipAnimationHelper(Context context) {
mTaskCornerRadius = context.getResources().getDimension(R.dimen.task_corner_radius);
mWindowCornerRadius = RecentsModel.INSTANCE.get(context).getWindowCornerRadius();
mWindowCornerRadius = RecentsModel.INSTANCE.get(context).getWindowCornerRadius();
mSupportsRoundedCornersOnWindows = RecentsModel.INSTANCE.get(context)
.supportsRoundedCornersOnWindows();
int taskCornerRadiusRes = mSupportsRoundedCornersOnWindows ?
R.dimen.task_corner_radius : R.dimen.task_corner_radius_small;
mTaskCornerRadius = context.getResources().getDimension(taskCornerRadiusRes);
}
private void updateSourceStack(RemoteAnimationTargetCompat target) {
@@ -186,8 +192,10 @@ public class ClipAnimationHelper {
mTmpMatrix.setRectToRect(mSourceRect, currentRect, ScaleToFit.FILL);
mTmpMatrix.postTranslate(app.position.x, app.position.y);
mClipRectF.roundOut(crop);
cornerRadius = Utilities.mapRange(progress, mWindowCornerRadius,
mTaskCornerRadius);
if (mSupportsRoundedCornersOnWindows) {
cornerRadius = Utilities.mapRange(progress, mWindowCornerRadius,
mTaskCornerRadius);
}
mCurrentCornerRadius = cornerRadius;
}