From 22c06286c243c85b192fde50eada2fa878dddefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=8E=89=E4=B9=85?= Date: Wed, 17 Aug 2022 16:57:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=8D=A1=E7=89=87=E4=B8=8B=E8=BD=BD=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=8D=E4=BC=9A=E6=A0=B9=E6=8D=AE=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=E6=98=BE=E7=A4=BA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/gh/gamecenter/home/HomeViewModel.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 = "安利墙")