diff --git a/app/src/main/java/com/mango/moshen/home/fragment/MeFragment.kt b/app/src/main/java/com/mango/moshen/home/fragment/MeFragment.kt index 627e93dc7..60632dca3 100644 --- a/app/src/main/java/com/mango/moshen/home/fragment/MeFragment.kt +++ b/app/src/main/java/com/mango/moshen/home/fragment/MeFragment.kt @@ -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() } diff --git a/app/src/main/java/com/mango/moshen/ui/im/InputPanel.java b/app/src/main/java/com/mango/moshen/ui/im/InputPanel.java index b74ce2fbd..4679555bf 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/InputPanel.java +++ b/app/src/main/java/com/mango/moshen/ui/im/InputPanel.java @@ -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 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(); } diff --git a/app/src/main/java/com/mango/moshen/ui/im/MessageListPanelEx.java b/app/src/main/java/com/mango/moshen/ui/im/MessageListPanelEx.java index 209ce0417..36f129cd3 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/MessageListPanelEx.java +++ b/app/src/main/java/com/mango/moshen/ui/im/MessageListPanelEx.java @@ -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; @@ -871,11 +873,11 @@ public class MessageListPanelEx { } else { // 顶部加载 if (noMoreMessage) { - if (!SystemUidUtil.isSystemUid(container.account)){ - IMMessage imMessage = MessageBuilder.createCustomMessage(container.account, container.sessionType, new UserCardAttachment()); - imMessage.setStatus(MsgStatusEnum.draft); - messages.add(0, imMessage); - } + if (!SystemUidUtil.isSystemUid(container.account)) { + IMMessage imMessage = MessageBuilder.createCustomMessage(container.account, container.sessionType, new UserCardAttachment()); + imMessage.setStatus(MsgStatusEnum.draft); + messages.add(0, imMessage); + } adapter.fetchMoreEnd(messages, true); } else { adapter.fetchMoreComplete(messages); @@ -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; diff --git a/app/src/main/java/com/mango/moshen/ui/im/avtivity/AddBlackListActivity.java b/app/src/main/java/com/mango/moshen/ui/im/avtivity/AddBlackListActivity.java index 471d6edda..8ac7f0a7b 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/avtivity/AddBlackListActivity.java +++ b/app/src/main/java/com/mango/moshen/ui/im/avtivity/AddBlackListActivity.java @@ -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 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(); + } + ); } } diff --git a/app/src/main/java/com/mango/moshen/ui/im/avtivity/SayHelloListActivity.kt b/app/src/main/java/com/mango/moshen/ui/im/avtivity/SayHelloListActivity.kt index e04258e71..250aad39c 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/avtivity/SayHelloListActivity.kt +++ b/app/src/main/java/com/mango/moshen/ui/im/avtivity/SayHelloListActivity.kt @@ -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 userPhotos = new ArrayList<>(); List 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 -> - SkillHomeActivity.Companion.start( - context, - SkillHomeActivity.PAGE_TYPE_CUSTOM, - uid - ) + 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); diff --git a/app/src/main/java/com/mango/moshen/ui/im/recent/RecentContactsFragment.java b/app/src/main/java/com/mango/moshen/ui/im/recent/RecentContactsFragment.java index 4d571fa33..3e565dc0c 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/recent/RecentContactsFragment.java +++ b/app/src/main/java/com/mango/moshen/ui/im/recent/RecentContactsFragment.java @@ -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); } diff --git a/app/src/main/java/com/mango/moshen/ui/im/recent/RecentListFragment.kt b/app/src/main/java/com/mango/moshen/ui/im/recent/RecentListFragment.kt index b6ebbe7fa..f9053f19f 100644 --- a/app/src/main/java/com/mango/moshen/ui/im/recent/RecentListFragment.kt +++ b/app/src/main/java/com/mango/moshen/ui/im/recent/RecentListFragment.kt @@ -108,6 +108,10 @@ class RecentListFragment : BaseViewBindingFragment() 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 diff --git a/app/src/main/java/com/mango/moshen/ui/user/UserInfoActivity.java b/app/src/main/java/com/mango/moshen/ui/user/UserInfoActivity.java index 12a279633..0de0d0e84 100644 --- a/app/src/main/java/com/mango/moshen/ui/user/UserInfoActivity.java +++ b/app/src/main/java/com/mango/moshen/ui/user/UserInfoActivity.java @@ -548,6 +548,9 @@ public class UserInfoActivity extends BaseBindingActivity { // 删除会话,删除后,消息历史被一起删除 + 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(); } diff --git a/core/src/main/java/com/mango/core/statistic/protocol/StatisticsProtocol.java b/core/src/main/java/com/mango/core/statistic/protocol/StatisticsProtocol.java index 1eb73de96..ab102a5fa 100644 --- a/core/src/main/java/com/mango/core/statistic/protocol/StatisticsProtocol.java +++ b/core/src/main/java/com/mango/core/statistic/protocol/StatisticsProtocol.java @@ -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聊点击 }