房间收藏列表埋点补充

This commit is contained in:
huangjian
2022-10-17 10:31:33 +08:00
parent f66c5fd595
commit 18101e90d7
3 changed files with 26 additions and 2 deletions

View File

@@ -11,6 +11,8 @@ import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.mango.core.DemoCache;
import com.mango.core.statistic.StatisticManager;
import com.mango.core.statistic.protocol.StatisticsProtocol;
import com.mango.moshen.base.BaseViewBindingActivity;
import com.mango.moshen.base.TitleBar;
import com.mango.moshen.databinding.ActivityCollectionRoomBinding;
@@ -21,6 +23,7 @@ import com.mango.moshen.ui.widget.magicindicator.buildins.commonnavigator.Common
import com.netease.nim.uikit.StatusBarUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -44,9 +47,17 @@ public class CollectionRoomActivity extends BaseViewBindingActivity<ActivityColl
TextView textView = (TextView) mTitleBar.getViewByAction(action);
textView.setText(Objects.equals(textView.getText(), "管理") ? "完成" : "管理");
((CollectionRoomFragment) pagerAdapter.getItem(getBinding().viewPager.getCurrentItem())).changeManageMode();
if (Objects.equals(textView.getText(), "管理")) {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_EDITBUTTON_SHOW, "管理按钮曝光");
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_EDITBUTTON_COMPLETE_CLICK, "完成按钮点击");
} else {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_EDITBUTTON_CLICK, "管理按钮点击");
}
}
});
initViewPager();
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_EDITBUTTON_SHOW, "管理按钮曝光");
}
private void initViewPager() {
@@ -91,7 +102,12 @@ public class CollectionRoomActivity extends BaseViewBindingActivity<ActivityColl
}
});
getBinding().viewPager.setCurrentItem(DemoCache.readCollectionRoomIndex());
final int defaultIndex = DemoCache.readCollectionRoomIndex();
getBinding().viewPager.setCurrentItem(defaultIndex);
final HashMap<String, String> arguments = new HashMap<>();
arguments.put("index", String.valueOf(defaultIndex));
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_ENTRY, "我的收藏页面访问", arguments);
}
@Override

View File

@@ -97,6 +97,8 @@ public class CollectionRoomFragment extends BaseFragment implements SwipeRefresh
return;
}
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_DELETE_CLICK, "删除按钮点击");
CollectionRoomModel.get()
.deleteFollowRoom(roomUids.toString())
.subscribe(s -> {
@@ -135,12 +137,12 @@ public class CollectionRoomFragment extends BaseFragment implements SwipeRefresh
cbSelectAll.setOnCheckedChangeListener(null);
cbSelectAll.setChecked(isCheckedAll);
cbSelectAll.setOnCheckedChangeListener(onCheckedChangeListener);
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_COLLECTION_SELECTALL_CLICK, "全选点击");
}
});
roomAdapter.setOnItemClickListener((adapter, view, position) -> {
HomeRoomInfo fansRoomListBean = (HomeRoomInfo) adapter.getItem(position);
if (!isManageMode && fansRoomListBean != null) {
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ME_INTO_FOLLOW_ROOM_CLICK, "我页_进入关注房间");
AVRoomActivity.start(getContext(), fansRoomListBean.getRoomUid());
}
});

View File

@@ -413,5 +413,11 @@ public interface StatisticsProtocol {
String EVENT_ROOM_MUSIC_CLICK = "room_music_click";//房间音乐点击
String EVENT_ROOM_MORE_TOOL_CLICK = "room_more_tool_click";//房间底部更多工具栏点击
String EVENT_COLLECTION_EDITBUTTON_SHOW = "collection_editbutton_show";//管理按钮曝光
String EVENT_COLLECTION_EDITBUTTON_CLICK = "collection_editbutton_click";//管理按钮点击
String EVENT_COLLECTION_EDITBUTTON_COMPLETE_CLICK = "collection_editbutton_complete_click";//完成按钮点击
String EVENT_COLLECTION_ENTRY = "collection_entry";//我的收藏页面访问
String EVENT_COLLECTION_SELECTALL_CLICK = "collection_selectall_click";//全选点击
String EVENT_COLLECTION_DELETE_CLICK = "collection_delete_click";//删除按钮点击
}