Assigned
Status Update
Comments
br...@gmail.com <br...@gmail.com> #2
Hey hughesno1@, when do you add the onPreDrawListener to delay the rendering of activity? Mind providing us with a sample application?
No update yet.
Hey hughesno1@, when do you add the onPreDrawListener to delay the rendering of activity? Mind providing us with a sample application?
Description
Component used: androidx.core:core-splashscreen
Version used: 1.0.0
Devices/Android versions reproduced on:
Issue Description
When using the Splashscreen API with an app that uses a
NavigationView
(within aDrawerLayout
) that has anandroid:theme
attribute set , the drawer menu items are not rendered correctly when the drawer is opened.The attached screenshots and demo project highlight the issue. The project is a minimal reproduction using the "Navigation Drawer Activity" template available in the New Project wizard in Android Studio. The only addition I made was to add a
<style name="Demo.NavDrawerMenuStyle" parent="Widget.MaterialComponents.NavigationView">
style and apply it using:Note that the custom style in the demo project sets values for the background and text appearance, but these are not necessary to reproduce the issue. You can use a simple style that inherits from
Widget.MaterialComponents.NavigationView
with no other additions/overrides, and the issue will still happen.When I build and run the project without using the splashscreen API, it produces a working nav drawer as shown in the "working_drawer" screenshot that is attached.
Then, I added the splashscreen API, setup a basic splash screen theme, per the documentation , and called
installSplashscreen()
in the Activity'sonCreate
.Now, when I build and run the app, the nav drawer is not rendered correctly. When opened, the menu items are displayed flush left as shown in the attached "broken_drawer" screenshot. They have lost their padding, and you can even see that the current item which is highlighted goes outside the bounds of the highlight.
Below are the steps to reproduce the issue using the attached demo app.
Prerequisites
The demo app has been downloaded, unzipped, and opened in Android Studio.
Steps to Reproduce
Expected Results
The Menu displays properly (see attached "working_drawer" screenshot), showing the Menu Items with appropriate start/left padding.
Actual Results
The Menu is not displayed properly (see attached "broken_drawer" screenshot). The menu items are flush left, with no padding.