I am using ActionBarSherlock to provide ActionBars for pre HoneyComb devices.
My Activity has four fragments namely 1. User 2. Chat 3. Video 4. Extra, see image
I have created actionBar using following code:-
actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setTitle("Meeting");
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowCustomEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
/* Set Custom view */
ActionBar.Tab tab = actionBar.newTab();
// tab.setText("Meeting Users");
tab.setIcon(R.drawable.users);
tab.setTabListener(this);
actionBar.addTab(tab);
tab = actionBar.newTab();
// tab.setText("Chat");
tab.setIcon(R.drawable.chat);
tab.setTabListener(this);
actionBar.addTab(tab);
tab = actionBar.newTab();
// tab.setText("Video");
tab.setIcon(R.drawable.video_call);
tab.setTabListener(this);
tab.select();
actionBar.addTab(tab);
tab = actionBar.newTab();
// tab.setText("Extra");
tab.setIcon(R.drawable.extra);
tab.setTabListener(this);
actionBar.addTab(tab);
I want to draw something on those tabs, for example draw and/OR blink on chat tab, whenever chat messages arrives and user is on some other tab.
How can I do this ? please help.
Use custom view for your tabs
Then you can get views on your custom layout and make blinking
This is How I solved my problem, Hope it can be useful for someone else too....
First I created a CutomImageView by extending ImageView
Then While creating tabs, I used this image as
/* Set Custom view */
Now whenever the notification changes I call increment/decrement or setter method of CustomImageView and new Notifications are displayed on the image..
Suggestions to improve this solution are really welcome...