当前位置: 首页>>代码示例>>Java>>正文


Java SmartRefreshLayout.setOnRefreshListener方法代码示例

本文整理汇总了Java中com.scwang.smartrefresh.layout.SmartRefreshLayout.setOnRefreshListener方法的典型用法代码示例。如果您正苦于以下问题:Java SmartRefreshLayout.setOnRefreshListener方法的具体用法?Java SmartRefreshLayout.setOnRefreshListener怎么用?Java SmartRefreshLayout.setOnRefreshListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.scwang.smartrefresh.layout.SmartRefreshLayout的用法示例。


在下文中一共展示了SmartRefreshLayout.setOnRefreshListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();



}
 
开发者ID:Justson,项目名称:AgentWeb,代码行数:26,代码来源:SmartRefreshWebFragment.java

示例2: 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);
}
 
开发者ID:Wilshion,项目名称:HeadlineNews,代码行数:13,代码来源:TestActivity.java

示例3: onCreateView

import com.scwang.smartrefresh.layout.SmartRefreshLayout; //导入方法依赖的package包/类
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(R.layout.fragment_hot_topic, container, false);

  // http://sapandiwakar.in/pull-to-refresh-for-android-recyclerview-or-any-other-vertically-scrolling-view/
  // pull to refresh for android recyclerview
  mRefreshLayout = (SmartRefreshLayout) rootView;
  mRefreshLayout.setEnableLoadmore(false);
  mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
    @Override public void onRefresh(RefreshLayout refreshLayout) {
      RefreshGuidanceFromWWW();
    }
  });

  // http://blog.csdn.net/lmj623565791/article/details/45059587
  // 你想要控制Item间的间隔(可绘制),请通过ItemDecoration
  // 你想要控制Item增删的动画,请通过ItemAnimator
  // 你想要控制点击、长按事件,请自己写
  // item被按下的时候的highlight,这个是通过guidance item的backgroun属性来实现的 (android:background="@drawable/recyclerview_item_bg")
  mRecyclerView = (RecyclerView) rootView.findViewById(R.id.guidance_recycler_view);
  // Set the adapter
  if (mRecyclerView != null) {
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL, 0));
    Context context = rootView.getContext();
    mRecyclerView.setLayoutManager(new WrapContentLinearLayoutManager(context));
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mRecyclerView.setAdapter(new HotTopicRecyclerViewAdapter(TopicListContent.HOT_TOPICS, mListener));
  }

  getActivity().setTitle(SMTHApplication.App_Title_Prefix + "首页导读");

  if (TopicListContent.HOT_TOPICS.size() == 0) {
    RefreshGuidance();
  }
  return rootView;
}
 
开发者ID:zfdang,项目名称:zSMTH-Android,代码行数:36,代码来源:HotTopicFragment.java


注:本文中的com.scwang.smartrefresh.layout.SmartRefreshLayout.setOnRefreshListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。