Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f59527d authored by Massimo Carli's avatar Massimo Carli
Browse files

Fix Restart and Resize hints flickering

The flicker was due to a change in the size of the layout when the
hint was displayed. This was triggering a relayout which appeared as
a flicker.

Avoiding the resize of the layout using invisible instead of gone fixes
the problem.

Flag: EXEMPT Bug fixing
Fix: 322463856
Test: atest WMShellUnitTests:CompatUIWindowManagerTest
Test: atest WMShellUnitTests:UserAspectRatioSettingsLayoutTest

Change-Id: Ibe98841a3d951e9dde54b899781c741b6d71a5e3
parent c9ba5f85
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@
    android:gravity="bottom|end">

    <include android:id="@+id/size_compat_hint"
        android:visibility="gone"
        android:visibility="invisible"
        android:layout_width="@dimen/compat_hint_width"
        android:layout_height="wrap_content"
        layout="@layout/compat_mode_hint"/>

    <ImageButton
        android:id="@+id/size_compat_restart_button"
        android:visibility="gone"
        android:visibility="invisible"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/compat_button_margin"
+2 −2
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@
    android:gravity="bottom|end">

    <include android:id="@+id/user_aspect_ratio_settings_hint"
        android:visibility="gone"
        android:visibility="invisible"
        android:layout_width="@dimen/compat_hint_width"
        android:layout_height="wrap_content"
        layout="@layout/compat_mode_hint"/>

    <ImageButton
        android:id="@+id/user_aspect_ratio_settings_button"
        android:visibility="gone"
        android:visibility="invisible"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/compat_button_margin"
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class CompatUILayout extends LinearLayout {

    private void setViewVisibility(@IdRes int resId, boolean show) {
        final View view = findViewById(resId);
        int visibility = show ? View.VISIBLE : View.GONE;
        int visibility = show ? View.VISIBLE : View.INVISIBLE;
        if (view.getVisibility() == visibility) {
            return;
        }
+2 −2
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ public class UserAspectRatioSettingsLayout extends LinearLayout {

    private void setViewVisibility(@IdRes int resId, boolean show) {
        final View view = findViewById(resId);
        int visibility = show ? View.VISIBLE : View.GONE;
        int visibility = show ? View.VISIBLE : View.INVISIBLE;
        if (view.getVisibility() == visibility) {
            return;
        }
@@ -171,7 +171,7 @@ public class UserAspectRatioSettingsLayout extends LinearLayout {
        fadeOut.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                view.setVisibility(View.GONE);
                view.setVisibility(View.INVISIBLE);
            }
        });
        fadeOut.start();