新增版本埋点

This commit is contained in:
huangjian
2023-02-09 11:16:43 +08:00
parent 0265d87dd8
commit 4325d85fd8
13 changed files with 144 additions and 17 deletions

View File

@@ -548,6 +548,10 @@ class MeFragment : BaseFragment(), View.OnClickListener {
R.id.tv_user_id -> {
mUserInfo?.let {
ClipboardUtil.clipboardCopyText(it.erbanNo.toString())
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_MYCENTER_COPYID_CLICK,
"个人中心ID复制点击"
)
} ?: run {
"数据加载中,请稍后再试!".toast()
}

View File

@@ -40,6 +40,8 @@ import com.effective.android.panel.interfaces.PanelHeightMeasurer;
import com.effective.android.panel.interfaces.listener.OnPanelChangeListener;
import com.effective.android.panel.view.panel.IPanelView;
import com.effective.android.panel.view.panel.PanelView;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.moshen.R;
import com.mango.moshen.ui.im.actions.GiftAction;
import com.mango.moshen.ui.im.adpter.PhotoPreviewAdapter;
@@ -108,7 +110,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
private static final int SHOW_LAYOUT_DELAY = 0;
private final List<PhotoInfo> selectPhotos = new ArrayList<>();
private final boolean inRoom;
private int unfilledHeight = 0;
protected Container container;
protected View view;
protected Handler uiHandler;
@@ -125,6 +126,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
protected EmoticonPickerView emoticonPickerView; // 贴图表情控件
// 语音
protected AudioRecorder audioMessageHelper;
private int unfilledHeight = 0;
private AutoHidePanelRecyclerView messageListView;
private SessionCustomization customization;
private Chronometer time;
@@ -170,6 +172,9 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
onTextMessageSendButtonPressed();
} else if (v == switchToAudioButtonInInputBar) {
switchToAudioLayout();
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_VOICE_CLICK,
"聊天对话框工具栏语音点击");
} else if (v == ivCamera) {
for (BaseAction action : actions) {
if (action instanceof CameraAction) {
@@ -178,6 +183,10 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
}
}
mHelper.resetState();
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_CAMERA_CLICK,
"聊天对话框工具栏相机点击");
} else if (v == ivGift) {
ivGift.postDelayed(() -> {
for (BaseAction action : actions) {
@@ -188,6 +197,9 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
}
}, !mHelper.isResetState() ? 300 : 0);
mHelper.resetState();
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_GIFT_CLICK,
"聊天对话框工具栏送礼点击");
} else if (v == tvUserPhoto) {
for (BaseAction action : actions) {
if (action instanceof PhotoAction) {
@@ -292,6 +304,9 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
isKeyboardShowed = true;
container.proxy.onInputPanelExpand();
emojiButtonInInputBar.setImageResource(R.drawable.nim_message_input_emotion_pressed);
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_INPUT_CLICK,
"聊天对话框工具栏输入框点击");
}
@Override
@@ -304,9 +319,16 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
public void onPanel(IPanelView view) {
container.proxy.onInputPanelExpand();
if (view.getBindingTriggerViewId() == R.id.emoji_button) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_EMOTICON_CLICK,
"聊天对话框工具栏表情点击"
);
emojiButtonInInputBar.setImageResource(R.drawable.nim_message_input_keyboard);
emoticonPickerView.show(InputPanel.this);
} else if (view.getBindingTriggerViewId() == R.id.iv_image) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_TOOLBAR_PHOTO_CLICK,
"聊天对话框工具栏相册点击");
emojiButtonInInputBar.setImageResource(R.drawable.nim_message_input_emotion_pressed);
initPreviewPhotos();
}

View File

@@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mango.core.im.custom.bean.UserCardAttachment;
import com.mango.core.room.event.MessageSizeEvent;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.core.utils.CurrentTimeUtils;
import com.mango.core.utils.SystemUidUtil;
import com.mango.xchat_android_library.utils.SingleToastUtil;
@@ -1120,6 +1122,7 @@ public class MessageListPanelEx {
@Override
public void onClick(View v) {
onCopyMessageItem(item);
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_DIALOGUE_COPY_CLICK, "聊天对话信息长按复制点击");
}
});
}
@@ -1139,6 +1142,7 @@ public class MessageListPanelEx {
@Override
public void onClick(View v) {
deleteItem(selectedItem, true);
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_DIALOGUE_DELETE_CLICK, "聊天对话信息长按删除点击");
}
});
}
@@ -1231,6 +1235,8 @@ public class MessageListPanelEx {
@Override
public void onClick(View v) {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_DIALOGUE_REVOCATION_CLICK, "聊天对话信息长按撤回点击");
if (!NetworkUtil.isNetAvailable(container.activity)) {
SingleToastUtil.showToast(R.string.network_is_not_available);
return;

View File

@@ -14,6 +14,8 @@ import android.widget.TextView;
import com.mango.core.decoration.headwear.bean.HeadWearInfo;
import com.mango.core.noble.NobleUtil;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.core.user.UserModel;
import com.mango.moshen.R;
import com.mango.moshen.UIHelper;
@@ -78,6 +80,9 @@ public class AddBlackListActivity extends BaseMvpActivity<IAddBlackListView, Add
} else {
ensureRemoveFromBlackList();
}
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_SET_BLACKLIST_CLICK,
"聊天设置页拉黑点击");
});
RecentContact recentContact = NIMClient.getService(MsgService.class)
@@ -91,6 +96,9 @@ public class AddBlackListActivity extends BaseMvpActivity<IAddBlackListView, Add
removeTag(recentContact, RECENT_TAG_STICKY);
}
NIMClient.getService(MsgService.class).updateRecentAndNotify(recentContact);
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_SET_TOP_CLICK,
"聊天设置页聊天置顶点击");
});
}
@@ -150,9 +158,15 @@ public class AddBlackListActivity extends BaseMvpActivity<IAddBlackListView, Add
@Override
public void onClick(View v) {
if (v.getId() == R.id.rl_content) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_SET_DATA_CLICK,
"聊天设置页用户资料点击");
if (!TextUtils.isEmpty(account))
UserInfoActivity.Companion.start(this, Long.parseLong(account));
} else if (v.getId() == R.id.tv_report) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_CHAT_SET_REPORT_CLICK,
"聊天设置页举报点击");
UIHelper.showReportPage(context, JavaUtil.str2long(account), XChatConstants.REPORT_TYPE_CHAT);
}
}

View File

@@ -19,6 +19,8 @@ import com.mango.core.praise.PraiseModel;
import com.mango.core.praise.event.IsLikedEvent;
import com.mango.core.praise.event.PraiseEvent;
import com.mango.core.room.model.AvRoomModel;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.core.user.UserModel;
import com.mango.core.user.bean.UserInfo;
import com.mango.core.utils.SystemUidUtil;
@@ -172,7 +174,10 @@ public class NimP2PMessageActivity extends NewBaseMessageActivity {
return;
}
ivAddBlackList.setVisibility(View.VISIBLE);
ivAddBlackList.setOnClickListener((view) -> AddBlackListActivity.start(this, sessionId));
ivAddBlackList.setOnClickListener((view) -> {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_FRAME_SKILLCARD_CLICK, "聊天对话框工具栏设置点击");
AddBlackListActivity.start(this, sessionId);
});
}
@Override
@@ -216,7 +221,10 @@ public class NimP2PMessageActivity extends NewBaseMessageActivity {
if (throwable == null) {
if (roomInfo != null && roomInfo.getUid() > 0) {
tvOnlineTip.setVisibility(View.VISIBLE);
tvOnlineTip.setOnClickListener(v -> AVRoomActivity.start(context, roomInfo.getUid()));
tvOnlineTip.setOnClickListener(v -> {
AVRoomActivity.start(context, roomInfo.getUid());
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_TOOLBAR_LIVE_CLICK, "聊天对话框工具栏直播中点击");
});
} else {
tvOnlineTip.setVisibility(View.GONE);
}
@@ -278,7 +286,11 @@ public class NimP2PMessageActivity extends NewBaseMessageActivity {
ivAttention.setVisibility(View.GONE);
} else {
ivAttention.setVisibility(View.VISIBLE);
ivAttention.setOnClickListener(v -> PraiseModel.get().praise(Long.valueOf(sessionId), true).subscribe());
ivAttention.setOnClickListener(v -> {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_TOOLBAR_FANS_CLICK, "聊天对话框工具栏关注点击");
PraiseModel.get().praise(Long.valueOf(sessionId), true).subscribe();
}
);
}
}

