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