diff options
author | Lucas Dupin <dupin@google.com> | 2018-10-01 16:37:15 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2018-12-03 20:50:43 -0800 |
commit | d0ab1d0578052114475b1f704a16ffaadea400f5 (patch) | |
tree | f584a2615bd3299d161743170fe41d26724ba316 /quickstep/src/com/android/quickstep/RecentsModel.java | |
parent | 4d64da3259d83fa85b6db16a926276a5e283ac3f (diff) | |
download | android_packages_apps_Trebuchet-d0ab1d0578052114475b1f704a16ffaadea400f5.tar.gz android_packages_apps_Trebuchet-d0ab1d0578052114475b1f704a16ffaadea400f5.tar.bz2 android_packages_apps_Trebuchet-d0ab1d0578052114475b1f704a16ffaadea400f5.zip |
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 faa443308ef4de1be482d7d033209d8d6d8cff7b)
Diffstat (limited to 'quickstep/src/com/android/quickstep/RecentsModel.java')
-rw-r--r-- | quickstep/src/com/android/quickstep/RecentsModel.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/RecentsModel.java b/quickstep/src/com/android/quickstep/RecentsModel.java index 2e4d4d2b8..a62e6adfa 100644 --- a/quickstep/src/com/android/quickstep/RecentsModel.java +++ b/quickstep/src/com/android/quickstep/RecentsModel.java @@ -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); |