From c99ae6db3e300f5293f0fdfdfd6387c34c7bf823 Mon Sep 17 00:00:00 2001 From: kehaoyuan Date: Thu, 17 Jan 2019 15:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=B8=E6=88=8F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8B=E8=BD=BD=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/gh/common/util/DownloadItemUtils.java | 3 +-- app/src/main/java/com/gh/common/util/GameUtils.java | 9 +-------- .../gh/gamecenter/qa/select/SelectGameDialogAdapter.java | 6 +++++- .../java/com/gh/gamecenter/qa/select/VotingFragment.java | 3 ++- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java index fb717c9b4d..167712bac1 100644 --- a/app/src/main/java/com/gh/common/util/DownloadItemUtils.java +++ b/app/src/main/java/com/gh/common/util/DownloadItemUtils.java @@ -159,6 +159,7 @@ public class DownloadItemUtils { // 更新插件的条目,有多个apk包 private static void updatePluginItem(Context context, GameViewHolder holder, GameEntity gameEntity, boolean isShowPlatform, PluginLocation pluginLocation) { + GameUtils.setDownloadBtnStatus(context, gameEntity, holder.gameDownloadBtn, pluginLocation); ArrayMap entryMap = gameEntity.getEntryMap(); if (entryMap != null && !entryMap.isEmpty()) { @@ -177,8 +178,6 @@ public class DownloadItemUtils { } } - GameUtils.setDownloadBtnStatus(context, gameEntity, holder.gameDownloadBtn, pluginLocation); - holder.gameDes.setVisibility(View.VISIBLE); holder.gameProgressbar.setVisibility(View.GONE); holder.gameInfo.setVisibility(View.GONE); diff --git a/app/src/main/java/com/gh/common/util/GameUtils.java b/app/src/main/java/com/gh/common/util/GameUtils.java index 6b9e51fd42..32f518acfd 100644 --- a/app/src/main/java/com/gh/common/util/GameUtils.java +++ b/app/src/main/java/com/gh/common/util/GameUtils.java @@ -9,7 +9,6 @@ import android.widget.TextView; import com.gh.download.DownloadManager; import com.gh.gamecenter.R; import com.gh.gamecenter.entity.ApkEntity; -import com.gh.gamecenter.entity.GameCollectionEntity; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.GameUpdateEntity; import com.gh.gamecenter.entity.PluginLocation; @@ -73,13 +72,7 @@ public class GameUtils { Object gh_id; for (ApkEntity apkEntity : gameEntity.getApk()) { - // 去除下载合集判断 - boolean isCollection = false; - for (GameCollectionEntity collectionEntity : gameEntity.getCollection()) { - if (collectionEntity.getPackage().contains(apkEntity.getPackageName())) - isCollection = true; - } - if (isCollection) continue; + // todo filter by packageName downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.getUrl()); if (downloadEntity != null) { diff --git a/app/src/main/java/com/gh/gamecenter/qa/select/SelectGameDialogAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/select/SelectGameDialogAdapter.java index 0aa9572635..f9174ab48a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/select/SelectGameDialogAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/select/SelectGameDialogAdapter.java @@ -6,6 +6,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.support.annotation.Nullable; +import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -43,13 +44,15 @@ import retrofit2.HttpException; public class SelectGameDialogAdapter extends BaseRecyclerAdapter { private ProgressBar pb; + private RecyclerView mRecyclerView; private List gameList; private List appList; private Map mSelectMap; - public SelectGameDialogAdapter(Context context, ProgressBar pb) { + public SelectGameDialogAdapter(Context context, ProgressBar pb, RecyclerView recyclerView) { super(context); this.pb = pb; + this.mRecyclerView = recyclerView; mSelectMap = new HashMap<>(); gameList = new ArrayList<>(); appList = new ArrayList<>(); @@ -152,6 +155,7 @@ public class SelectGameDialogAdapter extends BaseRecyclerAdapter