EventCollection
项目地址: wobuaihuangjun/EventCollection

简介:控件自动埋点
android 控件自动化埋点
控件点击事件埋点策略
- 埋点采用半自动化的方式进行,埋点的界面必须继承自 BaseActivity 或者 BaseFragment ,不含子控件的控件将会自动收集点击事件;
- 埋点统一收集类名+控件的 UI 目录树。
- 需要埋点包含子控件的 Layout 控件,在 .xml 布局文件中添加 android:tag 属性,否则将不会收集,此时子控件的点击事件将会被忽略。tag 的值统一以 click_event 开头。
例如:
Button 的点击事件将会自动收集,要收集 LinearLayout 的点击事件,此时必须设置 tag 属性,ImageView 的点击事件将不会再收集。
LinearLayout 的 UI 目录树为:MainActivity:DecorView[0]->LinearLayout[0]->FrameLayout[1]->LinearLayout[0]->LinearLayout[0];
Button 的 UI 目录树为:MainActivity:DecorView[0]->LinearLayout[0]->FrameLayout[1]->LinearLayout[0]->Button[1];
设备不同黑体部分的 UI 路径可能会有所不同