use of org.aisen.weibo.sina.support.bean.WallpaperBean in project AisenWeiBo by wangdan.
the class WallpaperCacheUtility method findCacheData.
@Override
public IResult findCacheData(Setting action, Params params) {
int page = Integer.parseInt(params.getParameter("page"));
// 只有第一次加载数据的时候才加载缓存
if (page == 1) {
// 根据id倒序
List<WallpaperBean> beanList = SinaDB.getDB().select(null, WallpaperBean.class);
if (beanList.size() > 0) {
WallpaperBeans beans = new WallpaperBeans();
beans.setItem(new WallpaperBeans.Data());
beans.getItem().setWallpaperList(beanList);
beans.setFromCache(true);
beans.setEndPaging(beanList.size() == 0);
beans.setOutofdate(CacheTimeUtils.isOutofdate("Wallpaper", null));
return beans;
}
}
return null;
}
use of org.aisen.weibo.sina.support.bean.WallpaperBean in project AisenWeiBo by wangdan.
the class WallpaperFragment method onItemClick.
@Override
public void onItemClick(PLAAdapterView<?> parent, View view, int position, long id) {
super.onItemClick(parent, view, position, id);
WallpaperBean bean = getAdapterItems().get(position);
File file = BitmapLoader.getInstance().getCacheFile(bean.getIndexThumbnailUrl());
if (file != null && file.exists()) {
WallpaperSettingActivity.launch(getActivity(), file, bean.getNormalUrl());
}
}
Aggregations