Skip to content

在FlycoTabLayout的基础上修改,CommonTabLayout支持网络图片

Notifications You must be signed in to change notification settings

wlingf/XWTabLayout

Repository files navigation

XWTabLayout

在FlycoTabLayout的基础上修改,CommonTabLayout支持网络图片

  • 1.初始化XWTabLayout,建议在Application初始化

XWTabLayout.init(XWTabLayoutConfig.newBuilder(this)
                .setXWTabLayoutLoader(new CustomTabLayoutLoader())
                .build());
                
  • 2.自定义图片加载框架

public class CustomTabLayoutLoader implements XWTabLayoutLoader {

    @Override
    public void load(Context context, ImageView view, String url) {
        Glide.with(context)
                .load(url)
                .into(view);
    }
}
  • 3.修改CustomTabEntity 支持传入网络图片地址


public interface CustomTabEntity {
    String getTabTitle();

    @DrawableRes
    int getTabSelectedIcon();

    @DrawableRes
    int getTabUnselectedIcon();

    String getTabSelectUrl ();

    String getTabUnSelectUrl ();
}

About

在FlycoTabLayout的基础上修改,CommonTabLayout支持网络图片

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages