1

In my BottomNavigationView, I want to add ripple effect and then change the background color of my selected navigation item. Here is a screenshot of what i've done so farenter image description here

My Drawable File

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/colorAccent" android:state_checked="true"/>
    <item android:drawable="@color/colorPrimaryDark" android:state_checked="false"/>
</selector>

My Layout File

<android.support.design.widget.BottomNavigationView
    android:id="@+id/navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    app:itemBackground="@drawable/navigaton_item_bg"
    app:itemIconTint="@android:color/white"
    app:itemTextColor="@android:color/white"
    app:menu="@menu/navigation" />
mj sunny
  • 119
  • 1
  • 1
  • 10
  • https://stackoverflow.com/questions/40316411/bottomnavigationview-shadow-and-ripple-effect – AskNilesh Aug 09 '18 at 06:36
  • 1
    I tried that already. When i add ripple effect then i can not change my selected item's background color @NileshRathod – mj sunny Aug 09 '18 at 06:49

0 Answers0