Maintain selected or last header on clicking "Show all" button

Bug: 356127021
Test: Manual and tapl test
Flag: com.android.launcher3.enable_tiered_widgets_by_default_in_picker
Change-Id: I762695f9999e5ea4c722dbedde6d7efabd3ab0cb
This commit is contained in:
Shamali P
2024-11-11 13:51:36 +00:00
committed by Shamali Patwa
parent 2e8707dffb
commit 697dcf44ac
4 changed files with 39 additions and 11 deletions

View File

@@ -120,7 +120,19 @@ public class StickyHeaderLayout extends LinearLayout implements
}
private float getCurrentScroll() {
return mScrollOffset + (mCurrentEmptySpaceView == null ? 0 : mCurrentEmptySpaceView.getY());
float scroll;
if (mCurrentRecyclerView.getVisibility() != VISIBLE) {
// When no list is displayed, assume no scroll.
scroll = 0f;
} else if (mCurrentEmptySpaceView != null) {
// Otherwise use empty space view as reference to position.
scroll = mCurrentEmptySpaceView.getY();
} else {
// If there is no empty space view, but the list is visible, we are scrolled away
// completely, so assume all non-sticky children should also be scrolled away.
scroll = -mHeaderHeight;
}
return mScrollOffset + scroll;
}
@Override