diff options
| author | 2015-10-13 18:00:29 -0700 | |
|---|---|---|
| committer | 2015-10-14 09:22:42 -0700 | |
| commit | 2dfcf5ce2e96073d6cb875d048684e0a074ce2b6 (patch) | |
| tree | 5db36ab0dac2c569c66986a9896295d11c60c5d2 | |
| parent | 9f1181e968eebcfe7f7f9cfd4e6b7b11eb4b47b4 (diff) | |
Keep freeform window surface translucent during resize.
Freeform window surfaces are translucent because most of the time they
have shadows. During a resize we stop displaying the shadow, which
might change the surface opacity from translucent to opaque. This change
only happens if the activity gets recreated during the resize, as this
triggers recalculation of the necessary opacity. If configuration change
happens the relayout will now contain new, opaque pixel format and cause
the recreation. The second blink will happen after we finish resizing,
as the surface needs to become translucent again.
Bug: 24668341
Change-Id: I450323276c49f176f0f6dfb3b21a5f6d742a8418
| -rw-r--r-- | core/java/com/android/internal/policy/PhoneWindow.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index ab372d30e271..75ad916ab9b3 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -3705,13 +3705,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } /** - * Returns true if the Window is free floating and has a shadow. Note that non overlapping - * windows do not have a shadow since it could not be seen anyways (a small screen / tablet + * Returns true if the Window is free floating and has a shadow (although at some times + * it might not be displaying it, e.g. during a resize). Note that non overlapping windows + * do not have a shadow since it could not be seen anyways (a small screen / tablet * "tiles" the windows side by side but does not overlap them). * @return Returns true when the window has a shadow created by the non client decor. **/ private boolean windowHasShadow() { - return windowHasNonClientDecor() && getElevation() > 0; + return windowHasNonClientDecor() && nonClientDecorHasShadow(mWindow.mWorkspaceId); } void setWindow(PhoneWindow phoneWindow) { @@ -5417,7 +5418,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { * @param workspaceId The Id of the workspace which contains this window. * @Return Returns true if the window should show a shadow. **/ - private boolean nonClientDecorHasShadow(int workspaceId) { + private static boolean nonClientDecorHasShadow(int workspaceId) { return workspaceId == FREEFORM_WORKSPACE_STACK_ID; } |