diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/detail/GameDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/detail/GameDetailFragment.kt index 9c73f7d44f..75d28c8cf5 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/detail/GameDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/detail/GameDetailFragment.kt @@ -684,7 +684,7 @@ class GameDetailFragment : LazyFragment(), IScrollable { null, gameStatus = gameStatus ) - GameFunctionDialogFragment.show(requireContext(), gameDetailInfoTag.infoTags) + GameFunctionDialogFragment.show(requireContext(), gameEntity, gameDetailInfoTag.infoTags, gameDetailInfoTag.link) } } } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameFunctionDialogFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameFunctionDialogFragment.kt index 9748042b0a..2a24b36db6 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameFunctionDialogFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/dialog/GameFunctionDialogFragment.kt @@ -9,19 +9,29 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.LinearLayoutManager +import com.gh.common.util.DirectUtils import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.common.base.fragment.BaseBottomDialogFragment +import com.gh.gamecenter.common.constant.EntranceConsts +import com.gh.gamecenter.common.entity.LinkEntity +import com.gh.gamecenter.common.utils.SensorsBridge +import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.databinding.DialogGameDetailRecyclerViewBinding +import com.gh.gamecenter.feature.entity.GameEntity import com.gh.gamecenter.gamedetail.entity.GameDetailInfoTag import com.lightgame.utils.AppManager class GameFunctionDialogFragment: BaseBottomDialogFragment() { private var infoTags: List = arrayListOf() + private var linkEntity: LinkEntity? = null + private var gameEntity: GameEntity? = null private val adapter by lazy { GameFunctionAdapter(requireContext(), infoTags) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + gameEntity = arguments?.getParcelable(EntranceConsts.KEY_GAME_ENTITY) infoTags = arguments?.getParcelableArrayList(KEY_INFO_TAG) ?: arrayListOf() + linkEntity = arguments?.getParcelable(EntranceConsts.KEY_LINK) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -30,6 +40,28 @@ class GameFunctionDialogFragment: BaseBottomDialogFragment + linkEntity?.let { + DirectUtils.directToLinkPage(requireContext(), it, "游戏详情-功能说明", "") + SensorsBridge.trackGameDetailModuleClick( + gameEntity?.id, + gameEntity?.name, + gameEntity?.categoryChinese, + "组件内容", + "功能标签", + "功能标签", + null, + subModuleName = "跳转入口", + linkType = it.type, + linkId = it.link, + linkText = it.text, + gameStatus = null + ) + } + } + } mBinding.recyclerView.run { layoutManager = LinearLayoutManager(requireContext()) adapter = this@GameFunctionDialogFragment.adapter @@ -46,7 +78,7 @@ class GameFunctionDialogFragment: BaseBottomDialogFragment) { + fun show(context: Context?, gameEntity: GameEntity?, infoTags: List, linkEntity: LinkEntity?) { val fragmentActivity: FragmentActivity = if (context is FragmentActivity) { context } else if (BuildConfig.DEBUG) { @@ -65,7 +97,9 @@ class GameFunctionDialogFragment: BaseBottomDialogFragment = listOf(), // 功能标签 @SerializedName("request_speed_status") - val requestSpeedStatus: String = "" // 求加速状态, on/off + val requestSpeedStatus: String = "", // 求加速状态, on/off + @SerializedName("plugin_tutorial_link") + val link: LinkEntity? = null, // 插件教程链接 ) { @Parcelize data class InfoTag( diff --git a/app/src/main/res/layout/dialog_game_detail_recycler_view.xml b/app/src/main/res/layout/dialog_game_detail_recycler_view.xml index 30b93217ba..e2c7cb2f57 100644 --- a/app/src/main/res/layout/dialog_game_detail_recycler_view.xml +++ b/app/src/main/res/layout/dialog_game_detail_recycler_view.xml @@ -25,7 +25,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginLeft="16dp" android:gravity="center" android:textColor="@color/text_primary" android:textSize="@dimen/secondary_title_text_size" @@ -35,6 +34,27 @@ app:layout_constraintTop_toTopOf="@+id/closeIv" tools:text="其他2款游戏" /> + +