【光环助手V5.3.0】通用链接内容合集-数据埋点(测试补充:3(1)(3),4) https://git.ghzs.com/pm/halo-app-issues/-/issues/1474

This commit is contained in:
jack
2021-09-26 10:37:32 +08:00
parent 1fabcc756d
commit 486e9ae0c5
8 changed files with 51 additions and 12 deletions

View File

@ -352,7 +352,7 @@ object DirectUtils {
"halo_tab" -> directToPersonalTab(context)
"common_collection" -> directToCommonCollectionDetail(context, linkEntity.link ?: "", entrance)
"common_collection" -> directToCommonCollectionDetail(context, linkEntity.link ?: "", linkEntity.blockId, linkEntity.blockName, entrance)
//"h5_game_center" -> directLetoGameCenter(context)
@ -1632,11 +1632,15 @@ object DirectUtils {
fun directToCommonCollectionDetail(
context: Context,
collectionId: String,
blockId: String = "",
blockName: String = "",
entrance: String = ""
) {
if (collectionId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, CommonCollectionDetailActivity::class.java.name)
bundle.putString(KEY_BLOCK_ID, blockId)
bundle.putString(KEY_BLOCK_NAME, blockName)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_COLLECTION_ID, collectionId)
jumpActivity(context, bundle)

View File

@ -247,6 +247,8 @@ public class EntranceUtils {
public static final String KEY_COMMENT_COUNT = "comment_count";
public static final String KEY_IS_COMMENT_CONVERSATION = "is_comment_conversation";
public static final String KEY_PARENT_TAG = "parent_tag";
public static final String KEY_BLOCK_ID = "block_id";
public static final String KEY_BLOCK_NAME = "block_name";
public static void jumpActivity(Context context, Bundle bundle) {
bundle.putBoolean(KEY_REQUIRE_REDIRECT, true);

View File

@ -33,5 +33,9 @@ open class LinkEntity(
@SerializedName("added_content_1")
var addedContent1: String = "",
@SerializedName("added_content_2")
var addedContent2: String = ""
var addedContent2: String = "",
//本地字段
var blockId: String = "",
var blockName: String = ""
) : Parcelable

View File

@ -302,7 +302,8 @@ class GameFragmentAdapter(
"板块内容列表",
blockData?.link ?: "",
blockData?.name ?: "",
clickClosure) { subPosition, linkEntity ->
clickClosure
) { subPosition, linkEntity ->
mItemDataList[position].exposureEventList?.add(
ExposureEvent.createEventWithSourceConcat(
GameEntity(
@ -613,8 +614,16 @@ class GameFragmentAdapter(
// else -> DialogUtils.showLowVersionDialog(mContext)
entity.type == "common_collection" -> {
val linkEntity =
LinkEntity(name = entity.name, link = entity.link, text = entity.text, type = entity.type, display = entity.display)
DirectUtils.directToLinkPage(mContext, linkEntity, "(推荐入口)", "")
LinkEntity(
name = entity.name,
link = entity.link,
text = entity.text,
type = entity.type,
display = entity.display,
blockId = blockData?.link ?: "",
blockName = blockData?.name ?: ""
)
DirectUtils.directToLinkPage(mContext, linkEntity, "板块推荐入口", "")
NewLogUtils.logAccessToCommonCollectionDetail(
entity.link ?: "",
entity.text ?: "",
@ -790,14 +799,16 @@ class GameFragmentAdapter(
DirectUtils.directToColumnCollection(mContext, column.id!!, -1, "(推荐入口)")
}
"common_collection" -> {
val blockData = mViewModel.blockData
mContext.startActivity(
CommonCollectionDetailActivity.getIntent(
mContext,
column.id ?: "",
blockData?.link ?: "",
blockData?.name ?: "",
"板块内容列表"
)
)
val blockData = mViewModel.blockData
NewLogUtils.logAccessToCommonCollectionDetail(
column.id ?: "",
column.name ?: "",
@ -872,7 +883,8 @@ class GameFragmentAdapter(
fun notifyChildItem(position: Int) {
if (getItemViewType(position) == ItemViewType.VERTICAL_SLIDE_ITEM ||
getItemViewType(position) == ItemViewType.RANK_COLLECTION) {
getItemViewType(position) == ItemViewType.RANK_COLLECTION
) {
val view = layoutManager?.findViewByPosition(position)
val recyclerView = view?.findViewById<RecyclerView>(R.id.recycler_view)
if (recyclerView?.adapter is RankCollectionAdapter) {

View File

@ -17,10 +17,14 @@ class CommonCollectionDetailActivity : NormalActivity() {
fun getIntent(
context: Context,
collectionId: String,
blockId: String = "",
blockName: String = "",
entrance: String = ""
): Intent {
val bundle = Bundle()
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance)
bundle.putString(EntranceUtils.KEY_BLOCK_ID, blockId)
bundle.putString(EntranceUtils.KEY_BLOCK_NAME, blockName)
bundle.putString(EntranceUtils.KEY_COLLECTION_ID, collectionId)
return getTargetIntent(context, CommonCollectionDetailActivity::class.java, CommonCollectionDetailFragment::class.java, bundle)
}

View File

@ -22,6 +22,8 @@ class CommonCollectionDetailAdapter(
context: Context,
var collectionStyle: String,
val mViewModel: CommonCollectionDetailViewModel,
val mBlockId: String,
val mBlockName: String,
val mEntrance: String
) : ListAdapter<LinkEntity>(context), IExposable {
@ -48,8 +50,8 @@ class CommonCollectionDetailAdapter(
NewLogUtils.logCommonCollectionClick(
commonLinkCollection?.id ?: "",
commonLinkCollection?.name ?: "",
"",
"",
mBlockId,
mBlockName,
mEntrance,
"合集详情",
linkEntity.title ?: "",

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter.game.commoncollection.detail
import android.os.Bundle
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.ExposureListener
import com.gh.common.exposure.IExposable
@ -18,12 +19,20 @@ class CommonCollectionDetailFragment : LazyListFragment<LinkEntity, CommonCollec
private var mCollectionStyle: String = ""
private lateinit var mViewModel: CommonCollectionDetailViewModel
private var mExposureListener: ExposureListener? = null
private var mBlockId = ""
private var mBlockName = ""
override fun getRealLayoutId(): Int = R.layout.fragment_list_base
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mBlockId = requireArguments().getString(EntranceUtils.KEY_BLOCK_ID, "")
mBlockName = requireArguments().getString(EntranceUtils.KEY_BLOCK_NAME, "")
}
override fun provideListAdapter(): ListAdapter<*> {
if (mAdapter == null) {
mAdapter = CommonCollectionDetailAdapter(requireContext(), mCollectionStyle, mViewModel, mEntrance)
mAdapter = CommonCollectionDetailAdapter(requireContext(), mCollectionStyle, mViewModel, mBlockId, mBlockName, mEntrance)
}
return mAdapter!!
}
@ -72,8 +81,8 @@ class CommonCollectionDetailFragment : LazyListFragment<LinkEntity, CommonCollec
NewLogUtils.logSlideCommonCollection(
commonLinkCollection?.id ?: "",
commonLinkCollection?.name ?: "",
"",
"",
mBlockId,
mBlockName,
mEntrance,
"合集详情",
linkEntity?.title ?: "",

View File

@ -576,6 +576,8 @@ class LegacyHomeFragmentAdapterAssistant(
CommonCollectionDetailActivity.getIntent(
mContext,
column.id ?: "",
"",
"",
"首页内容列表"
)
)