Scroll dash profile title off-screen with the app grid#77
Merged
Conversation
The per-profile dash title (Applications / profile name) sat in a row above the app grid and stayed pinned there even as the grid scrolled, permanently occupying screen space. Overlay the title on the grid's top padding instead (clipToPadding=false so the padding scrolls away with the apps) and translate the title in step with the grid's scroll, so it slides off-screen together with the first row of apps.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Problem 1: ViewPager2 crashes mid-scroll (e.g. on rotation) when a page's child ViewGroup has a LayoutTransition that animates the parent hierarchy. Add setAnimateParentHierarchy(false) to the grid's LayoutTransition. Problem 2: the title rested already scrolled off-screen on swiped-to pages. The collapse offset was derived from the first row's rest top, but that was inconsistent: AbsListView does not re-anchor already-filled rows when paddingTop changes at runtime, so applying the reserve-padding after the fill (via the title's layout listener) left the first row at top=0 and the title computed as fully scrolled. Reserve the padding in onBindViewHolder before the grid's adapter is set, from a one-off measured title height (a single line, identical for every profile), so the first fill of every page lands the first row at paddingTop. Reset the title baseline on bind and recompute the at-rest offset from a grid layout-change listener (the scroll listener never fires for a page whose apps fit without scrolling).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The per-profile dash title (Applications / profile name) sat in a row
above the app grid and stayed pinned there even as the grid scrolled,
permanently occupying screen space.
Overlay the title on the grid's top padding instead (clipToPadding=false
so the padding scrolls away with the apps) and translate the title in
step with the grid's scroll, so it slides off-screen together with the
first row of apps.