下载模拟器游戏

This commit is contained in:
张玉久
2020-10-12 16:21:11 +08:00
parent f21d86c8a7
commit 6efc1e06bb
11 changed files with 146 additions and 19 deletions

View File

@ -5,13 +5,13 @@ import android.graphics.Color;
import android.text.TextUtils;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.gh.common.constant.Config;
import com.gh.common.emulator.EmulatorGameManager;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.ApkLink;
import com.gh.gamecenter.entity.EmulatorGameEntity;
import com.gh.gamecenter.entity.GameCollectionEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
@ -24,6 +24,8 @@ import com.lightgame.download.DownloadStatus;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
public class GameUtils {
/**
@ -116,6 +118,14 @@ public class GameUtils {
installCount++;
}
}
// TODO: 修改后缀
apkEntity.setFormat("nes");
if (EmulatorGameManager.formats.contains(apkEntity.getFormat())) {
EmulatorGameEntity emulatorGameEntity = EmulatorGameManager.findGameByName(gameEntity.getName());
if (emulatorGameEntity != null) {
installCount++;
}
}
}
if (doneCount != 0) {
return context.getString(R.string.install);
@ -238,7 +248,7 @@ public class GameUtils {
}
}
}
collectionEntity.setSaveApkEntity(saveApkEntity);
return collectionEntity;
}