A basic sample which shows how to use SlidingTabLayout
with not only Text but also Icon for tab layout.
repositories {
jcenter()
}
dependencies {
compile 'com.github.kimkevin:slidingicontablayout:1.0.0'
}
For using icon for tab, implement 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