[Android] Support both icon and text for SlidingTabLayout
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
gradle/wrapper
library
sample
screenshot
.gitignore
LICENSE.txt
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

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

Contributing

All contributions are welcome. Open a Pull Requests or refer to the Issues section.

License

MIT