I am using the Bottomnavigationview
for tab-bar in my application, for it, i am using the following code.Please check it once.
Layout :-
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:itemTextColor="@android:color/black"
app:menu="@menu/bottom_navigation_main" />
And I get the following Result from it, please check the image for it.
But the problem is that, I need the custom item of the Bottomnavigationview
, like in below image there is red TextView
count which is on the home item of the Bottomnavigationview
, Please check the below image.
I have searched for it and get the third party library for it, which is able to create the view which I want.Please check the library of it Click here .Is it not possible to NOT use any third party library and use the only Bottomnavigationview
for it?
I have searched here on SO but did not get the expected result, please check the below link which I have visited.
1. First Link
2. Second Link
3. Third Link
4. Forth Link
5. Fifth Link
Please help me to short out from this problem. Thanks :)
I have done the above task as the following approach, please have a look on the solution
Your badge count layout be like below
And than after your badge drawable be like below
And at the last, you need we need to inflate our badge layout into our MainActivity.java , where we use the BottomNavigationView, please check the following code for it.
If you are using androidX , please refer below code :
I used tab layout with a custom view in it
tab_main.xml