| | |
| | | import com.weikou.beibeivideo.ui.dialog.FloatADDialog; |
| | | import com.weikou.beibeivideo.ui.recommend.RecommendFragment; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.JsonUtil; |
| | | import com.weikou.beibeivideo.util.UmengEventUtil; |
| | | import com.weikou.beibeivideo.util.cache.DiskLruCacheManager; |
| | | |
| | |
| | | pager.getContext()); |
| | | |
| | | if (!StringUtils.isBlank(cacheValue)) { |
| | | Gson gson = new GsonBuilder().setFieldNamingPolicy( |
| | | FieldNamingPolicy.UPPER_CAMEL_CASE).create(); |
| | | List<HomeClass> list = gson.fromJson( |
| | | |
| | | List<HomeClass> list = JsonUtil.videoGson.fromJson( |
| | | cacheValue, |
| | | new TypeToken<List<HomeClass>>() { |
| | | }.getType()); |
| | |
| | | Header[] headers, JSONObject jsonObject) |
| | | throws Exception { |
| | | if (jsonObject.getBoolean("IsPost")) { |
| | | Gson gson = new GsonBuilder().setFieldNamingPolicy( |
| | | FieldNamingPolicy.UPPER_CAMEL_CASE) |
| | | .create(); |
| | | |
| | | categories.clear(); |
| | | |
| | | List<HomeClass> list = gson.fromJson( |
| | | List<HomeClass> list = JsonUtil.videoGson.fromJson( |
| | | jsonObject.getJSONObject("Data") |
| | | .getJSONArray("data").toString(), |
| | | new TypeToken<List<HomeClass>>() { |
| | | }.getType()); |
| | | |
| | | categories.addAll(list); |
| | | if (categories.size() > 0) { |
| | | HomeClass feedVideos = new HomeClass(); |
| | | feedVideos.setDataType("feedVideos"); |
| | | feedVideos.setName("刷一刷"); |
| | | categories.add(1, feedVideos); |
| | | } |
| | | |
| | | if (categories != null) |
| | | for (int i = 0; i < categories.size(); i++) { |
| | | if (categories.get(i).getDataType().equalsIgnoreCase("novel")) { |
| | |
| | | |
| | | |
| | | count++; |
| | | DiskLruCacheManager.getInstance(BeibeiVideoApplication.application).cache(getKey("getCategories"), gson.toJson(categories)); |
| | | DiskLruCacheManager.getInstance(BeibeiVideoApplication.application).cache(getKey("getCategories"), JsonUtil.videoGson.toJson(categories)); |
| | | } |
| | | } |
| | | |