astuetz / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
139 stars 44 forks source link

Tab title having both text and icon? #18

Open curioustechizen opened 11 years ago

curioustechizen commented 11 years ago

In the notifyDatasetChanged() method of class PagerSlidingTabStrip, I see this code:

for (int i = 0; i < tabCount; i++) {

    if (pager.getAdapter() instanceof IconTabProvider) {
        addIconTab(i, ((IconTabProvider) pager.getAdapter()).getPageIconResId(i));
    } else {
        addTextTab(i, pager.getAdapter().getPageTitle(i).toString());
    }

}

What this leads me to believe is that the tabs can either have a text title, or an icon, but not both. Is this assumption correct? If so, would you consider allowing a tab to have both an icon and a text as a feature request?

mpost commented 10 years ago

You can set a View as the tab which could contain both text and icon.

Benjamin-Dobell commented 10 years ago

@mpost Yes, that is one of many possibilities my fork enables support for. Checkout https://play.google.com/store/apps/details?id=com.playup.android&hl=en for an example of just how flexible this functionality is.