Merge branch 'dev-5.3.0' of git.ghzs.com:halo/android/assistant-android into dev-5.3.0

# Conflicts:
#	app/src/main/java/com/gh/gamecenter/entity/LinkEntity.kt
This commit is contained in:
jack
2021-09-26 10:38:50 +08:00
8 changed files with 25 additions and 8 deletions

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.entity
import android.os.Parcelable
import com.gh.common.exposure.ExposureEvent
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
@ -35,7 +36,9 @@ open class LinkEntity(
@SerializedName("added_content_2")
var addedContent2: String = "",
//本地字段
//本地字段 (埋点用)
var blockId: String = "",
var blockName: String = ""
var blockName: String = "",
// 本地字段 (关联的曝光)
var exposureEvent: ExposureEvent? = null
) : Parcelable

View File

@ -51,7 +51,10 @@ data class SubjectEntity(
// 专题合集,用于首页专题合集-排行榜样式
var columns: MutableList<SubjectEntity> = mutableListOf(),
// 专题背景,用于首页专题合集-排行榜样式
var background: String = ""
var background: String = "",
// 本地字段,用来标记在外部页面中的序号,仅用于曝光记录,具体细节可见 https://git.ghzs.com/pm/halo-app-issues/-/issues/1087
var outerSequence: Int = -1
) : Parcelable {
fun getFilterName(): String {

View File

@ -279,8 +279,15 @@ class GameFragmentAdapter(
private fun bindCommonCollection(holder: CommonCollectionViewHolder, position: Int) {
val commonLinkCollection = mItemDataList[position].commonLinkCollection!!
val blockData = mViewModel.blockData
mItemDataList[position].exposureEventList = arrayListOf()
val clickClosure: (position: Int, linkEntity: LinkEntity) -> Unit = { sequence, linkEntity ->
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集")
DirectUtils.directToLinkPage(
mContext,
linkEntity,
"(首页游戏)",
"通用链接合集",
linkEntity.exposureEvent)
NewLogUtils.logCommonCollectionClick(
commonLinkCollection.id ?: "",
commonLinkCollection.name ?: "",
@ -311,11 +318,11 @@ class GameFragmentAdapter(
name = linkEntity.name
).also {
it.sequence = subPosition
it.outerSequence = position
it.outerSequence = commonLinkCollection.outerSequence
},
mBasicExposureSource,
listOf(ExposureSource("内容合集", commonLinkCollection.name ?: ""))
)
).also { linkEntity.exposureEvent = it }
)
}
}

View File

@ -681,6 +681,7 @@ class GameViewModel(application: Application, var blockData: SubjectRecommendEnt
}
private fun appendAdditionalInfoToSubjectGame(subject: SubjectEntity, outerPosition: Int) {
subject.outerSequence = outerPosition
subject.data?.let {
for ((index, game) in it.withIndex()) {
// 开测表不是专题不需要补充专题 id

View File

@ -182,6 +182,7 @@ class GameDetailViewModel(application: Application,
continue
}
// 处理游戏信息区域
if (item.type == DetailEntity.Type.GAME_INFO.value) {
item.info?.manufacturer = data.mirrorData?.manufacturer ?: ""
item.info?.privacyPolicyUrl = data.mirrorData?.privacyPolicyUrl ?: ""

View File

@ -399,6 +399,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
mSnapshotItemList.add(head)
commonCollectionItem.commonCollection = subjectEntity
commonCollectionItem.blockPosition = i
mSnapshotItemList.add(commonCollectionItem)
} else {
val unknown = HomeItemData()

View File

@ -722,7 +722,7 @@ class LegacyHomeFragmentAdapterAssistant(
private fun bindCommonCollection(holder: CommonCollectionViewHolder, item: LegacyHomeItemData) {
val commonCollection = item.commonCollection
val clickClosure: (position: Int, linkEntity: LinkEntity) -> Unit = { sequence, linkEntity ->
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集")
DirectUtils.directToLinkPage(mContext, linkEntity, "(首页游戏)", "通用链接合集", linkEntity.exposureEvent)
NewLogUtils.logCommonCollectionClick(
commonCollection?.id ?: "",
commonCollection?.name ?: "",
@ -757,7 +757,7 @@ class LegacyHomeFragmentAdapterAssistant(
},
mBasicExposureSources,
listOf(ExposureSource("内容合集", commonCollection.name ?: ""))
)
).also { linkEntity.exposureEvent = it }
)
}
}

View File

@ -189,6 +189,7 @@ object LegacyHomeSubjectTransformer {
}
private fun appendAdditionalInfoToSubjectGame(subject: SubjectEntity, outerPosition: Int) {
subject.outerSequence = outerPosition
subject.data?.let {
for ((index, game) in it.withIndex()) {
if (subject.tag != "test") {