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

Commit 320af649 authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

SystemUI: fix recents task view height calculation



Initialize search bar height early enough for layouts to catch it and
not cause jumpiness in certain situations. For instance on a device with
a soft navigation bar, hitting recents from any application, right after
the animation would finish, it would relize its layout was incorrect and
relayout the thumbnails causing a jump.

Change-Id: Id3b5688cabc361db5e874f3f0426c333c006ba2b
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
(cherry picked from commit 8d9044cc)
parent da40de71
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -272,14 +272,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
                    addSearchBarAppWidgetView();
                }
            }

            // Update search bar space height
            if (showSearchBar) {
                RecentsConfiguration.searchBarSpaceHeightPx = getResources().getDimensionPixelSize(
                    R.dimen.recents_search_bar_space_height);
            } else {
                RecentsConfiguration.searchBarSpaceHeightPx = 0;
            }
        }

        // Animate the SystemUI scrims into view
+11 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ public class RecentsConfiguration {

    /** Search bar */
    int searchBarAppWidgetId = -1;
    public static int searchBarSpaceHeightPx;
    public int searchBarSpaceHeightPx;

    /** Task stack */
    public int taskStackScrollDuration;
@@ -284,6 +284,8 @@ public class RecentsConfiguration {
        altTabKeyDelay = res.getInteger(R.integer.recents_alt_tab_key_delay);
        fakeShadows = res.getBoolean(R.bool.config_recents_fake_shadows);
        svelteLevel = res.getInteger(R.integer.recents_svelte_level);

        updateShowSearch(context);
    }

    /** Updates the system insets */
@@ -306,6 +308,14 @@ public class RecentsConfiguration {
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED) != 0;
        lockToAppEnabled = ssp.getSystemSetting(context,
                Settings.System.LOCK_TO_APP_ENABLED) != 0;
        updateShowSearch(context);
    }

    private void updateShowSearch(Context context) {
        boolean showSearchBar = Settings.System.getInt(context.getContentResolver(),
                Settings.System.RECENTS_SHOW_SEARCH_BAR, 1) == 1;
        searchBarSpaceHeightPx = showSearchBar ? context.getResources().getDimensionPixelSize(
                R.dimen.recents_search_bar_space_height): 0;
    }

    /** Called when the configuration has changed, and we want to reset any configuration specific