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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user