Rounded corners on app transitions

Test: Manualy launch an app
Test: Press home when activity is on top of the stack
Test: Quick scrub
Test: Swipe up on the home button, swipe down
Bug: 111514493
Fixes: 116745318
Change-Id: I66d25bc433061ede46107ea9651c198614306692
(cherry picked from commit faa443308e)
This commit is contained in:
Lucas Dupin authored and Winson Chung committed 2018-12-03 20:50:43 -08:00
1 parent 4d64da3259
commit d0ab1d0578
9 files changed
+73 -15

No files matched your search

@@ -45,6 +45,9 @@ import androidx.annotation.WorkerThread;
*/
@TargetApi(Build.VERSION_CODES.O)
public class RecentsModel extends TaskStackChangeListener {
private static final String TAG = "RecentsModel";
// We do not need any synchronization for this variable as its only written on UI thread.
public static final MainThreadInitializedObject<RecentsModel> INSTANCE =
new MainThreadInitializedObject<>(c -> new RecentsModel(c));
@@ -62,6 +65,9 @@ public class RecentsModel extends TaskStackChangeListener {
private final TaskIconCache mIconCache;
private final TaskThumbnailCache mThumbnailCache;
private float mWindowCornerRadius = -1;
private RecentsModel(Context context) {
mContext = context;
@@ -174,6 +180,26 @@ public class RecentsModel extends TaskStackChangeListener {
return mSystemUiProxy;
}
public float getWindowCornerRadius() {
// The window corner radius is expressed in pixels and won't change if the
// display density changes. It's safe to cache the value.
if (mWindowCornerRadius == -1) {
if (mSystemUiProxy != null) {
try {
mWindowCornerRadius = mSystemUiProxy.getWindowCornerRadius();
} catch (RemoteException e) {
Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner "
+ "radius");
return 0;
}
} else {
Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius");
return 0;
}
}
return mWindowCornerRadius;
}
public void onTrimMemory(int level) {
if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
mThumbnailCache.getHighResLoadingState().setVisible(false);