I have a
BottomNavigationView which I instantiate like this:
BottomNavigationView navigationView = findViewById(R.id.bottom_navigation);
/menu/menu.xml looks like this:
And /drawable/home_icon looks like this:
android:pathData="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"
As you can see, I have borders around the buttons of the navigation items, however, the borders touch each other. Therefore I would like to add a margin between the menu buttons. How can I do this?
As you can also see from the screenshot, I am preventing shifting mode. I do this by calling
using code from here.
The borders around the buttons have been added like this:
int stateListDrawable = drawableStateLists.get(currentFragment);
stateListDrawable refers to a
StateListDrawable which changes when a different menu button is pressed. The
StateListDrawable refers to an xml selector which in turn refers to an xml shape like this, for example:
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered