Skip to content

Commit

Permalink
[Pcct-SideSheet] Get rid of flashing glitch in maximization
Browse files Browse the repository at this point in the history
A regression due to the content visibility control using View.GONE
caused flashing glitch at the beginning/end of maximization.
This CL mitigates that. The content becomes hidden with
View.INVISIBLE but View.GONE is inserted during the animation.
This can both prevent the sluggish resizing and hide the flash.

(cherry picked from commit 420ef91)

Bug: 1451233
Change-Id: I076230554f598396ffa7cde90594f0e99c3b33a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4598627
Reviewed-by: Kevin Grosu <kgrosu@google.com>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1154468}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4608523
Cr-Commit-Position: refs/branch-heads/5790@{#656}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
JinsukKim authored and Chromium LUCI CQ committed Jun 12, 2023
1 parent e351087 commit 1d70e97
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -181,7 +181,12 @@ boolean toggleMaximize(boolean animate) {
} else {
start = windowLayout.width;
end = mIsMaximized ? displayWidth : clampedInitialWidth;
updateListener = (anim) -> setWindowWidth((int) anim.getAnimatedValue());
View content = (ViewGroup) mActivity.findViewById(R.id.compositor_view_holder);
updateListener = (anim) -> {
// Switch the invisibility type to GONE to prevent sluggish resizing artifacts.
if (content.getVisibility() != View.GONE) content.setVisibility(View.GONE);
setWindowWidth((int) anim.getAnimatedValue());
};
}
// Keep the WebContents invisible during the animation to hide the jerky visual artifacts
// of the contents due to resizing.
Expand All @@ -203,6 +208,7 @@ private void setContentVisible(boolean visible) {
}

private void onMaximizeEnd() {
setContentVisible(false);
if (isMaximized()) {
if (mSheetOnRight) {
configureLayoutBeyondScreen(false);
Expand Down

0 comments on commit 1d70e97

Please sign in to comment.