I'm using the bottom sheet fragment to display a pop up. I've used https://stackoverflow.com/a/51329005/5519745 to set the navigation bar color. However in a few devices there is a gap between the navigation bar and the bottom sheet dialog.
Asked
Active
Viewed 866 times
1 Answers
2
I have used the same stack overflow solution as you to set a white background on the navigation bar and encountered the same problem.
I solved the issue by updating setWhiteNavigationBar setLayerInsetTop metrics.heightPixels field to a small minus of whatever desired to bring the bottom sheet down a bit.
Hope this helps.
Original
windowBackground.setLayerInsetTop(1, metrics.heightPixels);
Amended
windowBackground.setLayerInsetTop(1, metrics.heightPixels - 2);

Sam L
- 121
- 7