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

Fixing bottom sheet UI bug in non-tablet devices #182

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

theolm
Copy link
Contributor

@theolm theolm commented Jan 21, 2024

Description

All bottom sheets (dialogs) were experiencing a UI bug on API 30 and lower, where the bottom part was being cut off by the system bar. This became more noticeable when using the navigation bar. Additionally, on some devices, the dialog was adding extra padding, causing a flick in the animation.

Another thing worth mentioning is that users on lower versions were having a different experience, as the modal was not presented in the same way as on more recent Android versions (without padding and dim background).

Fix proposal

The proposed solution is simple: set decorFitsSystemWindows of the Dialog to true, so that internally the theme R.style.DialogWindowTheme is used. Additionally, extra paddings for the status bar and navigation bar were included.

I didn't understand why decorFitsSystemWindows was intentionally set to false. If this solution is not accepted, I can look for other alternatives.

Images

Bug 1 Bug 2
Expected (API34) Fix (API29)

Video

fix.mp4

I'm thrilled to hear that you've decided to keep this fork! I've always wanted to contribute to the repository but never found the time. Looking forward to contributing more in the future.

@theolm theolm marked this pull request as ready for review January 21, 2024 23:00
@AntsyLich AntsyLich merged commit 915a967 into mihonapp:main Jan 28, 2024
1 check passed
@theolm theolm deleted the bottom-sheet-ui-bug branch January 28, 2024 17:31
kaiserbh pushed a commit to kaiserbh/mihon that referenced this pull request Feb 18, 2024
* replace the windowInsetsPadding for navigationBarsPadding + statusBarsPadding

* Setting decorFitsSystemWindows = true to fix ui bug on Android 11

(cherry picked from commit 915a967)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants