Commit eb159ccf by 霍志良

feat:升级m-im埋点

parent 4337e855
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.74",
"m-home" : "0.0.22.75",
"m-im" : "0.0.19.80",
"m-im" : "0.0.19.91",
"m-dynamic" : "0.0.7.30",
"m-article" : "0.0.0.10",
......@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.73",
"m-home" : "0.0.22.75",
"m-im" : "0.0.19.80",
"m-im" : "0.0.19.91",
"m-dynamic" : "0.0.7.30",
"m-article" : "0.0.0.8",
......
......@@ -16,6 +16,7 @@ import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.api.event.ImLogoutEvent
......@@ -43,6 +44,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.im_new_multi_message_fragment.*
import kotlinx.android.synthetic.main.im_nim_contact_text_item.view.*
import java.util.concurrent.TimeUnit
/**
......@@ -244,6 +246,7 @@ class NewMultiMessageFragment : BaseFragment() {
*/
private fun initMore() {
ll_more.setOnClickListener {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_more_click")
if (!ImIn.isLogin()) {
ToastUtil.toastShort("请登录后再试")
} else {
......@@ -323,6 +326,7 @@ class NewMultiMessageFragment : BaseFragment() {
*/
private fun initKefu() {
ll_kefu.setOnClickListener {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_xiaoyi_click")
if (ImIn.isLogin()) {
SessionHelper.startP2PSession(context, -1, ImConstants.KEFUXIAOYI, null,
P2PCustomActionHandlerImpl(ImConstants.KEFUXIAOYI, "客服小壹", ImConstants.KEFUXIAOYI)
......@@ -364,6 +368,17 @@ class NewMultiMessageFragment : BaseFragment() {
@SuppressLint("CheckResult")
override fun onPageSelected(index: Int) {
when (index) {
0 -> {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_type_click",chat_btn.text.toString())
}
1 -> {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_type_click",communite_btn.text.toString())
}
else -> {
ActionCountUtils.count("ydl_user_message_page|ydl_user_message_type_click",notification_btn.text.toString())
}
}
setSelectTab(index)
// 这边延迟300毫秒加载,是为了不让动画进行时有卡顿
Observable.timer(300, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.io())
......
......@@ -226,7 +226,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private boolean isOthers;
private MultipleAnswerBean multipleAnswerBean;
private ArrayList<String> answersItemsMap = new ArrayList<>();
private long startTime ;
private long endTime;
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
@Override
......@@ -1019,6 +1020,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public void onResume() {
super.onResume();
ActionCountUtils.Companion.count("ydl_user_message_page|ydl_user_message_page_visit");
startTime=System.currentTimeMillis();
messageListPanel.onResume();
NIMClient.getService(MsgService.class).setChattingAccount(sessionId, sessionType);
getActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL); // 默认使用听筒播放
......@@ -1045,6 +1048,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override
public void onStop() {
super.onStop();
endTime=System.currentTimeMillis();
ActionCountUtils.Companion.count("ydl_user_message_page|ydl_user_message_page_stay_visit",String.valueOf(endTime-startTime));
}
ArrayList<AnswersItem> answersItems = new ArrayList<>();
......
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