Skip to content

zhorn/SlidingIconTabLayout

 
 

Repository files navigation

SlidingIconTabLayout Sample

A basic sample which shows how to use SlidingTabLayout with not only Text but also Icon for tab layout.

Usage

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];
    }
}

Developed By

Contributing

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

License

MIT

About

[Android] It's for tab layout with icon in SlidingTabLayout

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%