mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-05 10:26:52 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user