本文整理汇总了Java中in.srain.cube.request.JsonData类的典型用法代码示例。如果您正苦于以下问题:Java JsonData类的具体用法?Java JsonData怎么用?Java JsonData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsonData类属于in.srain.cube.request包,在下文中一共展示了JsonData类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateData
import in.srain.cube.request.JsonData; //导入依赖的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);
}
});
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:WithListView.java
示例2: updateData2
import in.srain.cube.request.JsonData; //导入依赖的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);
}
});
}
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:18,代码来源:WithListView.java
示例3: updateData
import in.srain.cube.request.JsonData; //导入依赖的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);
}
});
}
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:19,代码来源:WithGridView.java
示例4: updateData2
import in.srain.cube.request.JsonData; //导入依赖的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);
}
});
}
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:22,代码来源:WithGridView.java
示例5: updateData
import in.srain.cube.request.JsonData; //导入依赖的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.JsonData; //导入依赖的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();
}
开发者ID:cnlinrong,项目名称:MyAndroidFramework,代码行数:21,代码来源:RequestData.java
示例7: updateData
import in.srain.cube.request.JsonData; //导入依赖的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();
}
}
});
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ViewPagerActivity.java
示例8: updateData
import in.srain.cube.request.JsonData; //导入依赖的package包/类
protected void updateData() {
DemoRequestData.getImageList(new RequestFinishHandler<JsonData>() {
@Override
public void onRequestFinish(final JsonData data) {
displayData(data);
}
});
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:WithListViewAndEmptyView.java
示例9: displayData
import in.srain.cube.request.JsonData; //导入依赖的package包/类
private void displayData(JsonData data) {
mTextView.setVisibility(View.GONE);
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.refreshComplete();
mAdapter.notifyDataSetChanged();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:WithListViewAndEmptyView.java
示例10: updateData
import in.srain.cube.request.JsonData; //导入依赖的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();
}
}
});
}
开发者ID:cnlinrong,项目名称:MyAndroidFramework,代码行数:15,代码来源:FragmentViewPagerAdapter.java
示例11: parseQuery
import in.srain.cube.request.JsonData; //导入依赖的package包/类
private void parseQuery() {
mQueryData = JsonData.newMap();
String query = mQuery;
int start = 0;
do {
int nextAmpersand = query.indexOf('&', start);
// to next & or to the end of String
int end = nextAmpersand != -1 ? nextAmpersand : query.length();
// no more key-value
int separator = query.indexOf('=', start);
if (separator > end || separator == -1) {
break;
}
// make sure key is no empty
if (separator != start) {
mQueryData.put(Uri.decode(query.substring(start, separator)),
Uri.decode(query.substring(separator + 1, end)));
}
// Move start to end of name.
if (nextAmpersand != -1) {
start = nextAmpersand + 1;
} else {
break;
}
} while (true);
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:31,代码来源:CustomizedUri.java
示例12: processRawDataFromCache
import in.srain.cube.request.JsonData; //导入依赖的package包/类
@Override
public T processRawDataFromCache(JsonData rawData) {
if (mHandler != null) {
return (T) mHandler.processRawDataFromCache(rawData);
}
return null;
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:8,代码来源:Query.java
示例13: doQueryFromCacheFileInBackground
import in.srain.cube.request.JsonData; //导入依赖的package包/类
private void doQueryFromCacheFileInBackground() {
if (DEBUG) {
CLog.d(LOG_TAG, "key: %s, try read cache data from file", mCacheAble.getCacheKey());
}
String cacheContent = mFileCache.read(mCacheAble.getCacheKey());
JsonData jsonData = JsonData.create(cacheContent);
mRawData = CacheMetaData.createFromJson(jsonData);
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:10,代码来源:CacheManager.java
示例14: doConvertDataInBackground
import in.srain.cube.request.JsonData; //导入依赖的package包/类
private void doConvertDataInBackground() {
if (DEBUG) {
CLog.d(LOG_TAG, "key: %s, doConvertDataInBackground", mCacheAble.getCacheKey());
}
JsonData data = JsonData.create(mRawData.getData());
mResult = mCacheAble.processRawDataFromCache(data);
}
开发者ID:liaohuqiu,项目名称:cube-sdk,代码行数:8,代码来源:CacheManager.java
示例15: update
import in.srain.cube.request.JsonData; //导入依赖的package包/类
public void update(JsonData data) {
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mAdapter.notifyDataSetChanged();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:ViewPagerFragment.java
示例16: showData
import in.srain.cube.request.JsonData; //导入依赖的package包/类
@Override
public void showData(int position, JsonData itemData) {
mImageView.loadImage(mImageLoader, itemData.optString("pic"));
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ImageListViewHolder.java
示例17: showData
import in.srain.cube.request.JsonData; //导入依赖的package包/类
@Override
public void showData(int position, JsonData itemData) {
String url = itemData.optString("pic");
mImageView.loadImage(mImageLoader, url);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:WithGridView.java
示例18: displayData
import in.srain.cube.request.JsonData; //导入依赖的package包/类
private void displayData(JsonData data) {
mAdapter.getDataList().clear();
mAdapter.getDataList().addAll(data.optJson("data").optJson("list").toArrayList());
mPtrFrame.refreshComplete();
mAdapter.notifyDataSetChanged();
}
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:7,代码来源:WithListViewAndEmptyView.java
注:本文中的in.srain.cube.request.JsonData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论