summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-05-09 09:02:27 -0700
committerKevin <kevhan@google.com>2019-05-10 12:13:00 -0700
commitb35b7dee18be3f2715e75a2aafe6bfaaa3815f65 (patch)
treef17d12262a83c96ddeb7f70eaba11a4bcb6934f6 /go
parent7b48548546fc51947358e18d0700a62bca2d3268 (diff)
downloadandroid_packages_apps_Trebuchet-b35b7dee18be3f2715e75a2aafe6bfaaa3815f65.tar.gz
android_packages_apps_Trebuchet-b35b7dee18be3f2715e75a2aafe6bfaaa3815f65.tar.bz2
android_packages_apps_Trebuchet-b35b7dee18be3f2715e75a2aafe6bfaaa3815f65.zip
Update scrim if insets are added later.
If insets are set after the activity requests the foreground scrim to be shown, the scrim will not be correctly added. This is an issue for fallback recents which requests the foreground scrim right after initialization. To fix this, we save the request to show the scrim in a local variable and check this on inset updates to determine whether we should show the scrim or not. Bug: 131853975 Test: Fallback recents now has foreground scrim added correctly Change-Id: I15a19a3184bbc97a20fbcbba2106fd7221410df0
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index a53a06e86..771c7d7fa 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -154,6 +154,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
private boolean mTransitionedFromApp;
private boolean mUsingRemoteAnimation;
private boolean mStartedEnterAnimation;
+ private boolean mShowStatusBarForegroundScrim;
private AnimatorSet mLayoutAnimation;
private final ArraySet<View> mLayingOutViews = new ArraySet<>();
private Rect mInsets;
@@ -409,7 +410,14 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
* @param showStatusBarForegroundScrim true to show the scrim, false to hide
*/
public void setShowStatusBarForegroundScrim(boolean showStatusBarForegroundScrim) {
- boolean shouldShow = mInsets.top != 0 && showStatusBarForegroundScrim;
+ mShowStatusBarForegroundScrim = showStatusBarForegroundScrim;
+ if (mShowStatusBarForegroundScrim != showStatusBarForegroundScrim) {
+ updateStatusBarScrim();
+ }
+ }
+
+ private void updateStatusBarScrim() {
+ boolean shouldShow = mInsets.top != 0 && mShowStatusBarForegroundScrim;
mActivity.getDragLayer().setForeground(shouldShow ? mStatusBarForegroundScrim : null);
}
@@ -838,6 +846,9 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
mInsets = insets;
mTaskRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
mTaskRecyclerView.invalidateItemDecorations();
+ if (mInsets.top != 0) {
+ updateStatusBarScrim();
+ }
}
/**