Fix horizontal ChapterNavigator overlapping system nav buttons in landscape#1660
Fix horizontal ChapterNavigator overlapping system nav buttons in landscape#1660cuong-tran wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a UI layout issue where the horizontal 'ChapterNavigator' overlaps with system navigation buttons when the device is in landscape mode. By introducing a configurable modifier to the navigation components and applying appropriate window insets, the UI now correctly respects system navigation bar boundaries. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. In landscape view the buttons hide, / The navigator spans too wide. / With insets set to keep the space, / The UI finds its proper place. Footnotes
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a standard Compose modifier parameter to ChapterNavigator variants and wires it through ReaderAppBars so the horizontal chapter navigator respects horizontal navigation bar insets in landscape, preventing overlap with system navigation buttons. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Code Review
This pull request introduces a modifier parameter to the ChapterNavigator and ChapterNavigatorVert components to handle window insets, specifically ensuring that horizontal navigation bars are respected. While the implementation allows for better layout control, feedback indicates that several call sites for vertical navigators in ReaderAppBars.kt were not updated, which may result in UI elements overlapping with system navigation buttons in landscape mode.
| totalPages = totalPages, | ||
| onPageIndexChange = onPageIndexChange, | ||
| // KMK --> | ||
| modifier = modifier, |
There was a problem hiding this comment.
The call sites for vertical navigators in ReaderAppBars.kt (around lines 175 and 209) were not updated to pass the horizontal inset modifier. This means the vertical sliders might still overlap with system navigation buttons in landscape mode, even though ChapterNavigatorVert now supports the modifier parameter. Consider applying the same inset logic to those call sites as well.
References
- Avoid making purely positive or complimentary comments that do not suggest any action or improvement.
…dscape In landscape mode with floating system navigation buttons, the horizontal ChapterNavigator (NavBarType.Bottom) spanned the full screen width without accounting for system navigation bar insets, causing it to overlap with the floating nav buttons. Add a modifier parameter to ChapterNavigator/ChapterNavigatorVert and pass WindowInsets.navigationBars horizontal insets from ReaderAppBars when the navigator is displayed horizontally at the bottom. Co-authored-by: Cuong-Tran <cuong-tran@users.noreply.github.com>
122870a to
c6b9a35
Compare
In landscape mode with floating system navigation buttons, the horizontal
ChapterNavigator(NavBarType.Bottom) spans the full screen width without accounting for system navigation bar insets, causing it to overlap with the floating nav buttons.Changes
modifierparameter toChapterNavigatorandChapterNavigatorVert(standard Compose convention, defaults toModifier)ReaderAppBars, passWindowInsets.navigationBars.only(WindowInsetsSides.Horizontal)to the horizontalChapterNavigatorso it respects system navigation bar padding on the left/right edgesReaderBottomBaralready handles its ownwindowInsetsPadding(WindowInsets.navigationBars)independentlyFiles changed
ChapterNavigator.kt— addedmodifierparameter to bothChapterNavigatorandChapterNavigatorVert, applied to root layout elementsReaderAppBars.kt— addedWindowInsetsSides/onlyimports, passed horizontal navigation bar insets modifier to the bottomChapterNavigatorAdd a 👍 reaction to pull requests you find important.
Summary by Sourcery
Ensure the reader chapter navigator respects system navigation insets in landscape mode to avoid overlapping system navigation buttons.
New Features:
Bug Fixes: