本文整理汇总了Java中com.scwang.smartrefresh.layout.SmartRefreshLayout类的典型用法代码示例。如果您正苦于以下问题:Java SmartRefreshLayout类的具体用法?Java SmartRefreshLayout怎么用?Java SmartRefreshLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmartRefreshLayout类属于com.scwang.smartrefresh.layout包,在下文中一共展示了SmartRefreshLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpinnerStyle
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == ViewGroup.LayoutParams.MATCH_PARENT) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
示例2: getSpinnerStyle
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == 0) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
示例3: onCreate
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_animation_picture);
picturesRv = (RecyclerView) findViewById(R.id.rv_picture);
smartRefreshLayout = (SmartRefreshLayout) findViewById(R.id.smart_refresh_layout_picture);
smartRefreshLayout.setOnRefreshLoadmoreListener(this);
LayoutManager layoutManager = new GridLayoutManager(this,3);
picturesRv.setLayoutManager(layoutManager);
pictureAdapter = new PictureAdapter(pictureList,this);
picturesRv.setAdapter(pictureAdapter);
if(!pictureList.isEmpty()){
smartRefreshLayout.finishLoadmore();
smartRefreshLayout.finishRefresh();
pictureAdapter.notifyDataSetChanged();
}else {
smartRefreshLayout.autoRefresh();
}
}
示例4: onViewCreated
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final SmartRefreshLayout mSmartRefreshLayout= (SmartRefreshLayout) this.mSmartRefreshWebLayout.getLayout();
final WebView mWebView=this.mSmartRefreshWebLayout.getWeb();
mSmartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(RefreshLayout refreshlayout) {
mAgentWeb.getLoader().reload();
mSmartRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mSmartRefreshLayout.finishRefresh();
}
},2000);
}
});
mSmartRefreshLayout.autoRefresh();
}
示例5: getSpinnerStyle
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@NonNull
@Override
public SpinnerStyle getSpinnerStyle() {
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
mSpinnerStyle = ((SmartRefreshLayout.LayoutParams) params).spinnerStyle;
if (mSpinnerStyle != null) {
return mSpinnerStyle;
}
}
if (params != null) {
if (params.height == 0) {
return mSpinnerStyle = SpinnerStyle.Scale;
}
}
return mSpinnerStyle = SpinnerStyle.Translate;
}
示例6: onInitialized
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(RefreshKernel kernel, int height, int extendHeight) {
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
kernel.requestDrawBackgoundForHeader(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
}
}
示例7: onInitialized
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(RefreshKernel kernel, int height, int extendHeight) {
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
kernel.requestDrawBackgoundForFooter(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
}
}
示例8: onCreateView
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.news_layout,container,false);
newsRecycler = (RecyclerView) view.findViewById(R.id.rv_news);
smartRefreshLayout = (SmartRefreshLayout) view.findViewById(R.id.smart_refresh_layout_news);
smartRefreshLayout.setOnRefreshLoadmoreListener(this);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
newsRecycler.setLayoutManager(layoutManager);
newsAdapter = new NewsAdapter(newsList);
newsRecycler.setAdapter(newsAdapter);
newsRecycler.addItemDecoration(new DividerItemDecoration(getContext()));
return view;
}
示例9: SmartRefreshWebLayout
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
public SmartRefreshWebLayout(Activity activity){
View mView=activity.getLayoutInflater().inflate(R.layout.fragment_srl_web,null);
View smarkView = mView.findViewById(R.id.smarkLayout);
mSmartRefreshLayout = (SmartRefreshLayout) smarkView;
mWebView = (WebView) mSmartRefreshLayout.findViewById(R.id.webView);
}
示例10: onCreate
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
SmartRefreshLayout.setDefaultRefreshHeaderCreater(new DefaultRefreshHeaderCreater() {
@NonNull
@Override
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
BezierRadarHeader header = new BezierRadarHeader(context);
layout.setPrimaryColorsId(R.color.colorPrimary, android.R.color.white);
return header;
}
});
}
示例11: initCtrls
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
private void initCtrls() {
mUINavigationBar = (UINavigationBar) findViewById(R.id.id_nav_bar);
mRefreshLayout = (SmartRefreshLayout) findViewById(R.id.id_refresh_layout);
mRecyclerView = (RecyclerView) findViewById(R.id.id_recycler_view);
mUINavigationBar.setNavBarTitle("微头条");
mUINavigationBar.setNavBarRightImg(R.drawable.micro_add_friend);
mUINavigationBar.setNavBarLeftImg(-1);
mUINavigationBar.setOnNavigationBarClickListener(new UINavigationBar.OnNavigationBarClickListener() {
@Override
public void onNavigationBarRightClicked() {
logD("onNavigationBarRightClicked");
}
});
}
示例12: initViews
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
protected void initViews() {
mRefreshLayout = (SmartRefreshLayout) findViewById(R.id.id_refresh_layout);
mRecyclerView = (RecyclerView) findViewById(R.id.id_recycler_view);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
mRefreshLayout.setOnRefreshListener(this);
mRefreshLayout.setOnLoadmoreListener(this);
mRefreshLayout.autoRefresh(0);
}
示例13: onInitialized
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(@NonNull RefreshKernel kernel, int height, int extendHeight) {
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
kernel.requestDrawBackgoundForHeader(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
}
}
示例14: onInitialized
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
@Override
public void onInitialized(@NonNull RefreshKernel kernel, int height, int extendHeight) {
ViewGroup.LayoutParams params = mWrapperView.getLayoutParams();
if (params instanceof SmartRefreshLayout.LayoutParams) {
kernel.requestDrawBackgoundForFooter(((SmartRefreshLayout.LayoutParams) params).backgroundColor);
}
}
示例15: restore
import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入依赖的package包/类
private static void restore() {
SmartRefreshLayout.setDefaultRefreshHeaderCreater(new DefaultRefreshHeaderCreater() {
@NonNull
@Override
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
layout.setPrimaryColorsId(R.color.colorPrimary, android.R.color.white);//全局设置主题颜色
return new ClassicsHeader(context).setTimeFormat(new DynamicTimeFormat("更新于 %s"));
}
});
}