Search code examples
androidmaterial-designandroid-bottomnavigationview

Weird behaviour using MaterialComponents and BottomNavigationView. Android


I am using BottomNavigationView from material design library and everything seems to be ok.

enter image description here

I need to use new badges so I have upgrade it to version 'com.google.android.material:material:1.1.0'

But I don't know why changing the version draws like an inverse triangle inside my bottomNavigationView. Its bit difficult to see in black background. But it is there and I have no idea why but it happens in all my devices after upgrading.

This is my BottomNavView xml

  <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomNavigationView"
        style="@style/MainBottomMenu"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:itemIconSize="@dimen/bottom_nav_icon_size"
        app:labelVisibilityMode="labeled"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/bottom_nav_menu" />


 <style name="MainBottomMenu">
        <item name="android:background">@color/gray_25t</item>
        <item name="itemIconTint">@drawable/nav_item_color_state_light</item>
        <item name="itemTextColor">@drawable/nav_item_color_state_light</item>
        <item name="android:paddingTop">@dimen/padding_nano</item>
    </style>

Thanks for any help.

enter image description here


Solution

  • Finally solved setting elevation to 0 dp

    https://github.com/material-components/material-components-android/issues/1077