本文整理汇总了Java中in.srain.cube.views.ptr.PtrClassicFrameLayout.postDelayed方法的典型用法代码示例。如果您正苦于以下问题:Java PtrClassicFrameLayout.postDelayed方法的具体用法?Java PtrClassicFrameLayout.postDelayed怎么用?Java PtrClassicFrameLayout.postDelayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类in.srain.cube.views.ptr.PtrClassicFrameLayout
的用法示例。
在下文中一共展示了PtrClassicFrameLayout.postDelayed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupViews
import in.srain.cube.views.ptr.PtrClassicFrameLayout; //导入方法依赖的package包/类
@Override
protected void setupViews(final PtrClassicFrameLayout ptrFrame) {
ptrFrame.setLoadingMinTime(3000);
setHeaderTitle(R.string.ptr_demo_block_auto_fresh);
ptrFrame.postDelayed(new Runnable() {
@Override
public void run() {
ptrFrame.autoRefresh(true);
}
}, 150);
}
示例2: setupViews
import in.srain.cube.views.ptr.PtrClassicFrameLayout; //导入方法依赖的package包/类
@Override
protected void setupViews(final PtrClassicFrameLayout ptrFrame) {
ptrFrame.setLoadingMinTime(3000);
setHeaderTitle(R.string.ptr_demo_block_auto_fresh);
ptrFrame.postDelayed(new Runnable() {
@Override
public void run() {
ptrFrame.autoLoadMore(true);
}
}, 150);
}
开发者ID:tangnuo,项目名称:android-Ultra-Pull-To-Refresh-With-Load-More-master,代码行数:12,代码来源:AutoRefresh.java
示例3: onCreate
import in.srain.cube.views.ptr.PtrClassicFrameLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_classic_ptr);
mPtrFrame = (PtrClassicFrameLayout) findViewById(R.id.ptr_frame);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycle_view);
//TODO TEST DATA
Items allList = new Items();
for (int i = 0; i < 20; i++) {
News news = new News();
news.setImgPath("http://ds.cdncache.org/avatar-50/532/164695.jpg");
news.setTitle("新闻标题" + i);
news.setDesc("新闻描述" + i);
allList.add(news);
}
mAdapter = new MultiTypeAdapter(allList);
mAdapter.register(News.class, new NewsViewBinder());
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mAdapter);
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
mPtrFrame.autoRefresh();
}
}, 1000);
mPtrFrame.setPtrHandler(new PtrDefaultHandler() {
@Override
public void onRefreshBegin(PtrFrameLayout frame) {
ToastUtils.showShort("刷新了");
Observable.timer(1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Long>() {
@Override
public void accept(Long aLong) {
mPtrFrame.refreshComplete();
}
});
}
});
}