|
|
@@ -9,16 +9,18 @@ import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.statistics.AppStatistics;
|
|
|
import com.sheep.gamegroup.statistics.AppStatisticsConfig;
|
|
|
-import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
+import com.sheep.gamegroup.view.activity.ChangeTelAct;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-//import com.umeng.analytics.MobclickAgent;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
|
import rx.schedulers.Schedulers;
|
|
|
|
|
|
+//import com.umeng.analytics.MobclickAgent;
|
|
|
+
|
|
|
/**
|
|
|
* Created by zhanghai on 2018/3/30.
|
|
|
*/
|
|
|
@@ -27,99 +29,152 @@ public class UMConfigUtils {
|
|
|
|
|
|
public static final String LOGIN_TYPE = "sheep_login_type";
|
|
|
public static final String LOGIN_OPENID = "sheep_login_openid";
|
|
|
+
|
|
|
//统计点击次数需要的子subtype
|
|
|
- public enum Event{
|
|
|
- GAME_DOWNLOAD ("GameDownload"),//游戏下载次数 5001
|
|
|
- BANNER_CLICK_HORIZONTAL ("BannerClickHorizontal"),//轮播图 广告点击次数 5002
|
|
|
- TAB_GAME ,//主页tab中的游戏页签 5003 注:!!!!!界面已经没有显示了!!!!!
|
|
|
- TAB_CATEGORY , //主页tab中的分类页签 5004 注:!!!!!界面已经没有显示了!!!!!
|
|
|
- TAB_SHEEP ,//主页tab中的小绵羊页签 5005
|
|
|
- TAB_JIEZHEWAN ,//主页tab中的借着玩页签 5006 注:!!!!!界面已经没有显示了!!!!!
|
|
|
- TAB_CREDITCARD ,//信用卡页签 5007 注:!!!!!界面已经没有显示了!!!!!
|
|
|
- SHEEP_TASK_TRY ,//试玩赚钱 5008
|
|
|
- SHEEP_TASK_INVITE ,//邀请赚钱 5009
|
|
|
- SHEEP_TASK_LIE ,//躺着赚钱 5010
|
|
|
- SHEEP_TIXIAN ,//提现 5011
|
|
|
- TASK_DETAIL ,//任务详情 5012
|
|
|
- TASK_DOWNLOAD ,//任务详情中->下载游戏 5013
|
|
|
- TASK_UPLOAD_PICTURE ,//任务详情中->上传截图 5014
|
|
|
- USER_ACCOUNT_SAFE ,//个人中心 -> 账号安全 5015
|
|
|
- USER_TASK_RECORD ,//个人中心 -> 任务记录 5016
|
|
|
- USER_TIXIAN_DETAIL ,//个人中心 -> 提现明细 5017
|
|
|
- USER_BIND_PHONE ,//账号安全 -> 绑定手机号(确定按钮)5018
|
|
|
- USER_BIND_WEIXIN ,//账号安全 -> 绑定微信号(立即绑定按钮) 5019
|
|
|
- USER_AUTHENTICATION ,//账号安全 -> 实名认证(提交按钮)5020
|
|
|
- USER_LOGOUT ,//账号安全 -> 退出登录按钮 5021
|
|
|
- GAME_SEARCH ,//搜索界面-> 搜索按钮 5022
|
|
|
- GAME_DOWNLOAD_MANAGER ,//主界面右上角 -> 下载管理按钮 5023
|
|
|
- TASK_ACCEPT ,//接取任务 5024
|
|
|
- SHEEP_NEWBIE_TASK_LIST ,//新手任务列表界面,(界面已经修改为对话框了) 5025
|
|
|
- SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP ,//一分钟了解小绵羊界面 5026
|
|
|
- SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG ,//注册小绵羊成功对话框 5027
|
|
|
- SHEEP_NEWBIE_TASK_LIST_DIALOG ,//新手任务列表对话框 5028
|
|
|
- SHEEP_NEWBIE_TASK_ADD_QQ ,//加入官方QQ群任务 5029
|
|
|
- SHEEP_CREDIT_CARD ,//信用卡任务列表界面 5030
|
|
|
- SHEEP_CREDIT_CARD_ACCEPT_LIST ,//信用卡任务列表界面 -> 信用卡任务接受列表 5031
|
|
|
- SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST ,//信用卡任务列表界面 ->信用卡任务进度查询列表 5032
|
|
|
- SHEEP_CREDIT_CARD_DETAIL ,//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 5033
|
|
|
- SHEEP_CREDIT_CARD_DETAIL_WEB ,//信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 -> 申请信用卡web界面 5034
|
|
|
- SHEEP_CREDIT_CARD_PROGRESS_QUERY ,//信用卡任务列表界面 ->信用卡任务进度查询列表 -> 信用卡任务进度查询 5035
|
|
|
- TASK_START_APP ,//打开任务应用或游戏 5036
|
|
|
- TASK_INSTALL_APP ,//安装应用 5037
|
|
|
- SHEEP_START ,//启动小绵羊 5038
|
|
|
- SHEEP_RESUME ,//小绵羊进入前台 5039
|
|
|
- SHEEP_PAUSE ,//小绵羊进入后台 5040
|
|
|
- SHEEP_STOP ,//退出小绵羊 5041
|
|
|
- PUNCH ,//点击打卡赚钱 5042
|
|
|
- PUNCH_SIGN_UP ,//点击报名 5043
|
|
|
- PUNCH_PUNCH ,//点击打卡 5044
|
|
|
- PUNCH_RECORD ,//点击战绩 5045
|
|
|
- PUNCH_RANKING_LIST ,//点击本月排行榜 5046
|
|
|
- PUNCH_ACCUMULATIVE_LIST ,//选择累计打卡 5047
|
|
|
- PUNCH_CONTINUATION ,//选择连续打卡 5048
|
|
|
- SHEEP_TIXIAN_COMMIT ,//点击 提现提交按钮 5049
|
|
|
- SHEEP_SEQUENTIAL_TASK ,//点击进入连续任务界面 5050
|
|
|
- SHEEP_GAME_TASK ,//点击进入游戏任务界面 5051
|
|
|
- XIANWAN_WEBVIEW ,//闲玩 5052
|
|
|
- ORDER_MANAGER ,//订单管理 5053
|
|
|
- USER_AUTHENTICATION_ENTER ,//进入实名认证界面 5054
|
|
|
- TAB_USER ,//点击主页tab中的个人中心模块 5055
|
|
|
- TAB_FIND ,//点击主页tab中的发现模块 5056
|
|
|
- FIND_TAG ,//点击发现模块上面的标签 5057 需要传标签id到substring中,如:{"find_tag_name": "全部}
|
|
|
- FIND_ITEM ,//点击发现模块中列表里面的一个单项 5058 需要传发现项的id到substring中,如:{"find_id": 1}
|
|
|
- FIND_APP ,//点击下载或者预约、取消预约等 发现模块中的一个游戏或者应用 5059 需要传发现App的id和操作到substring中,如:{"application_id": 1, "action", "开始下载"}
|
|
|
- FIND_SHARE ,//点击发现详情中的分享 5060 需要传发现项的id或者application_id到substring中,如:{"find_id": 1}或{"application_id": 1}
|
|
|
- FIND_TASK ,//领取任务或者取消任务 5061 需要传任务的id和操作到substring中,如:{"release_task_id":1,"action":"领取任务"}或{"release_task_id":1,"action":"取消任务"}
|
|
|
- FIND_SCORE ,//评分或者重新评分 5062 需要传发现app的id到substring中,如:{"application_id": 1}
|
|
|
- USER_FIND_APP_ORDER ,//点击个人中心中的游戏预约 5063
|
|
|
- MY_MONEY_TAB ,//点击我的资产中的tab 5064 需要传点击的tab对应的名字:充值记录、提现记录、收支明细,如:{"tab_name": "充值记录"}或{"tab_name": "提现记录"}或{"tab_name": "收支明细"}
|
|
|
- NEWBIE_TASK ,//点击新手任务图标 5065
|
|
|
+ public enum Event {
|
|
|
+ GAME_DOWNLOAD("游戏下载次数"),// 5001
|
|
|
+ BANNER_CLICK_HORIZONTAL("轮播图 广告点击次数"),// 5002
|
|
|
+ TAB_GAME("主页tab中的游戏页签 注:!!!!!界面已经没有显示了!!!!!"),//5003
|
|
|
+ TAB_CATEGORY("主页tab中的分类页签 注:!!!!!界面已经没有显示了!!!!!"),//5004
|
|
|
+ TAB_SHEEP("主页tab中的小绵羊页签 "),//5005
|
|
|
+ TAB_JIEZHEWAN("主页tab中的借着玩页签 注:!!!!!界面已经没有显示了!!!!!"),//5006
|
|
|
+ TAB_CREDITCARD("信用卡页签 注:!!!!!界面已经没有显示了!!!!!"),//5007
|
|
|
+ SHEEP_TASK_TRY("试玩赚钱"),//5008
|
|
|
+ SHEEP_TASK_INVITE("邀请赚钱"),//5009
|
|
|
+ SHEEP_TASK_LIE("躺着赚钱"),//5010
|
|
|
+ SHEEP_TIXIAN("提现"),//5011
|
|
|
+ TASK_DETAIL("任务详情"),//5012
|
|
|
+ TASK_DOWNLOAD("任务详情中->下载游戏"),//5013
|
|
|
+ TASK_UPLOAD_PICTURE("任务详情中->上传截图"),//5014
|
|
|
+ USER_ACCOUNT_SAFE("个人中心 -> 账号安全"),//5015
|
|
|
+ USER_TASK_RECORD("个人中心 -> 任务记录"),//5016
|
|
|
+ USER_TIXIAN_DETAIL("个人中心 -> 提现明细"),//5017
|
|
|
+ USER_BIND_PHONE("账号安全 -> 绑定手机号(确定按钮"),//5018
|
|
|
+ USER_BIND_WEIXIN("账号安全 -> 绑定微信号(立即绑定按钮)"),//5019
|
|
|
+ USER_AUTHENTICATION("账号安全 -> 实名认证(提交按钮)"),//5020
|
|
|
+ USER_LOGOUT("账号安全 -> 退出登录按钮"),//5021
|
|
|
+ GAME_SEARCH("游戏模块 -> 搜索界面-> 搜索按钮"),//5022
|
|
|
+ GAME_DOWNLOAD_MANAGER("主界面右上角 -> 下载管理按钮"),//5023
|
|
|
+ TASK_ACCEPT("接取任务"),//5024
|
|
|
+ SHEEP_NEWBIE_TASK_LIST("新手任务列表界面,(界面已经修改为对话框了)"),//5025
|
|
|
+ SHEEP_NEWBIE_TASK_UNDERSTAND_SHEEP("一分钟了解小绵羊界面"),//5026
|
|
|
+ SHEEP_NEWBIE_TASK_REGIST_SUCCESS_DIALOG("注册小绵羊成功对话框"),//5027
|
|
|
+ SHEEP_NEWBIE_TASK_LIST_DIALOG("新手任务列表对话框"),//5028
|
|
|
+ SHEEP_NEWBIE_TASK_ADD_QQ("加入官方QQ群任务"),//5029
|
|
|
+ SHEEP_CREDIT_CARD("信用卡任务列表界面"),//5030
|
|
|
+ SHEEP_CREDIT_CARD_ACCEPT_LIST("信用卡任务列表界面 -> 信用卡任务接受列表"),//5031
|
|
|
+ SHEEP_CREDIT_CARD_PROGRESS_QUERY_LIST("信用卡任务列表界面 ->信用卡任务进度查询列表"),//5032
|
|
|
+ SHEEP_CREDIT_CARD_DETAIL("信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面"),//5033
|
|
|
+ SHEEP_CREDIT_CARD_DETAIL_WEB("信用卡任务列表界面 -> 信用卡任务接受列表 -> 信用卡任务详情界面 -> 申请信用卡web界面"),//5034
|
|
|
+ SHEEP_CREDIT_CARD_PROGRESS_QUERY("信用卡任务列表界面 ->信用卡任务进度查询列表 -> 信用卡任务进度查询"),//5035
|
|
|
+ TASK_START_APP("打开任务应用或游戏"),//5036
|
|
|
+ TASK_INSTALL_APP("安装应用"),//5037
|
|
|
+ SHEEP_START("启动小绵羊"),//5038
|
|
|
+ SHEEP_RESUME("小绵羊进入前台"),//5039
|
|
|
+ SHEEP_PAUSE("小绵羊进入后台"),//5040
|
|
|
+ SHEEP_STOP("退出小绵羊"),//5041
|
|
|
+ PUNCH("点击打卡赚钱"),//5042
|
|
|
+ PUNCH_SIGN_UP("点击报名"),//5043
|
|
|
+ PUNCH_PUNCH("点击打卡"),//5044
|
|
|
+ PUNCH_RECORD("点击战绩"),//5045
|
|
|
+ PUNCH_RANKING_LIST("点击本月排行榜"),//5046
|
|
|
+ PUNCH_ACCUMULATIVE_LIST("选择累计打卡"),//5047
|
|
|
+ PUNCH_CONTINUATION("选择连续打卡"),//5048
|
|
|
+ SHEEP_TIXIAN_COMMIT("点击 提现提交按钮"),//5049
|
|
|
+ SHEEP_SEQUENTIAL_TASK("点击进入连续任务界面"),//5050
|
|
|
+ SHEEP_GAME_TASK("点击进入游戏任务界面"),//5051
|
|
|
+ XIANWAN_WEBVIEW("闲玩"),//5052
|
|
|
+ ORDER_MANAGER("订单管理"),//5053
|
|
|
+ USER_AUTHENTICATION_ENTER("进入实名认证界面"),//5054
|
|
|
+ TAB_USER("点击主页tab中的个人中心模块"),//5055
|
|
|
+ TAB_FIND("点击主页tab中的发现模块"),//5056
|
|
|
+ FIND_TAG("点击发现模块上面的标签 需要传标签id到substring中,如:{\"find_tag_name\": \"全部\"}"),//5057
|
|
|
+ FIND_ITEM("点击发现模块中列表里面的一个单项 需要传发现项的id到substring中,如:{\"find_id\": 1}"),//5058
|
|
|
+ FIND_APP("点击下载或者预约、取消预约等 发现模块中的一个游戏或者应用 需要传发现App的id和操作到substring中,如:{\"application_id\": 1, \"action\", \"开始下载\"}"),//5059
|
|
|
+ FIND_SHARE("点击发现详情中的分享 需要传发现项的id或者application_id到substring中,如:{\"find_id\": 1}或{\"application_id\": 1}"),//5060
|
|
|
+ FIND_TASK("领取任务或者取消任务 需要传任务的id和操作到substring中,如:{\"release_task_id\":1,\"action\":\"领取任务\"}或{\"release_task_id\":1,\"action\":\"取消任务\"}"),//5061
|
|
|
+ FIND_SCORE("评分或者重新评分 需要传发现app的id到substring中,如:{\"application_id\": 1}"),//5062
|
|
|
+ USER_FIND_APP_ORDER("点击个人中心中的游戏预约"),//5063
|
|
|
+ MY_MONEY_TAB("点击我的资产中的tab 需要传点击的tab对应的名字:充值记录、提现记录、收支明细,如:{\"tab_name\": \"充值记录\"}或{\"tab_name\": \"提现记录\"}或{\"tab_name\": \"收支明细\"}"),//5064
|
|
|
+ NEWBIE_TASK("点击新手任务图标"),//5065
|
|
|
+ AD_SPLASH("点击开屏广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5066
|
|
|
+ AD_TOAST("点击弹窗广告 需要传点击的广告对应的id,如:{\"ad_id\": 1}"),//5067
|
|
|
+ LOGIN_PHONE("点击登录界面中的手机号登录"),//5068
|
|
|
+ LOGIN_QQ("点击登录界面中的QQ登录"),//5069
|
|
|
+ LOGIN_WX("点击登录界面中的微信登录"),//5070
|
|
|
+ USER_INFO("个人中心 -> 个人资料"),//5071
|
|
|
+ USER_MY_MONEY("个人中心 -> 我的资产"),//5072
|
|
|
+ USER_AGENT("个人中心 -> 代理"),//5073
|
|
|
+ USER_FAQ("个人中心 -> FAQ帮助"),//5074
|
|
|
+ USER_ABOUT_US("个人中心 -> 关于我们"),//5075
|
|
|
+ USER_FEEDBACK("个人中心 -> 意见反馈"),//5076
|
|
|
+ USER_SHARE("个人中心 -> 推荐给好友"),//5077
|
|
|
+ USER_UPGRADE("个人中心 -> 版本更新"),//5078
|
|
|
+ USER_CLEAN("个人中心 -> 清除缓存"),//5079
|
|
|
+ USER_CLEAN_SURE("个人中心 -> 清除缓存 -> 确认"),//5080
|
|
|
+ USER_NEW_VERSION("个人中心 -> 新功能介绍"),//5081
|
|
|
+ USER_GAME_ACCOUNT("个人中心 -> 游戏账号"),//5082
|
|
|
+ GAME_INSTEAD_OF_RECHARGE("主页 -> 游戏代充"),//5083
|
|
|
+ UPGRADE_DIALOG_BT("升级对话框 -> 立即安装、立即更新、下次更新 需要传对应操作到substring中,如:{\"action\":\"立即安装\"}或者{\"action\":\"立即更新\"}或者{\"action\":\"下次更新\"}"),//5084
|
|
|
+ RECHARGE("充值 需要传来源到substring中,如:{\"from\":\"我的资产\"}或者{\"from\":\"首页\"}或者{\"from\":\"我的资产\"}或者{\"from\":\"内部H5\"}或者{\"from\":\"推送\"}或者{\"from\":\"充值Q币\"}"),//5085
|
|
|
+ RECHARGE_PAY("充值 -> 立即支付"),//5086
|
|
|
+ RECHARGE_QQ("充值Q币 需要传来源到substring中,如:{\"from\":\"发现\"}或者{\"from\":\"首页\"}或者{\"from\":\"推送\"}"),//5087
|
|
|
+ RECHARGE_QQ_PAY("充值Q币 -> 立即支付"),//5088
|
|
|
+ USER_INFO_AVATAR("个人中心 -> 个人资料 -> 头像"),//5089
|
|
|
+ USER_INFO_NAME("个人中心 -> 个人资料 -> 昵称"),//5090
|
|
|
+ USER_INFO_NAME_MODIFY("个人中心 -> 个人资料 -> 昵称 -> 确认修改"),//5091
|
|
|
+ QR_SHARE("我的二维码"),//5092
|
|
|
+ QR_SAVE("保存二维码至手机"),//5093
|
|
|
+ QR_COPY("复制二维码链接"),//5094
|
|
|
+ LINK_SHARE("分享链接"),//5095
|
|
|
+ BIND_WX("绑定微信"),//5096
|
|
|
+ BIND_PHONE("绑定手机号"),//5097
|
|
|
+ SHARE_TO_WX("分享到微信"),//5098
|
|
|
+ SHARE_TO_QQ("分享到QQ"),//5099
|
|
|
+ USER_FEEDBACK_COMMIT("个人中心 -> 意见反馈 -> 提交建议"),//5100
|
|
|
+ SEARCH_GAME("游戏代充模块 -> 搜索游戏"),//5101
|
|
|
+ SEARCH_GAME_COMMIT("游戏代充模块 -> 搜索游戏 -> 点击搜索按钮"),//5102
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_HELP("游戏代充模块 -> 点击帮助图标"),//5103
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_TAB("游戏代充模块 -> 点击上面的平台进行切换 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5104
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_PLATFORM("游戏代充模块 -> 点击平台充值按钮 需要传task_type和平台名称到substring中,如:{\"task_type\":1,\"name\":\"平台|小米|腾讯\"}"),//5105
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_GAME("游戏代充模块 -> 点击立即充值"),//5106
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_PAY("游戏代充模块 -> 点击立即充值 -> 点击立即支付"),//5107
|
|
|
+ GAME_INSTEAD_OF_RECHARGE_GET("游戏代充模块 -> 点击领取游戏账号"),//5108
|
|
|
+ USER_GAME_ACCOUNT_ADD("个人中心 -> 游戏账号 -> 点击添加图标"),//5109
|
|
|
+ USER_GAME_ACCOUNT_ADD_COMMIT("个人中心 -> 游戏账号 -> 点击添加图标 -> 提交"),//5110
|
|
|
+ USER_GAME_ACCOUNT_LOOK("个人中心 -> 游戏账号 -> 点击游戏账号中的查看"),//5111
|
|
|
+ USER_GAME_ACCOUNT_LOOK_MODIFY("个人中心 -> 游戏账号 -> 点击游戏账号中的查看 -> 点击修改"),//5112
|
|
|
+ USER_GAME_ACCOUNT_LOOK_MODIFY_COMMIT("个人中心 -> 游戏账号 -> 点击游戏账号中的查看 -> 点击修改 -> 立即修改"),//5113
|
|
|
+ USER_GAME_ACCOUNT_DEL("个人中心 -> 游戏账号 -> 点击游戏账号中的删除"),//5114
|
|
|
+ USER_GAME_ACCOUNT_DEL_COMMIT("个人中心 -> 游戏账号 -> 点击游戏账号中的删除 -> 确认删除"),//5115
|
|
|
;
|
|
|
- private String key;
|
|
|
- Event(String key){
|
|
|
- this.key = key;
|
|
|
- }
|
|
|
- Event(){
|
|
|
- this.key = name().toLowerCase();
|
|
|
+ private String tag;
|
|
|
+
|
|
|
+ Event(String tag) {
|
|
|
+ this.tag = tag;
|
|
|
}
|
|
|
|
|
|
- public String getKey() {
|
|
|
- return key;
|
|
|
+ public String getTag() {
|
|
|
+ return tag;
|
|
|
}
|
|
|
|
|
|
- public void setKey(String key) {
|
|
|
- this.key = key;
|
|
|
+ public void setTag(String tag) {
|
|
|
+ this.tag = tag;
|
|
|
}
|
|
|
- public int getId(){
|
|
|
- return ordinal()+5001;
|
|
|
+
|
|
|
+ public int getId() {
|
|
|
+ return ordinal() + 5001;
|
|
|
}
|
|
|
- public void onEvent(){
|
|
|
+
|
|
|
+ public void onEvent() {
|
|
|
UMConfigUtils.onEvent(this);
|
|
|
}
|
|
|
- public void onEvent(Map<String, String> map){
|
|
|
+
|
|
|
+ public void onEvent(Map<String, String> map) {
|
|
|
UMConfigUtils.onEvent(this, map);
|
|
|
}
|
|
|
- public void onEvent(Object...items){
|
|
|
+
|
|
|
+ public void onEvent(Object... items) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
for (int i = 0; i < items.length; ) {
|
|
|
map.put(items[i].toString(), items[i + 1].toString());
|
|
|
@@ -128,48 +183,58 @@ public class UMConfigUtils {
|
|
|
UMConfigUtils.onEvent(this, map);
|
|
|
}
|
|
|
|
|
|
- public static void println() {
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ return String.format(Locale.CHINA, "%d\t%s", getId(), getTag());
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String allToString() {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder("subtype\t说明\t\ttype为5000\n");
|
|
|
Event[] items = Event.values();
|
|
|
for (int i = 0; i < items.length; i++) {
|
|
|
Event event = items[i];
|
|
|
- LogUtil.println("打点Event", i, event.getKey(), event.getId());
|
|
|
+ if(i != 0)
|
|
|
+ stringBuilder.append("\n");
|
|
|
+ stringBuilder.append(event.toString());
|
|
|
}
|
|
|
+ return stringBuilder.toString();
|
|
|
}
|
|
|
}
|
|
|
- static {
|
|
|
- if(BuildConfig.DEBUG)
|
|
|
- Event.println();
|
|
|
+
|
|
|
+ public static void copyDaDianData() {
|
|
|
+ StringUtils.CopyText(SheepApp.getInstance(), Event.allToString());
|
|
|
}
|
|
|
|
|
|
- public enum IdEvent{
|
|
|
+ public enum IdEvent {
|
|
|
HOME_LIST,//id 1 首页功能列表
|
|
|
BANNER(),//id 2 首页轮播图
|
|
|
TASK(),//id 3 任务列表
|
|
|
;
|
|
|
- private int getType(){
|
|
|
- return ordinal()+1;
|
|
|
+
|
|
|
+ private int getType() {
|
|
|
+ return ordinal() + 1;
|
|
|
}
|
|
|
- synchronized public void commit(int click_id){
|
|
|
+
|
|
|
+ synchronized public void commit(int click_id) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("click_id", click_id);
|
|
|
jsonObject.put("type", getType());
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().commitIdEvent(jsonObject)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
- }
|
|
|
- });
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
- public static class Source{
|
|
|
+
|
|
|
+ public static class Source {
|
|
|
public static final String QQ = "QQ";
|
|
|
public static final String WECHAT = "wechat";
|
|
|
public static final String SHEEP = "sheep";
|
|
|
@@ -179,56 +244,54 @@ public class UMConfigUtils {
|
|
|
* 用户信息统计
|
|
|
* 登录
|
|
|
*/
|
|
|
- public static void onProfileSignIn(){
|
|
|
- String source = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_TYPE,Source.SHEEP);
|
|
|
- String openid = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_OPENID,"");
|
|
|
-
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onProfileSignIn(source,openid);
|
|
|
-
|
|
|
+ public static void onProfileSignIn() {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
//自己的统计信息
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signIn,"");
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signIn, "");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 登出
|
|
|
*/
|
|
|
- public static void onProfileSignOff(){
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onProfileSignOff();
|
|
|
-
|
|
|
+ public static void onProfileSignOff() {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
//自己的统计退出
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signOff,"");
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signOff, "");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Umeng事件统计
|
|
|
+ *
|
|
|
* @param event
|
|
|
*/
|
|
|
- public static void onEvent(Event event){
|
|
|
- LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
|
|
|
- try{
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onEvent(SheepApp.mContext,event.getKey());
|
|
|
-
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(),"");
|
|
|
- }catch (Exception e){
|
|
|
+ public static void onEvent(Event event) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), "");
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* Umeng事件统计
|
|
|
+ *
|
|
|
* @param event
|
|
|
*/
|
|
|
- public static void onEvent(Event event, Map<String, String> map){
|
|
|
- LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
|
|
|
- try{
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onEvent(SheepApp.mContext,event.getKey(), map);
|
|
|
-
|
|
|
+ public static void onEvent(Event event, Map<String, String> map) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), JSON.toJSONString(map));
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
@@ -236,72 +299,80 @@ public class UMConfigUtils {
|
|
|
|
|
|
/**
|
|
|
* 页面开始
|
|
|
+ *
|
|
|
* @param context
|
|
|
*/
|
|
|
- public static void onPageStart(Context context){
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onResume(context);
|
|
|
-
|
|
|
+ public static void onPageStart(Context context) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
String tag = context.getClass().getCanonicalName();
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START,0,tag);
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START, 0, tag);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 页面开始
|
|
|
+ *
|
|
|
* @param tag
|
|
|
*/
|
|
|
- public static void onPageStart(String tag){
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onPageStart(tag);
|
|
|
-
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START,0,tag);
|
|
|
+ public static void onPageStart(String tag) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START, 0, tag);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 页面结束
|
|
|
+ *
|
|
|
* @param context
|
|
|
*/
|
|
|
- public static void onPageEnd(Context context){
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onPause(context);
|
|
|
-
|
|
|
+ public static void onPageEnd(Context context) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
String tag = context.getClass().getCanonicalName();
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END,0,tag);
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END, 0, tag);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 页面结束
|
|
|
+ *
|
|
|
* @param tag
|
|
|
*/
|
|
|
- public static void onPageEnd(String tag){
|
|
|
-// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
-// MobclickAgent.onPageEnd(tag);
|
|
|
-
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END,0,tag);
|
|
|
+ public static void onPageEnd(String tag) {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END, 0, tag);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 任务完成时间统计
|
|
|
*/
|
|
|
- public static void finishTask(){
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.TASK_FINISH,0,"");
|
|
|
+ public static void finishTask() {
|
|
|
+ if(ActivityManager.getInstance().currentActivity() instanceof ChangeTelAct){//绑定手机号界面卡,接口不能通过,调了也没用
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.TASK_FINISH, 0, "");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 当Fragment对用户的可见性发生了改变的时候就会回调此方法
|
|
|
- * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
|
|
|
+ *
|
|
|
+ * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
|
|
|
* @param isHappenedInSetUserVisibleHintMethod true:本次回调发生在setUserVisibleHintMethod方法里;false:发生在onResume或onPause方法里
|
|
|
- * @param tag fragment 名字
|
|
|
+ * @param tag fragment 名字
|
|
|
*/
|
|
|
- public static void onVisibilityChangedToUser(boolean isVisibleToUser, boolean isHappenedInSetUserVisibleHintMethod,String tag){
|
|
|
- if(isVisibleToUser){
|
|
|
- if(tag != null){
|
|
|
+ public static void onVisibilityChangedToUser(boolean isVisibleToUser, boolean isHappenedInSetUserVisibleHintMethod, String tag) {
|
|
|
+ if (isVisibleToUser) {
|
|
|
+ if (tag != null) {
|
|
|
//umeng fragment
|
|
|
UMConfigUtils.onPageStart(tag);
|
|
|
}
|
|
|
- }else{
|
|
|
- if(tag != null){
|
|
|
+ } else {
|
|
|
+ if (tag != null) {
|
|
|
UMConfigUtils.onPageEnd(tag);
|
|
|
}
|
|
|
}
|