• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OnRefreshListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.scwang.smartrefresh.layout.listener.OnRefreshListener的典型用法代码示例。如果您正苦于以下问题:Java OnRefreshListener类的具体用法?Java OnRefreshListener怎么用?Java OnRefreshListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OnRefreshListener类属于com.scwang.smartrefresh.layout.listener包,在下文中一共展示了OnRefreshListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onViewCreated

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的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: refresh

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
private void refresh() {
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            if(MyApp.isLogin()){
                getData(PULL_REFRESH);
            }else{
                showToast("请先登录哦~");
                mhandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        swipeRefreshLayout.finishRefresh();
                    }
                },1000);

            }

        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:21,代码来源:FocusFragment.java


示例3: onCreate

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_practice_banner);

    final Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    final RefreshLayout refreshLayout = (RefreshLayout) findViewById(R.id.refreshLayout);

    mAdapter = new QuickAdapter();
    recyclerView.addItemDecoration(new DividerItemDecoration(this, VERTICAL));
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(mAdapter);
    refreshLayout.autoRefresh();
    refreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(final RefreshLayout refreshlayout) {
            refreshlayout.getLayout().postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (mAdapter.getItemCount() < 2) {
                        List<Movie> movies = new Gson().fromJson(JSON_MOVIES, new TypeToken<ArrayList<Movie>>() {}.getType());
                        mAdapter.replaceData(movies);
                    }
                    refreshlayout.finishRefresh();
                }
            },2000);
        }
    });

    //添加Header
    View header = LayoutInflater.from(this).inflate(R.layout.listitem_movie_header, recyclerView, false);
    Banner banner = (Banner) header;
    banner.setImageLoader(new GlideImageLoader());
    banner.setImages(BANNER_ITEMS);
    banner.start();
    mAdapter.addHeaderView(banner);

    //状态栏透明和间距处理
    StatusBarUtil.immersive(this);
    StatusBarUtil.setPaddingSmart(this, toolbar);
    StatusBarUtil.setPaddingSmart(this, recyclerView);
    StatusBarUtil.setMargin(this, findViewById(R.id.header));
    StatusBarUtil.setPaddingSmart(this, findViewById(R.id.blurview));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:53,代码来源:BannerPracticeActivity.java


示例4: refresh

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
private void refresh() {
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            getData(PULL_REFRESH, type);
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:9,代码来源:ChooseCircleActivity.java


示例5: refresh

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
private void refresh() {
    swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(RefreshLayout refreshlayout) {
            getData(PULL_REFRESH);
        }
    });
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:9,代码来源:CircleFragment.java


示例6: onCreateView

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的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


示例7: setOnRefreshListener

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
/**
 * 单独设置刷新监听器
 */
@Override
public SmartRefreshLayout setOnRefreshListener(OnRefreshListener listener) {
    this.mRefreshListener = listener;
    return this;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:SmartRefreshLayout.java


示例8: onCreate

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_using_custom);

    final Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    ListView listView = (ListView) findViewById(R.id.listview);
    listView.setAdapter(mAdapter = new BaseRecyclerAdapter<Void>(simple_list_item_2) {
        @Override
        protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) {
            holder.text(android.R.id.text1, String.format(Locale.CHINA, "第%02d条数据", position));
            holder.text(android.R.id.text2, String.format(Locale.CHINA, "这是测试的第%02d条数据", position));
            holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
        }
    });

    final RefreshLayout refreshLayout = (RefreshLayout) findViewById(R.id.refreshLayout);
    refreshLayout.setOnRefreshListener(new OnRefreshListener() {
        @Override
        public void onRefresh(final RefreshLayout refreshlayout) {
            refreshlayout.getLayout().postDelayed(new Runnable() {
                @Override
                public void run() {
                    mAdapter.refresh(initData());
                    refreshlayout.finishRefresh();
                }
            }, 2000);
        }
    });

    refreshLayout.setRefreshHeader(new ClassicsHeader(this));
    refreshLayout.setHeaderHeight(60);

    //触发自动刷新
    if (isFirstEnter) {
        isFirstEnter = false;
        refreshLayout.autoRefresh();
    } else {
        mAdapter.refresh(initData());
    }

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:50,代码来源:CustomUsingActivity.java


示例9: setOnRefreshListener

import com.scwang.smartrefresh.layout.listener.OnRefreshListener; //导入依赖的package包/类
/**
 * 单独设置刷新监听器
 */
RefreshLayout setOnRefreshListener(OnRefreshListener listener);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:RefreshLayout.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SumLatticeDefault类代码示例发布时间:2022-05-22
下一篇:
Java BasicFormattedTextFieldUI类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap