Commit 63d5c1cd by 霍志良

Merge branch 'feat/zl/add_maidian' into 'release'

feat:添加埋点

See merge request app_android_lib/YDL-Component!365
parents 856dea64 3a2a6cee
......@@ -148,6 +148,21 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
consultant_list.layoutManager = layoutManager
mConsultantTopAdapter = ConsultantTopAdapter(requireContext(), consultantTopData)
consultant_list.adapter = mConsultantTopAdapter
consultant_list.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
var firstPostition = layoutManager.findFirstVisibleItemPosition()
var lastPosition = layoutManager.findLastVisibleItemPosition()
if (firstPostition != -1 && lastPosition != -1) {
val subList = consultantTopData.subList(firstPostition, lastPosition)
//将一个List转为String字符串并用逗号隔开
val ids = subList.joinToString(",") { it.specialTopicTitle.toString() }
ActionCountUtils.count(ConsultBIConstants.TOP_TITLE_CLICK, ids)
}
}
}
})
}
override fun showImage(
......
......@@ -10,7 +10,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants.Companion.TOP_TITLE_CLICK
import com.yidianling.consultant.model.bean.ConsultantTopBannerBean
import kotlinx.android.synthetic.main.consultant_top_banner_item.view.*
......@@ -56,6 +58,10 @@ class ConsultantTopAdapter(
.into(holder.consult_img)
holder.consult_title.text = consultList[position].specialTopicTitle
holder.itemView.setOnClickListener {
ActionCountUtils.count(
TOP_TITLE_CLICK,
consultList[position].specialTopicTitle.toString()
)
NewH5Activity.start(
context,
H5Params(consultList[position].specialTopicUrl.toString(), "")
......
......@@ -26,7 +26,9 @@ class ConsultBIConstants {
const val POSITION_YDL_USER_ASSOCIATE_WORD_VISIT="ydl_user_associate_word_visit" // 联想词曝光position
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
// 咨询师列表页 banner 点击事件
const val POSITION_CONSULT_COUNSELOR_LIST_BANNER_CLICK = "consult_counselor_list_banner_click"
const val POSITION_CONSULT_COUNSELOR_LIST_BANNER_CLICK =
"consult_counselor_list_banner_click"
const val TOP_TITLE_CLICK = PART_ID_CONSULT_COUNSELOR_LIST_PAGE + "|top_title_click"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment