How to show unread notification counter on Tabs inside TabLayout?
Asked Answered
G

2

7

I am using TabLayout of android support design library.

I want to show unread notification counter on the tab with title like below image.

enter image description here

How to set unread count on Tab inside TabLayout?

Grippe answered 28/8, 2015 at 11:0 Comment(0)
I
10

Use public TabLayout.Tab setCustomView (int layoutResId)

Create a Layout with TextView and Button use this in Custom view.

For reference

setCustomView

Example

Hope this will helpful to you.

Intinction answered 28/8, 2015 at 11:41 Comment(1)
This is partially working for me, when I try to change the counter/badge in runtime, I call the setCustomView again, and it's adding the same view instead of replacing it.Desma
F
0

Take a look at android-viewbadger...

Footman answered 28/8, 2015 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.