-1

I want the ripple effect to go beyond the bounds of the BottomNavigationView. How can i do this?

I have this xml:

<com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/nav_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            app:menu="@menu/bottom_nav_menu" />

Thanks in advance!

Ole Pannier
  • 3,208
  • 9
  • 22
  • 33
wowandy
  • 1,124
  • 2
  • 10
  • 23

2 Answers2

0

I found a solution.To assign Null value for the Bottom Navigation Instance at runtime. Please Try this,

xml:

<com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/nav_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@android:color/transparent"
            app:menu="@menu/bottom_nav_menu"
            android:elevation="0dp"/>

java:

BottomNavigationView navView = findViewById(R.id.nav_view);
navView.setBackground(null);

Happy Coding :)

MohanRaj S
  • 1,958
  • 4
  • 30
  • 54
wowandy
  • 1,124
  • 2
  • 10
  • 23
0

To Assign Null value for the background property in xml.

android:background="@null"

Like this,

<com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/nav_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@null"
            app:menu="@menu/bottom_nav_menu" />
MohanRaj S
  • 1,958
  • 4
  • 30
  • 54