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 a6db700f27..4e2e4be2fc 100644 --- a/app/src/main/java/com/gh/common/util/GameUtils.java +++ b/app/src/main/java/com/gh/common/util/GameUtils.java @@ -8,6 +8,7 @@ import androidx.annotation.WorkerThread; import com.gh.common.constant.Config; import com.gh.common.simulator.SimulatorGameManager; +import com.gh.gamecenter.common.constant.Constants; import com.gh.gamecenter.feature.view.DownloadButton; import com.gh.download.DownloadManager; import com.gh.gamecenter.R; @@ -180,7 +181,8 @@ public class GameUtils { if (gameEntity.isVGame()) { return context.getString(R.string.smooth); } else { - if ("smooth".equals(gameEntity.getDownloadStatus())) { + if (Constants.V_GAME.equals(gameEntity.getDownloadStatus()) + || Constants.V_GAME_32.equals(gameEntity.getDownloadStatus())) { GameEntity.GameCategory gameCategory = gameEntity.getGameCategory(); if (gameCategory.equals(GameEntity.GameCategory.ONLINE_GAME) || gameCategory.equals(GameEntity.GameCategory.INTERNATIONAL_ONLINE_GAME)) { diff --git a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameViewModel.kt b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameViewModel.kt index 54d6126158..aef843d35c 100644 --- a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameViewModel.kt @@ -78,7 +78,9 @@ class UpdatableGameViewModel( // 有闪退日志说这个 update 实体可能为空,实在看不原因 :( if (update == null) continue // 筛选仅下载管理出现的插件化更新 - if (update.isShowPlugin(PluginLocation.only_index) && update.downloadStatus != "smooth") { + if (update.isShowPlugin(PluginLocation.only_index) + && update.downloadStatus != Constants.V_GAME + && update.downloadStatus != Constants.V_GAME_32) { val platform = PlatformUtils.getInstance(getApplication()).getPlatformName(update.platform) if (!platform.isNullOrEmpty() && "官方版" != platform) { diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameUpdateEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameUpdateEntity.kt index f073a3d64b..a6a61f58c0 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameUpdateEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameUpdateEntity.kt @@ -1,5 +1,6 @@ package com.gh.gamecenter.entity +import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.entity.IconFloat import com.gh.gamecenter.feature.exposure.ExposureEvent import com.gh.gamecenter.feature.entity.* @@ -60,7 +61,7 @@ data class GameUpdateEntity( val downloadStatusChinese: String get() = when (downloadStatus) { "on" -> "开启" - "smooth" -> "畅玩" + Constants.V_GAME, Constants.V_GAME_32 -> "畅玩" "appointment" -> "预约" "demo" -> "试玩" else -> "" diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt index e20a001e43..eaacb33066 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt @@ -2290,7 +2290,7 @@ class GameDetailFragment : ToolbarFragment(), IScrollable { mDownloadBinding.ivVmode.enlargeTouchArea() mDownloadBinding.ivVmode.setOnClickListener { _ -> val downloadStatus = when (entity.downloadStatus) { - "smooth" -> "畅玩" + Constants.V_GAME, Constants.V_GAME_32 -> "畅玩" "demo" -> "试玩" else -> "下载" } diff --git a/app/src/main/java/com/gh/vspace/VHelper.kt b/app/src/main/java/com/gh/vspace/VHelper.kt index b9991ae5f5..3f1b2b7d47 100644 --- a/app/src/main/java/com/gh/vspace/VHelper.kt +++ b/app/src/main/java/com/gh/vspace/VHelper.kt @@ -974,7 +974,7 @@ object VHelper { validateVSpaceBeforeAction(context, GameEntity().apply { id = gameId name = gameName - downloadStatus = "smooth" + downloadStatus = Constants.V_GAME category = gameType setApk(arrayListOf(ApkEntity(packageName = packageName, bit = bit))) }) { @@ -1390,7 +1390,7 @@ object VHelper { iconSubscript = downloadEntity.getMetaExtra(Constants.GAME_ICON_SUBSCRIPT) lastPlayedTime = if (lastPlayedTimeString == "") 0L else lastPlayedTimeString.toLong() playedTime = getPlayedTime(downloadEntity.packageName, downloadEntity) - downloadStatus = "smooth" + downloadStatus = Constants.V_GAME setEntryMap(DownloadManager.getInstance().getEntryMap(name)) } } diff --git a/module_common/src/main/java/com/gh/gamecenter/common/constant/Constants.java b/module_common/src/main/java/com/gh/gamecenter/common/constant/Constants.java index ef611604bb..ef3b16425c 100644 --- a/module_common/src/main/java/com/gh/gamecenter/common/constant/Constants.java +++ b/module_common/src/main/java/com/gh/gamecenter/common/constant/Constants.java @@ -471,4 +471,7 @@ public class Constants { public static final String FINISH_HOME_PUSH = "finish_home_push"; public static final String SP_SHOW_GAME_COLLECTION_SQUARE_FILTER_GUIDE = "show_game_collection_square_filter_guide"; + + public static final String V_GAME = "smooth"; + public static final String V_GAME_32 = "smooth_32"; } diff --git a/module_core_feature/src/main/java/com/gh/gamecenter/feature/entity/GameEntity.kt b/module_core_feature/src/main/java/com/gh/gamecenter/feature/entity/GameEntity.kt index f8ee243933..dfbf749473 100644 --- a/module_core_feature/src/main/java/com/gh/gamecenter/feature/entity/GameEntity.kt +++ b/module_core_feature/src/main/java/com/gh/gamecenter/feature/entity/GameEntity.kt @@ -559,7 +559,7 @@ data class GameEntity( val downloadStatusChinese: String get() = when (downloadStatus) { "on" -> "开启" - "smooth" -> "畅玩" + Constants.V_GAME, Constants.V_GAME_32 -> "畅玩" "appointment" -> "预约" "demo" -> "试玩" else -> "" @@ -780,7 +780,7 @@ data class GameEntity( mIsVGame = if (vHelperProvider?.isVGameOn() == false) { false } else { - downloadStatus == "smooth" + downloadStatus == Constants.V_GAME || downloadStatus == Constants.V_GAME_32 } }