View File

@@ -5,6 +5,8 @@ import android.content.Context
import android.content.Intent
import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager
import com.mango.core.statistic.StatisticManager
import com.mango.core.statistic.protocol.StatisticsProtocol
import com.mango.core.user.UserModel
import com.mango.core.user.bean.HelloUserInfo
import com.mango.core.user.event.ClickSayHelloEvent
@@ -65,6 +67,12 @@ class SayHelloListActivity : BaseViewBindingActivity<ActivitySayHelloListBinding
}
.subscribe()
rvDelegate.adapter.remove(position)
StatisticManager.Instance()
.onEvent(
StatisticsProtocol.EVENT_USER_GREETINGS_CHAT_CLICK,
"自动打招呼功能和TA聊点击",
mapOf("user_uid" to "${it.uid}")
)
}
}
}
@@ -77,6 +85,12 @@ class SayHelloListActivity : BaseViewBindingActivity<ActivitySayHelloListBinding
binding.switchEnable.setOn(!isOn, false)
}
.subscribe()
StatisticManager.Instance()
.onEvent(
StatisticsProtocol.EVENT_USER_GREETINGS_SWITCH_CLICK,
"自动打招呼功能开关点击",
mapOf("isOpen" to "$isOn")
)
}
binding.swipeRefresh.setOnRefreshListener {

View File

@@ -16,6 +16,8 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mango.core.decoration.headwear.bean.HeadWearInfo;
import com.mango.core.noble.NobleUtil;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.core.user.UserModel;
import com.mango.core.user.bean.UserPhoto;
import com.mango.core.utils.CurrentTimeUtils;
@@ -115,6 +117,7 @@ public class MsgViewHolderUserCard extends MsgViewHolderBase {
}
private void showUserPhoto(int position) {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_FRAME_DATACARD_PHOTO_CLICK, "聊天对话框个人资料相册图点击");
//创建一个集合拿来做用户所有照片信息
ArrayList<UserPhoto> userPhotos = new ArrayList<>();
List<UserPhoto> realmList = photoAdapter.getData();
@@ -133,7 +136,10 @@ public class MsgViewHolderUserCard extends MsgViewHolderBase {
@SuppressLint("CheckResult")
private void loadData() {
long uid = JavaUtil.str2long(message.getSessionId());
ivAvatar.setOnClickListener(v -> UserInfoActivity.Companion.start(context, uid));
ivAvatar.setOnClickListener(v -> {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_FRAME_DATACARD_HEAD_CLICK, "聊天对话框个人资料头像点击");
UserInfoActivity.Companion.start(context, uid);
});
UserModel.get().getUserInfo(uid)
.compose(RxHelper.bindContext(context))
.subscribe(userInfo -> {
@@ -173,12 +179,15 @@ public class MsgViewHolderUserCard extends MsgViewHolderBase {
llSkill.setVisibility(View.GONE);
} else {
llSkill.setVisibility(View.VISIBLE);
llSkill.setOnClickListener(v ->
llSkill.setOnClickListener(v -> {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_TOOLBAR_SET_CLICK, "聊天对话框技能卡点击");
SkillHomeActivity.Companion.start(
context,
SkillHomeActivity.PAGE_TYPE_CUSTOM,
uid
)
);
}
);
ImageLoadUtils.loadImage(context, entities.get(0).getIcon(), ivSkill0);

View File

@@ -15,6 +15,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mango.core.initial.InitialModel;
import com.mango.core.initial.bean.InitInfo;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.xchat_android_library.utils.ListUtils;
import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nim.uikit.api.model.contact.ContactChangedObserver;
@@ -407,6 +409,7 @@ public class RecentContactsFragment extends TFragment {
String title = getString(R.string.main_msg_list_delete_chatting);
alertDialog.addItem(title, v -> {
// 删除会话,删除后,消息历史被一起删除
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_LIST_DELETE_CLICK,"聊天列表长按删除聊天点击");
NIMClient.getService(MsgService.class).deleteRecentContact2(recent.getContactId(), recent.getSessionType());
NIMClient.getService(MsgService.class).clearChattingHistory(recent.getContactId(), recent.getSessionType());
});
@@ -419,8 +422,8 @@ public class RecentContactsFragment extends TFragment {
addTag(recent, RECENT_TAG_STICKY);
}
NIMClient.getService(MsgService.class).updateRecent(recent);
refreshMessages(false);
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_LIST_TOP_CLICK,"聊天列表长按置顶聊天点击");
});
alertDialog.show(view, view.getMeasuredWidth() / 2, 0);
}

