From f495102326e6a5a39b5d8aa33753d3d4cde47cb9 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 3 Jan 2024 18:24:00 -0600 Subject: [PATCH] Ensure header view expected height accounts for tabs. This was already handled except for the case where there were no predicted apps and no all apps divider, i.e. suggested apps are disabled and a work profile is added (so tabs show instead of the divider). Why did the other cases work? Predicted apps and the divider are FloatingHeaderRows which call FloatingHeaderView#onHeightUpdated whenever they are updated (triggering updateExpectedHeight()). And why did this sometimes "fix itself" until a reboot? When the search bar is tapped, the search transition causes the expected height to be updated. So that is my guess. The key to this change is to wait to update the expected height until after we have defined mTabsHidden during setup(). It is normal for the header to be initialized without tabs and then updated to show the tabs when the work apps are available. So this was previously incorrectly using mTabsHidden=true for the calculations. Fix: 245516031 Test: Manual (force stop launcher and verify tabs scroll correctly) Flag: NA Change-Id: Ifcc2f39649c5494b5f3ebefc1cdddfbefbe5d9a0 --- src/com/android/launcher3/allapps/FloatingHeaderView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/FloatingHeaderView.java b/src/com/android/launcher3/allapps/FloatingHeaderView.java index 1ba5f8e8cf..a1f6ebe557 100644 --- a/src/com/android/launcher3/allapps/FloatingHeaderView.java +++ b/src/com/android/launcher3/allapps/FloatingHeaderView.java @@ -225,10 +225,10 @@ public class FloatingHeaderView extends LinearLayout implements for (FloatingHeaderRow row : mAllRows) { row.setup(this, mAllRows, tabsHidden); } - updateExpectedHeight(); mTabsHidden = tabsHidden; maybeSetTabVisibility(VISIBLE); + updateExpectedHeight(); mMainRV = mainRV; mWorkRV = workRV; mSearchRV = searchRV;