SlidingIconTabLayout
SlidingIconTabLayout copied to clipboard
[Android] Support both icon and text for SlidingTabLayout
SlidingIconTabLayout Sample
A basic sample which shows how to use SlidingTabLayout
with not only Text but also Icon for tab layout.


Download
repositories {
jcenter()
}
dependencies {
compile 'com.github.kimkevin:slidingicontablayout:1.0.0'
}
Usage
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];
}
}
Developed By
- Kevin Yongjun Kim - [email protected]
Contributing
All contributions are welcome. Open a Pull Requests or refer to the Issues section.
License
MIT