Merge "Only modify window layout params when necessary." into cw-f-dev am: 9fbd981f23 am: a26e371c9b

am: 49fa0405b1

Change-Id: Iadf40b31d57157bc1303102b6afc38d23afc3996
This commit is contained in:
Michael Kwan
2017-02-14 01:06:03 +00:00
committed by android-build-merger

View File

@@ -3022,10 +3022,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
@Override
public void onSwipeCancelled(SwipeDismissLayout layout) {
WindowManager.LayoutParams newParams = getAttributes();
newParams.x = 0;
newParams.alpha = 1;
setAttributes(newParams);
setFlags(FLAG_FULLSCREEN, FLAG_FULLSCREEN | FLAG_LAYOUT_NO_LIMITS);
// Swipe changes only affect the x-translation and alpha, check to see if
// those values have changed first before resetting them.
if (newParams.x != 0 || newParams.alpha != 1) {
newParams.x = 0;
newParams.alpha = 1;
setAttributes(newParams);
setFlags(FLAG_FULLSCREEN, FLAG_FULLSCREEN | FLAG_LAYOUT_NO_LIMITS);
}
}
});
}