根据包名过滤下载按钮状态

This commit is contained in:
kehaoyuan
2019-01-20 10:17:23 +08:00
parent c99ae6db3e
commit 7f55ff6340
3 changed files with 16 additions and 1 deletions

View File

@ -6,12 +6,14 @@ import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.widget.TextView;
import com.gh.common.constant.Config;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.manager.PackagesManager;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadStatus;
@ -70,9 +72,18 @@ public class GameUtils {
int installCount = 0; // 已安装数量
DownloadEntity downloadEntity;
Object gh_id;
apkFor:
for (ApkEntity apkEntity : gameEntity.getApk()) {
// todo filter by packageName
// filter by packageName
SettingsEntity settings = Config.getSettings();
if (settings != null) {
for (String pkgName : settings.getGameDownloadBlackList()) {
if (pkgName.equals(apkEntity.getPackageName())) {
continue apkFor;
}
}
}
downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.getUrl());
if (downloadEntity != null) {