From f0437cb285015d44160d4c0f4096e91ba07eab8a Mon Sep 17 00:00:00 2001 From: gudong <1252768410@qq.com> Date: Tue, 20 Oct 2015 18:17:16 +0800 Subject: [PATCH] add the new type of gank data which the name is App --- .../main/java/me/drakeet/meizhi/data/GankData.java | 1 + .../main/java/me/drakeet/meizhi/ui/GankFragment.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/me/drakeet/meizhi/data/GankData.java b/app/src/main/java/me/drakeet/meizhi/data/GankData.java index 2642aa3..5dd9769 100644 --- a/app/src/main/java/me/drakeet/meizhi/data/GankData.java +++ b/app/src/main/java/me/drakeet/meizhi/data/GankData.java @@ -40,5 +40,6 @@ public class Result { @SerializedName("福利") public List 妹纸List; @SerializedName("拓展资源") public List 拓展资源List; @SerializedName("瞎推荐") public List 瞎推荐List; + @SerializedName("App") public ListappList; } } diff --git a/app/src/main/java/me/drakeet/meizhi/ui/GankFragment.java b/app/src/main/java/me/drakeet/meizhi/ui/GankFragment.java index 3feb98c..821b002 100644 --- a/app/src/main/java/me/drakeet/meizhi/ui/GankFragment.java +++ b/app/src/main/java/me/drakeet/meizhi/ui/GankFragment.java @@ -32,22 +32,25 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewStub; -import butterknife.Bind; -import butterknife.ButterKnife; -import butterknife.OnClick; + import com.bumptech.glide.Glide; import com.squareup.okhttp.Callback; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; import com.squareup.otto.Subscribe; + import java.io.IOException; import java.util.ArrayList; import java.util.List; + +import butterknife.Bind; +import butterknife.ButterKnife; +import butterknife.OnClick; +import me.drakeet.meizhi.LoveBus; import me.drakeet.meizhi.R; import me.drakeet.meizhi.adapter.GankListAdapter; import me.drakeet.meizhi.data.GankData; -import me.drakeet.meizhi.LoveBus; import me.drakeet.meizhi.event.OnKeyBackClickEvent; import me.drakeet.meizhi.model.Gank; import me.drakeet.meizhi.ui.base.BaseActivity; @@ -178,6 +181,7 @@ private void getAndParseVideoPreview() { private List addAllResults(GankData.Result results) { if (results.androidList != null) mGankList.addAll(results.androidList); if (results.iOSList != null) mGankList.addAll(results.iOSList); + if (results.appList != null) mGankList.addAll(results.appList); if (results.拓展资源List != null) mGankList.addAll(results.拓展资源List); if (results.瞎推荐List != null) mGankList.addAll(results.瞎推荐List); if (results.休息视频List != null) mGankList.addAll(0, results.休息视频List);