A basic sample which shows how to use SlidingTabLayout with not only Text but also Icon for tab layout.
You can copy SlidingTabLayout file to your widgets folder with SlidingTabStrip.
For using tab as icon, set SlidingTabLayout.TabIconProvider to your FragmentPagerAdapter as below.
public class BaseTabAdapter extends FragmentPagerAdapter implements SlidingTabLayout.TabIconProvider {
private static final int iconRes[] = {
R.drawable.ic_action_camera,
R.drawable.ic_action_video
};
...
@Override
public int getPageIconResId(int position) {
return iconRes[position];
}
}- Kevin Yongjun Kim - imkimkevin@gmail.com
All contributions are welcome. Open a Pull Requests or refer to the Issues section.
MIT