diff --git a/app/src/main/java/com/gh/common/exposure/ExposureUtils.kt b/app/src/main/java/com/gh/common/exposure/ExposureUtils.kt index 079be0c53e..b714be61b5 100644 --- a/app/src/main/java/com/gh/common/exposure/ExposureUtils.kt +++ b/app/src/main/java/com/gh/common/exposure/ExposureUtils.kt @@ -8,7 +8,6 @@ import com.gh.common.util.toObject import com.gh.gamecenter.entity.ApkEntity import com.gh.gamecenter.entity.GameEntity import com.halo.assistant.HaloApp -import java.util.* object ExposureUtils { @@ -25,7 +24,8 @@ object ExposureUtils { } else { entity.id } - gameEntity.gameVersion = entity.getApk().elementAtOrNull(0)?.version ?: gameEntity.gameVersion + gameEntity.gameVersion = entity.getApk().elementAtOrNull(0)?.version + ?: gameEntity.gameVersion gameEntity.platform = platform gameEntity.downloadType = downloadType.toString() val exposureEvent = ExposureEvent.createEvent(gameEntity = gameEntity, @@ -90,6 +90,15 @@ object ExposureUtils { } } + @JvmStatic + fun updateExposureSequence(gameList: List?) { + gameList?.let { + for ((index, game) in it.withIndex()) { + game.sequence = index + } + } + } + enum class DownloadType { DOWNLOAD, diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt index adc827ed1c..ef841e596e 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt @@ -94,8 +94,6 @@ class NewCatalogListAdapter(context: Context, GameViewUtils.setLabelList(mContext, holder.binding.labelList, gameEntity.tagStyle) - gameEntity.sequence = position - val sortType = mViewModel.sortType.value val sortSize = mViewModel.sortSize.text val toolbarTitle = mViewModel.title @@ -105,7 +103,6 @@ class NewCatalogListAdapter(context: Context, exposureSources.add(mBaseExposureSource) exposureSources.add(ExposureSource(toolbarTitle)) exposureSources.add(ExposureSource("二级分类详情", "$selectedCatalogName+$sortType+$sortSize")) - gameEntity.sequence = position val event = ExposureEvent.createEvent(gameEntity, exposureSources, null, ExposureType.EXPOSURE) mExposureEventSparseArray.put(position, event) diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt index 23ffc1575e..967577ca10 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListViewModel.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.catalog import android.app.Application import androidx.lifecycle.MutableLiveData +import com.gh.common.exposure.ExposureUtils import com.gh.common.util.UrlFilterUtils import com.gh.common.view.CatalogFilterView import com.gh.gamecenter.baselist.ListViewModel @@ -35,7 +36,10 @@ class NewCatalogListViewModel(application: Application) : ListViewModel() exposureSources.add(ExposureSource(categoryTitle, selectedCategoryName)) exposureSources.add(ExposureSource("二级分类", "$selectedCategoryName+$sortType")) - gameEntity.sequence = position val event = ExposureEvent.createEvent(gameEntity, exposureSources, null, ExposureType.EXPOSURE) mExposureEventSparseArray.put(position, event) diff --git a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt index 13caf38935..6e4bff1f06 100644 --- a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListViewModel.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.category import android.app.Application import androidx.lifecycle.MutableLiveData +import com.gh.common.exposure.ExposureUtils import com.gh.common.util.UrlFilterUtils import com.gh.common.view.ConfigFilterView import com.gh.gamecenter.baselist.ListViewModel @@ -36,7 +37,10 @@ class NewCategoryListViewModel(application: Application) } override fun mergeResultLiveData() { - mResultLiveData.addSource(mListLiveData) { mResultLiveData.postValue(it) } + mResultLiveData.addSource(mListLiveData) { + ExposureUtils.updateExposureSequence(it) + mResultLiveData.postValue(it) + } } fun changeSelectedCategory(category: CategoryEntity) { diff --git a/app/src/main/java/com/gh/gamecenter/entity/CommentEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/CommentEntity.kt index 9dce2abf99..96024b077b 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/CommentEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/CommentEntity.kt @@ -14,7 +14,7 @@ data class CommentEntity(@SerializedName("_id") @SerializedName("parent_user") var parentUser: CommentParentEntity? = null, var content: String? = null, - @SyncPage(syncNames = [SyncFieldConstants.ARTICLE_COMMENT_VOTE, SyncFieldConstants.ARTICLE_COMMENT_VOTE_COUNT]) + @SyncPage(syncNames = [SyncFieldConstants.ARTICLE_COMMENT_VOTE_COUNT]) var vote: Int = 0, @SyncPage(syncNames = [SyncFieldConstants.ARTICLE_COMMENT_REPLY_COUNT]) var reply: Int = 0, diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.java b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.java index 360de7d19a..e39b092efc 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.java @@ -390,7 +390,6 @@ public class GameServersContentAdapter extends BaseRecyclerAdapter implements IE sb.append("今日开测"); } else if ("after".equals(mDay)) { sb.append("后续开测"); - sb.append(mType); } else if ("tomorrow".equals(mDay)) { sb.append("明日开测"); } else { diff --git a/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt b/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt index 819c8c6c10..5766969baf 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/SubjectListViewModel.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.subject import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider +import com.gh.common.exposure.ExposureUtils import com.gh.gamecenter.baselist.ListViewModel import com.gh.gamecenter.baselist.LoadStatus import com.gh.gamecenter.baselist.LoadType @@ -35,9 +36,7 @@ class SubjectListViewModel(application: Application, override fun mergeResultLiveData() { mResultLiveData.addSource(mListLiveData) { - for ((index, game) in it.withIndex()) { - game.sequence = index - } + ExposureUtils.updateExposureSequence(it) mResultLiveData.postValue(it) } } diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt index 2fcad5069c..365d3b1a09 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.app.Application import androidx.lifecycle.MutableLiveData import com.gh.common.exposure.ExposureSource +import com.gh.common.exposure.ExposureUtils import com.gh.common.util.UrlFilterUtils import com.gh.common.view.ConfigFilterView import com.gh.gamecenter.baselist.ListViewModel @@ -42,9 +43,7 @@ class TagsListViewModel(application: Application) : ListViewModel