use of com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator in project SmartRefreshLayout by scwang90.
the class AssignDefaultExampleActivity method install.
/*
* 关键代码,需要在布局生成之前设置,建议代码放在 Application 中
*/
private static void install() {
// 设置全局的Header构建器
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
@NonNull
@Override
public RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout) {
ClassicsHeader header = new ClassicsHeader(context).setSpinnerStyle(SpinnerStyle.FixedBehind);
header.setPrimaryColorId(R.color.colorPrimary);
header.setAccentColorId(android.R.color.white);
// 指定为经典Header,默认是 贝塞尔雷达Header
return header;
}
});
// 设置全局的Footer构建器
SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {
@NonNull
@Override
public RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull RefreshLayout layout) {
// 内容不满一页时候启用加载更多
layout.setEnableLoadMoreWhenContentNotFull(true);
ClassicsFooter footer = new ClassicsFooter(context);
footer.setBackgroundResource(android.R.color.white);
// 设置为拉伸模式
footer.setSpinnerStyle(SpinnerStyle.Scale);
// 指定为经典Footer,默认是 BallPulseFooter
return footer;
}
});
}
use of com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator in project MVP by yuchengren.
the class BaseApplication method initRefreshView.
private void initRefreshView() {
SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() {
@NonNull
@Override
public RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout) {
return new MKRefreshHeader(context);
}
});
SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() {
@NonNull
@Override
public RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull RefreshLayout layout) {
ClassicsFooter classicsFooter = new ClassicsFooter(context);
ClassicsFooter.REFRESH_FOOTER_NOTHING = "没有更多数据啦";
classicsFooter.setTextSizeTitle(14);
classicsFooter.setAccentColorId(R.color.text_color_medium);
return classicsFooter;
}
});
}
Aggregations