View File

@@ -108,6 +108,10 @@ class RecentListFragment : BaseViewBindingFragment<FragmentRecentListBinding>()
binding.llSayHello.setOnClickListener {
SayHelloListActivity.start(mContext)
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_USER_GREETINGS_ENTRANCE_CLICK,
"自动打招呼入口点击"
)
}
val isClicked = SharedPreferenceUtils.get(share_pref_is_newbie_clicked, false) as Boolean
binding.tvRedPointFindNew.visibility = if (isClicked) View.GONE else View.VISIBLE

View File

@@ -548,6 +548,9 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
return;
}
ClipboardUtil.clipboardCopyText(String.valueOf(userInfo.getErbanNo()));
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_MYDATA_COPYID_CLICK,
"个人资料页ID复制点击");
break;
}
}

View File

@@ -778,6 +778,9 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
break;
case R.id.tv_erban_id:
ClipboardUtil.clipboardCopyText(String.valueOf(userInfo.getErbanNo()));
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_DATACARD_COPYID_CLICK,
"房间资料卡ID复制点击");
break;
default:
break;

View File

@@ -12,6 +12,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nim.uikit.api.model.contact.ContactChangedObserver;
import com.netease.nim.uikit.api.model.main.OnlineStateChangeObserver;
@@ -242,6 +244,7 @@ public class RoomMsgRecentContactsFragment extends TFragment {
String title = "删除该聊天";
alertDialog.addItem(title, () -> {
// 删除会话,删除后,消息历史被一起删除
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_LIST_DELETE_CLICK,"聊天列表长按删除聊天点击");
NIMClient.getService(MsgService.class).deleteRecentContact2(recent.getContactId(), recent.getSessionType());
NIMClient.getService(MsgService.class).clearChattingHistory(recent.getContactId(), recent.getSessionType());
});
@@ -256,6 +259,7 @@ public class RoomMsgRecentContactsFragment extends TFragment {
NIMClient.getService(MsgService.class).updateRecent(recent);
refreshMessages(false);
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_CHAT_LIST_TOP_CLICK,"聊天列表长按置顶聊天点击");
});
alertDialog.show();
}

View File

