Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding bottom padding to Page Indicator to avoid phone's frame hide it #1140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OdisBy
Copy link

@OdisBy OdisBy commented Aug 20, 2024

This fixes #1105

The Page Indicator at the bottom of the page was being cut in half because of Samsung's Phone Frame, and it is not possible to read the page number.

The padding I'm using is based on other places in the app that use the same padding at the bottom to avoid this.

note: This is my first PR to Mihon repository

Images

Image 1 Image 2
mihon-no-padding

@@ -35,6 +38,7 @@ fun PageIndicatorText(
)

Box(
modifier = Modifier.padding(bottom = 12.dp),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the way. You need to apply insets as padding instead of some arbitrary value. THo I've tried doing it but was unsuccessful.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also having issues with WindowInsets. I guess it's because we're hiding the bottom buttons of the phone, and this causes it not to behave as usual.

But I'll try a few more ways to work around this without using a fixed value for the padding.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't come to a conclusion about which WindowInsets to use. We have safeGestures and safeContent that work, but I'm not sure if they are the most appropriate for this case.

We also have navigationBarsIgnoringVisibility, which seems the most correct in this situation in my view, and it works very well when the phone is using the Navigation Bar with Swipe Gestures. However, when using the Navigation Bar with buttons, the padding becomes really large.

Can you help me decide which direction to take?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page number not completely visible on some devices
2 participants