Closed aemxn closed 8 years ago
Hi, @aimanbaharum I'm sorry late reply. I’ve been busy lately at work :P
Try using the SmartTabLayout#getTabAt(int)
The method will be able to get the root view of the Tab
View tab = viewPagerTab.getTabAt(your update position);
TextView counter = (TextView) itemView.findViewById(R.id.custom_tab_counter);
This could very well relate to my issue.. https://github.com/ogaclejapan/SmartTabLayout/issues/134#issuecomment-195970079
Hi @ogaclejapan, great library you made here.
I'd like to ask a question regarding updating the tab UI with
LocalBroadcastManager
.Here's what I'm trying to achieve: I put a counter besides the text in my tab, now whenever a push notification comes in, the tab will update its UI and display a counter. I'm using
LocalBroadcastManager
to register any broadcast event.I'm also using a custom layout for the tabs. Here's what I've done:
But the problem is, the register event occurs outside of this
TabProvider
class which is inonCreate
of current Activity. How can I register the Broadcast Manager inside this TabProvider so that I can update the UI of the tab whenever it listens to any broadcast message?Is there any other alternative to this to achieve what I'm looking for?
EDIT
More precisely, I want to access TextView counter inside
createTabView
so I can modify its content.