本文整理汇总了Java中in.srain.cube.request.RequestFinishHandler类的典型用法代码示例。如果您正苦于以下问题:Java RequestFinishHandler类的具体用法?Java RequestFinishHandler怎么用?Java RequestFinishHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestFinishHandler类属于in.srain.cube.request包,在下文中一共展示了RequestFinishHandler类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.refreshComplete();
mAdapter.notifyDataSetChanged();
}
}, 0);
}
});
}
示例2: updateData2
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData2() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
//mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.loadComplete();
mAdapter.notifyDataSetChanged();
}
}, 0);
}
});
}
示例3: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.refreshComplete();
mAdapter.notifyDataSetChanged();
}
}, 0);
}
});
}
示例4: updateData2
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData2() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
//mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.loadComplete();
mAdapter.notifyDataSetChanged();
if(mAdapter.getCount()>280){
mPtrFrame.setLoadFinishComplete(true);
}
}
}, 0);
}
});
}
示例5: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
mPtrFrame.postDelayed(new Runnable() {
@Override
public void run() {
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList().subList(0,10));
mPtrFrame.refreshComplete();
mAdapter.notifyDataSetChanged();
}
}, 0);
}
});
}
开发者ID:tangnuo,项目名称:android-Ultra-Pull-To-Refresh-With-Load-More-master,代码行数:18,代码来源:WithGridView.java
示例6: getImageList
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
public static void getImageList(final RequestFinishHandler<JsonData> requestFinishHandler) {
CacheAbleRequestHandler requestHandler = new CacheAbleRequestJsonHandler() {
@Override
public void onCacheAbleRequestFinish(JsonData data, CacheAbleRequest.ResultType type, boolean outOfDate) {
requestFinishHandler.onRequestFinish(data);
}
};
CacheAbleRequest<JsonData> request = new CacheAbleRequest<JsonData>(requestHandler);
String url = "http://cube-server.liaohuqiu.net/api_demo/image-list.php";
request.setCacheTime(3600);
request.setTimeout(1000);
request.getRequestData().setRequestUrl(url);
request.setAssertInitDataPath("request_init/image-list.json");
request.setCacheKey("image-list-1");
request.send();
}
示例7: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData() {
final ViewPagerFragment fragment = mCurrentFragment;
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
if (fragment == mCurrentFragment) {
fragment.update(data);
mPtrFrame.refreshComplete();
}
}
});
}
示例8: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
protected void updateData() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
displayData(data);
}
});
}
示例9: updateData
import in.srain.cube.request.RequestFinishHandler; //导入依赖的package包/类
public void updateData() {
final ViewPagerFragment fragment = mCurrentFragment;
RequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
if (fragment == mCurrentFragment) {
fragment.update(data);
mPtrFrame.refreshComplete();
}
}
});
}