mihon icon indicating copy to clipboard operation
mihon copied to clipboard

Fixing bottom sheet UI bug in non-tablet devices

Open theolm opened this issue 2 years ago • 0 comments

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

https://github.com/mihonapp/mihon/assets/9647399/7dc53e87-684a-4292-866d-4bee11dc54f7

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 avatar Jan 21 '24 22:01 theolm