QA增加0923补充MTA事件

This commit is contained in:
张玉久
2020-09-27 10:26:38 +08:00
parent 0cc24956e0
commit 38bda5ec02
2 changed files with 10 additions and 3 deletions

View File

@ -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<RecyclerView.ViewHolder>() {
class HelpQaAdapter(val context: Context, val helpCategoryEntity: HelpCategoryEntity, val mQaCollectionId: String?) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
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)}")
}
}
}

View File

@ -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}")