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

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

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

SwipeRefreshLayout.postDelayed介绍

暂无

代码示例

代码示例来源:origin: gdutxiaoxu/CoordinatorLayoutExample

@Override
  public void onRefresh() {
    mSwipeRefreshLayout.postDelayed(new Runnable() {
      @Override
      public void run() {
        mSwipeRefreshLayout.setRefreshing(false);
        Toast.makeText(mContext, "刷新完成", Toast.LENGTH_SHORT).show();
      }
    }, 1200);
  }
});

代码示例来源:origin: ditclear/TimeLine

@Override
  public void onRefresh() {
    mBinding.refreshLayout.postDelayed(new Runnable() {
      @Override
      public void run() {
        mBinding.refreshLayout.setRefreshing(false);
      }
    },2000);
  }
}

代码示例来源:origin: loopeer/SpringHeader

@Override
  public void onRefresh() {
    srl.postDelayed(new Runnable() {
      @Override
      public void run() {
        srl.setRefreshing(false);
      }
    }, 2000);
  }
});

代码示例来源:origin: huyongli/IndexStickyView

@Override
  public void onRefresh() {
    mRefreshLayout.setRefreshing(true);
    mRefreshLayout.postDelayed(new Runnable() {
      @Override
      public void run() {
        mAdapter.reset(initDatas());
        mRefreshLayout.setRefreshing(false);
      }
    }, 3000);
  }
});

代码示例来源:origin: adafruit/Bluefruit_LE_Connect_Android

@Override
  public void onRefresh() {
    mScannedDevices.clear();
    startScan(null);
    mSwipeRefreshLayout.postDelayed(new Runnable() {
      @Override
      public void run() {
        mSwipeRefreshLayout.setRefreshing(false);
      }
    }, 500);
  }
});

代码示例来源:origin: Werb/GankWithZhihu

public void setRefresh(boolean requestDataRefresh) {
  if (mRefreshLayout == null) {
    return;
  }
  if (!requestDataRefresh) {
    mRefreshLayout.postDelayed(() -> {
      if (mRefreshLayout != null) {
        mRefreshLayout.setRefreshing(false);
      }
    }, 1000);
  } else {
    mRefreshLayout.setRefreshing(true);
  }
}

代码示例来源:origin: Werb/GankWithZhihu

public void setRefresh(boolean requestDataRefresh) {
  if (mRefreshLayout == null) {
    return;
  }
  if (!requestDataRefresh) {
    mRefreshLayout.postDelayed(() -> {
      if (mRefreshLayout != null) {
        mRefreshLayout.setRefreshing(false);
      }
    }, 1000);
  } else {
    mRefreshLayout.setRefreshing(true);
  }
}

代码示例来源:origin: werbhelius/Werb

public void setRefresh(boolean requestDataRefresh) {
  if (mRefreshLayout == null) {
    return;
  }
  if (!requestDataRefresh) {
    mIsRequestDataRefresh = false;
    mRefreshLayout.postDelayed(() -> {
      if (mRefreshLayout != null) {
        mRefreshLayout.setRefreshing(false);
      }
    }, 1000);
  } else {
    mRefreshLayout.setRefreshing(true);
  }
}

代码示例来源:origin: HotBitmapGG/MoeQuest

public void showRefreshProgress() {
 mSwipeRefreshLayout.postDelayed(() -> {
  mSwipeRefreshLayout.setRefreshing(true);
  mIsRefreshing = true;
  getTaoFemaleData();
 }, 500);
}

代码示例来源:origin: freedom10086/Ruisi

@Override
  public void onFailure(Throwable e) {
    refreshLayout.postDelayed(() -> refreshLayout.setRefreshing(false), 300);
    adapter.changeLoadMoreState(BaseAdapter.STATE_LOAD_FAIL);
  }
});

代码示例来源:origin: limedroid/XStateController

@Override
  public void onRefresh() {
    controller.showLoading();
    swipeLayout.postDelayed(new Runnable() {
      @Override
      public void run() {
        swipeLayout.setRefreshing(false);
        controller.showContent();
      }
    }, 2000L);
  }
});

代码示例来源:origin: freedom10086/Ruisi

@Override
  public void onFailure(Throwable e) {
    refreshLayout.postDelayed(() -> refreshLayout.setRefreshing(false), 500);
    adapter.changeLoadMoreState(BaseAdapter.STATE_LOAD_FAIL);
  }
});

代码示例来源:origin: freedom10086/Ruisi

@Override
  public void onFailure(Throwable e) {
    e.printStackTrace();
    refreshLayout.postDelayed(() -> refreshLayout.setRefreshing(false), 500);
    adapter.changeLoadMoreState(BaseAdapter.STATE_LOAD_FAIL);
  }
});

代码示例来源:origin: yugai/DouYu-Android

private void hideRefreshLayout() {
    if (mSrl.isRefreshing()) {
      mSrl.postDelayed(new Runnable() {
        @Override
        public void run() {
          mSrl.setRefreshing(false);
        }
      },500);
    }
  }
}

代码示例来源:origin: yugai/DouYu-Android

private void hideRefreshLayout() {
    if (mSrl.isRefreshing()) {
      mSrl.postDelayed(new Runnable() {
        @Override
        public void run() {
          mSrl.setRefreshing(false);
        }
      },500);
    }
  }
}

代码示例来源:origin: yugai/DouYu-Android

private void hideRefreshLayout() {
  if (mSrl.isRefreshing()) {
    mSrl.postDelayed(new Runnable() {
      @Override
      public void run() {
        mSrl.setRefreshing(false);
      }
    },500);
  }
}

代码示例来源:origin: yangchaojiang/AaComponents

/***
 * @param setRefreshing 是否刷新 true   false 则停止
 **/
public void setRefreshing(boolean setRefreshing) {
  showContentView();
  swipeRefresh.postDelayed(() -> {
    if (swipeRefresh == null) return;
    swipeRefresh.setRefreshing(setRefreshing);
    if (setRefreshing) {
      onRefresh();
    }
  }, 200);
}

代码示例来源:origin: yangchaojiang/AaComponents

/***
 * @param setRefreshing 是否刷新 true   false 则停止
 **/
public void setRefreshing(boolean setRefreshing) {
  showContentView();
  swipeRefresh.postDelayed(() -> {
    if (swipeRefresh == null) return;
    swipeRefresh.setRefreshing(setRefreshing);
    if (setRefreshing) {
      onRefresh();
    }
  }, 200);
}

代码示例来源:origin: HotBitmapGG/MoeQuest

private void showProgress() {
 mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
 mSwipeRefreshLayout.setOnRefreshListener(() -> {
  page = 1;
  jianDanMeiziDataList.clear();
  mIsRefreshing = true;
  getJianDanMeizi();
 });
 mSwipeRefreshLayout.postDelayed(() -> {
  mSwipeRefreshLayout.setRefreshing(true);
  mIsRefreshing = true;
  getJianDanMeizi();
 }, 500);
}

代码示例来源:origin: HotBitmapGG/MoeQuest

private void showProgress() {
 mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
 mSwipeRefreshLayout.postDelayed(() -> {
  mSwipeRefreshLayout.setRefreshing(true);
  mIsRefreshing = true;
  getHuaBanMeizi();
 }, 500);
 mSwipeRefreshLayout.setOnRefreshListener(() -> {
  page = 1;
  meiziInfos.clear();
  mIsRefreshing = true;
  getHuaBanMeizi();
 });
}

相关文章