android.support.v4.widget.SwipeRefreshLayout.setSize()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中android.support.v4.widget.SwipeRefreshLayout.setSize()方法的一些代码示例,展示了SwipeRefreshLayout.setSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SwipeRefreshLayout.setSize()方法的具体详情如下:
包路径:android.support.v4.widget.SwipeRefreshLayout
类名称:SwipeRefreshLayout
方法名:setSize

SwipeRefreshLayout.setSize介绍

[英]One of DEFAULT, or LARGE.
[中]违约的一种,或大的。

代码示例

代码示例来源:origin: chuyangliu/tastysnake

private void initRefreshLayout(View v) {
  refreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.connect_swipe_layout);
  refreshLayout.setColorSchemeColors(getResources().getColor(R.color.colorPrimary));
  refreshLayout.setProgressBackgroundColorSchemeColor(Config.COLOR_MAP_BG);
  refreshLayout.setDistanceToTriggerSync(20);
  refreshLayout.setSize(SwipeRefreshLayout.DEFAULT);
  refreshLayout.setNestedScrollingEnabled(true);
  refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      if (!manager.isEnabled()) {
        startConnect();
      } else {
        startDiscover();
      }
    }
  });
}

代码示例来源:origin: GitLqr/MaterialDesignDemo

private void setSwipeRefreshLayout() {
  //设置 SwipeRefreshLayout 的尺寸
  mSrl.setSize(SwipeRefreshLayout.LARGE);
  //设置 SwipeRefreshLayout 刷新时的颜色切换(可以有无数种)
  mSrl.setColorSchemeColors(Color.RED, Color.YELLOW, Color.GREEN);
  //设置 SwipeRefreshLayout 的背景色
  mSrl.setBackgroundColor(Color.GRAY);
  //设置 SwipeRefreshLayout 的下拉距离
  mSrl.setDistanceToTriggerSync(100);
  //设置 SwipeRefreshLayout 正在刷新监听
  mSrl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      for (int i = 0; i < 10; i++) {
        mData.add(0, (++number) + "");
      }
      mHandler.postDelayed(new Runnable() {
        @Override
        public void run() {
          mHandler.sendEmptyMessage(0);
        }
      }, 3000);
    }
  });
}

代码示例来源:origin: stackoverflow.com

mSwipeRefreshLayout.setOnRefreshListener(this);
mSwipeRefreshLayout.setDistanceToTriggerSync(30);
mSwipeRefreshLayout.setSize(SwipeRefreshLayout.DEFAULT);

相关文章