QA增加0923补充MTA事件
This commit is contained in:
@ -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)}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user