From 38bda5ec0227db23d6f52e8be6b549d2f27ffa8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=8E=89=E4=B9=85?= <1484288157@qq.com> Date: Sun, 27 Sep 2020 10:26:38 +0800 Subject: [PATCH] =?UTF-8?q?QA=E5=A2=9E=E5=8A=A00923=E8=A1=A5=E5=85=85MTA?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/gh/gamecenter/help/HelpQaAdapter.kt | 9 ++++++++- .../java/com/gh/gamecenter/help/HelpQaCategoryAdapter.kt | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpQaAdapter.kt b/app/src/main/java/com/gh/gamecenter/help/HelpQaAdapter.kt index e1e74162f6..55c0d43ccd 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpQaAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpQaAdapter.kt @@ -8,13 +8,15 @@ import android.widget.TextView import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import com.gh.common.constant.Constants +import com.gh.common.util.HtmlUtils +import com.gh.common.util.MtaHelper import com.gh.common.util.dip2px import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity import com.gh.gamecenter.entity.HelpCategoryEntity -class HelpQaAdapter(val context: Context, val helpCategoryEntity: HelpCategoryEntity) : RecyclerView.Adapter() { +class HelpQaAdapter(val context: Context, val helpCategoryEntity: HelpCategoryEntity, val mQaCollectionId: String?) : RecyclerView.Adapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val helpView = TextView(context).apply { val params = RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT) @@ -46,6 +48,11 @@ class HelpQaAdapter(val context: Context, val helpCategoryEntity: HelpCategoryEn } context.startActivity(WebActivity.getIntent(context, "${url}${helpEntity.id}", helpCategoryEntity.name, false, false)) } + if (!mQaCollectionId.isNullOrEmpty()) { + MtaHelper.onEvent("QA", "QA合集点击", "点击首页+${HtmlUtils.stripHtml(helpEntity.title)}") + } else { + MtaHelper.onEvent("意见反馈", "使用帮助点击", "点击首页+${HtmlUtils.stripHtml(helpEntity.title)}") + } } } diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryAdapter.kt index 01f5964d10..5af88af573 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpQaCategoryAdapter.kt @@ -40,11 +40,11 @@ class HelpQaCategoryAdapter(val context: Context, val mQaCollectionId: String?) holder.binding.qaRv.apply { layoutManager = GridLayoutManager(context, 2) addItemDecoration(GridSpacingItemColorDecoration(context, 28, 0, R.color.transparent)) - adapter = HelpQaAdapter(context, helpCategoryEntity) + adapter = HelpQaAdapter(context, helpCategoryEntity, mQaCollectionId) } holder.binding.categoryMore.setOnClickListener { context.startActivity(QaActivity.getIntent(context, helpCategoryEntity.name, helpCategoryEntity.id, "")) - if (!mQaCollectionId.isNullOrEmpty()) { + if (!mQaCollectionId.isNullOrEmpty()) { MtaHelper.onEvent("QA", "QA合集点击", "点击更多+${helpCategoryEntity.name}") } else { MtaHelper.onEvent("意见反馈", "使用帮助点击", "点击更多+${helpCategoryEntity.name}")