I'm trying to create an application with similar to Google Photos
app UI. Support Libary Version = 25.1.0.
The problem in that with translucent status and navigation bars, widgets inside CoorinatorLayout
looks not as expected. Setting fitsSystemWindows=true
attribute for the BottomNavigationView
makes it too large (screenshot 1) and SnakBar
in that case appears behind navigation bar, not above BottomNavView
or nav bar as expected. If I add fitsSystemWindows=true
in Toolbar
(screenshot 2) then BottomNavigationView looses it's fitsSystemWindows
attribute and Toolbar
content gone somewhere. It looks as a support library bug, but I'm not sure in that.
Here is my DSL code:
coordinatorLayout {
customToolbar {
id = TOOLBAR
// fitsSystemWindows = true
title = createTitle(ctx)
lparams(matchParent, dip(48))
}
frameLayout {
id = CONTENT_FRAME
backgroundResource = R.color.colorBackground
lparams(matchParent, matchParent)
}
bottomNavigationView(R.style.Base_ThemeOverlay_AppCompat_Dark) {
id = BOTTOM_NAVIGATION_VIEW
fitsSystemWindows = true
itemIconTintList = ContextCompat.getColorStateList(ctx, R.drawable.nav_item_color_state)
itemTextColor = ContextCompat.getColorStateList(ctx, R.drawable.nav_item_color_state)
backgroundResource = R.color.colorAccent
inflateMenu(R.menu.menu_drawer_2)
lparams(matchParent) {
anchorGravity = Gravity.BOTTOM
anchorId = CONTENT_FRAME
}
}
}