@@ -439,4 +439,33 @@ public interface StatisticsProtocol {
String EVENT_GRADE_PROFIT_POP_SHOW = "grade_profit_pop_show";//主播评级入口曝光
String EVENT_GRADE_PROFIT_CLOSE_CLICK = "grade_profit_close_click";//主播评级弹窗关闭点击
String EVENT_CHAT_LIST_DELETE_CLICK = "chat_list_delete_click";//聊天列表长按删除聊天点击
String EVENT_CHAT_LIST_TOP_CLICK = "chat_list_top_click";//聊天列表长按置顶聊天点击
String EVENT_CHAT_DIALOGUE_COPY_CLICK = "chat_dialogue_copy_click";//聊天对话信息长按复制点击
String EVENT_CHAT_DIALOGUE_DELETE_CLICK = "chat_dialogue_delete_click";//聊天对话信息长按删除点击
String EVENT_CHAT_DIALOGUE_REVOCATION_CLICK = "chat_dialogue_revocation_click";//聊天对话信息长按撤回点击
String EVENT_CHAT_TOOLBAR_LIVE_CLICK = "chat_toolbar_live_click";//聊天对话框工具栏直播中点击
String EVENT_CHAT_TOOLBAR_FANS_CLICK = "chat_toolbar_fans_click";//聊天对话框工具栏关注点击
String EVENT_CHAT_TOOLBAR_SET_CLICK = "chat_toolbar_set_click";//聊天对话框工具栏设置点击
String EVENT_CHAT_FRAME_SKILLCARD_CLICK = "chat_frame_skillcard_click";//聊天对话框技能卡点击
String EVENT_CHAT_FRAME_DATACARD_PHOTO_CLICK = "chat_frame_datacard_photo_click";//聊天对话框个人资料相册图点击
String EVENT_CHAT_FRAME_DATACARD_HEAD_CLICK = "chat_frame_datacard_head_click";//聊天对话框个人资料头像点击
String EVENT_CHAT_TOOLBAR_VOICE_CLICK = "chat_toolbar_voice_click";//聊天对话框工具栏语音点击
String EVENT_CHAT_TOOLBAR_INPUT_CLICK = "chat_toolbar_input_click";//聊天对话框工具栏输入框点击
String EVENT_CHAT_TOOLBAR_EMOTICON_CLICK = "chat_toolbar_emoticon_click";//聊天对话框工具栏表情点击
String EVENT_CHAT_TOOLBAR_PHOTO_CLICK = "chat_toolbar_photo_click";//聊天对话框工具栏相册点击
String EVENT_CHAT_TOOLBAR_CAMERA_CLICK = "chat_toolbar_camera_click";//聊天对话框工具栏相机点击
String EVENT_CHAT_TOOLBAR_GIFT_CLICK = "chat_toolbar_gift_click";//聊天对话框工具栏送礼点击
String EVENT_CHAT_SET_DATA_CLICK = "chat_set_data_click";//聊天设置页用户资料点击
String EVENT_CHAT_SET_TOP_CLICK = "chat_set_top_click";//聊天设置页聊天置顶点击
String EVENT_CHAT_SET_BLACKLIST_CLICK = "chat_set_blacklist_click";//聊天设置页拉黑点击
String EVENT_CHAT_SET_REPORT_CLICK = "chat_set_report_click";//聊天设置页举报点击
String EVENT_MYCENTER_COPYID_CLICK = "mycenter_copyid_click";//个人中心ID复制点击
String EVENT_MYDATA_COPYID_CLICK = "mydata_copyid_click";//个人资料页ID复制点击
String EVENT_DATACARD_COPYID_CLICK = "datacard_copyid_click";//房间资料卡ID复制点击
String EVENT_USER_GREETINGS_ENTRANCE_CLICK = "user_greetings_entrance_click";//自动打招呼入口点击
String EVENT_USER_GREETINGS_SWITCH_CLICK = "user_greetings_switch_click";//自动打招呼功能开关点击 统计用户点击时的状态:开/关
String EVENT_USER_GREETINGS_CHAT_CLICK = "user_greetings_chat_click";//自动打招呼功能和TA聊点击
}