diff --git a/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt b/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt index efd1efdca4..5833ba6f28 100644 --- a/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt @@ -105,7 +105,8 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) { fun refreshRecentVGameIfNeeded() { if (VHelper.isVGameOn() - && SPUtils.getBoolean(Constants.SP_HOME_VGAME_AREA_ENABLED, true)) { + && SPUtils.getBoolean(Constants.SP_HOME_VGAME_AREA_ENABLED, true) + ) { val entityList = getSortedVEntityList() if (entityList.isNotEmpty()) { @@ -132,7 +133,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) { * 完成下载但未启动过的游戏:按照点击下载的时间倒序排列 * 完成下载且已启动过的游戏:按照游戏的畅玩时长从左(长)向右(短)排列 */ - private fun getSortedVEntityList() : List { + private fun getSortedVEntityList(): List { val rawDownloadEntityList = DownloadManager.getInstance().allVDownloadTaskSnapshots val rawInstalledEntityList = VHelper.getAllVGameSnapshots() val rawEntityList = arrayListOf() @@ -439,6 +440,9 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) { attachGame.attachGame?.linkGame?.outerSequence = attachGame.blockPosition attachGame.attachGame?.linkGame?.sequence = attachGame.blockPosition mSnapshotItemList.add(attachGame) + homeContent.linkGame?.let { + addGamePositionAndPackage(it) + } } else if (linkType == "top_game_comment") { val head = HomeItemData() head.columnHead = SubjectEntity(type = linkType, name = "安利墙")