-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add FireDialog theme in order to fix navigation buttons hiden on some devices #863
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
Add FireDialog theme in order to fix navigation buttons hiden on some devices #863
Conversation
cmonfortep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great and it's simple to understand. I'm really looking forward for this fix!
I have only a comment related android:navigationBarColor, we should use it only for api > 27 to avoid some UI issues in low api devices.
Here a screenshot of how the bug looks like in api 21 (see that navigation buttons are also white and they are not visible):
Thanks!
app/src/main/res/values/styles.xml
Outdated
|
|
||
| <style name="FireDialog" parent="@style/Theme.Design.BottomSheetDialog"> | ||
| <item name="android:windowIsFloating">false</item> | ||
| <item name="android:navigationBarColor">?toolbarBgColor</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This produces a UI issue on low api devices. We had a similar issue in the past, where using white color makes all navigation buttons not visible. To avoid that bug I suggest you to create a new style for v27. I think we just need to keep this style here but without that attribute, and move this style to v27 style file.
Also, even if they are the same, I think is better to use colorPrimary instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realize about that issue, sure, sounds good to me, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem at all, it also happened to us in the past. Happy you can work on this and make it happen 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed android:navigationBarColor from the main style, and move it to v27 file and now it's working great. I tried on api 29 / 21 / 23. I tried with colorPrimary but the result was @color/almostBlackDark instead of the actual primary color, I found another style on v27 using <item name="android:navigationBarColor">?toolbarBgColor</item> so I think it's ok? Let me know if we can improve anything 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I noticed we can avoid the property <item name="android:navigationBarColor">?toolbarBgColor</item> and the navigationBar works fine, the nav buttons are visible, but the nav background is always black (I think it takes the navBar system default color)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About using ?toolbarBgColor, if we are already using that color is ok 👍
And about about low api devices always being black is also ok, it's our expected behavior to avoid problems the problems I described with navigation buttons.
…tyle to v27 theme file for better compatibility
cmonfortep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, code wise looks great. I'm going to approve it. I will merge it as soon as I do some final checks. I will let you know 👍
|
Thanks for the fix @ezanetta. This is now merged. |
Thanks Cristian, I'm glad I can help 😄 |

Resolves #754
Description:
FireDialog, and override some properties in order to fix this issue :)windowIsFloatingastruenavigationBarColoras?toolbarBgColor(light/dark theme)statusBarColoras@android:color/transparentTested on:
Live preview
Internal references:
Software Engineering Expectations
Technical Design Template