astuetz / PagerSlidingTabStrip

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

Way to change tab icon at runtime? #244

Open abhimanyu209 opened 9 years ago

abhimanyu209 commented 9 years ago

I have a requirement , where the icons for the tabs are being downloaded from the internet. Since this process is happening asynchronously, I need to be able to set the icons to the tabs when the bitmaps are downloaded.

How can I do this?

Thankx

abhimanyu209 commented 9 years ago

hey, I was able to solve it myself .

This is my solution : (Using Glide)

LinearLayout layout = (LinearLayout) tabsStrip.getChildAt(0); Glide.with(StickerActivity.this) .load(stickers.getResult().get(0).getOutlineSmallBlack()) .diskCacheStrategy(DiskCacheStrategy.ALL) .placeholder(R.drawable.icon_sticker) .into((ImageView) layout.getChildAt(0));

azizimusa commented 8 years ago

thanks @abhimanyu209 it works !