Arjun sharma Arjun sharma - 9 months ago 784
Android Question

Android Tablayout tabs with notification badge like whatsApp

I want to implement notification badge with
. I had tried my best effort to implement it but fails.

Any help would by greatly appreciated.


My solution to this was using and setting a custom view to each tab:

My tabs have only icons so I used ImageView, but I believe you can use any other view, check

private BadgeView badge;

Tab tab = tabLayout.getTabAt(position);
ImageView imageView = new ImageView(context);
badge = new BadgeView(context, imageView);