|
@@ -27,84 +27,117 @@ public class UMConfigUtils {
|
|
|
|
|
|
|
|
public static final String LOGIN_TYPE = "sheep_login_type";
|
|
public static final String LOGIN_TYPE = "sheep_login_type";
|
|
|
public static final String LOGIN_OPENID = "sheep_login_openid";
|
|
public static final String LOGIN_OPENID = "sheep_login_openid";
|
|
|
|
|
+
|
|
|
//统计点击次数需要的子subtype
|
|
//统计点击次数需要的子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
|
|
|
|
|
- AD_SPLASH ,//点击开屏广告 5066 需要传点击的广告对应的id,如:{"ad_id": 1}
|
|
|
|
|
- AD_TOAST ,//点击弹窗广告 5067 需要传点击的广告对应的id,如:{"ad_id": 1}
|
|
|
|
|
- LOGIN_PHONE ,//点击登录界面中的手机号登录 5068
|
|
|
|
|
- LOGIN_QQ ,//点击登录界面中的QQ登录 5069
|
|
|
|
|
- LOGIN_WX ,//点击登录界面中的微信登录 5070
|
|
|
|
|
|
|
+ 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
|
|
|
|
|
+ AD_SPLASH,//点击开屏广告 5066 需要传点击的广告对应的id,如:{"ad_id": 1}
|
|
|
|
|
+ AD_TOAST,//点击弹窗广告 5067 需要传点击的广告对应的id,如:{"ad_id": 1}
|
|
|
|
|
+ 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
|
|
|
|
|
+ USER_GAME_INSTEAD_OF_RECHARGE,//个人中心 -> 游戏代充 5083
|
|
|
|
|
+ UPGRADE_DIALOG_BT,//升级对话框 -> 立即安装、立即更新、下次更新 5084 需要传对应操作到substring中,如:{"action":"立即安装"}或者{"action":"立即更新"}或者{"action":"下次更新"}
|
|
|
|
|
+ RECHARGE,//充值 5085 需要传来源到substring中,如:{"from":"我的资产"}或者{"from":"首页"}或者{"from":"我的资产"}或者{"from":"内部H5"}或者{"from":"推送"}或者{"from":"充值Q币"}
|
|
|
|
|
+ RECHARGE_PAY,//充值 -> 立即支付 50
|
|
|
|
|
+ RECHARGE_QQ,//充值Q币 50 需要传来源到substring中,如:{"from":"发现"}或者{"from":"首页"}或者{"from":"推送"}
|
|
|
|
|
+ RECHARGE_QQ_PAY,//充值Q币 -> 立即支付 50
|
|
|
|
|
+ USER_INFO_AVATAR,//个人中心 -> 个人资料 -> 头像 50
|
|
|
|
|
+ USER_INFO_NAME,//个人中心 -> 个人资料 -> 昵称 50
|
|
|
|
|
+ USER_INFO_NAME_MODIFY,//个人中心 -> 个人资料 -> 昵称 -> 确认修改 50
|
|
|
|
|
+ QR_SHARE,//我的二维码 50
|
|
|
|
|
+ QR_SAVE,//保存二维码至手机 50
|
|
|
|
|
+ QR_COPY,//复制二维码链接 50
|
|
|
|
|
+ LINK_SHARE,//分享链接 50
|
|
|
|
|
+ BIND_WX,//绑定微信 50
|
|
|
|
|
+ BIND_PHONE,//绑定手机号 50
|
|
|
|
|
+ SHARE_TO_WX,//分享到微信 50
|
|
|
|
|
+ SHARE_TO_QQ,//分享到QQ 50
|
|
|
|
|
+ USER_FEEDBACK_COMMIT,//个人中心 -> 意见反馈 -> 提交建议 50
|
|
|
;
|
|
;
|
|
|
private String key;
|
|
private String key;
|
|
|
- Event(String key){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Event(String key) {
|
|
|
this.key = key;
|
|
this.key = key;
|
|
|
}
|
|
}
|
|
|
- Event(){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Event() {
|
|
|
this.key = name().toLowerCase();
|
|
this.key = name().toLowerCase();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -115,16 +148,20 @@ public class UMConfigUtils {
|
|
|
public void setKey(String key) {
|
|
public void setKey(String key) {
|
|
|
this.key = key;
|
|
this.key = key;
|
|
|
}
|
|
}
|
|
|
- public int getId(){
|
|
|
|
|
- return ordinal()+5001;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public int getId() {
|
|
|
|
|
+ return ordinal() + 5001;
|
|
|
}
|
|
}
|
|
|
- public void onEvent(){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public void onEvent() {
|
|
|
UMConfigUtils.onEvent(this);
|
|
UMConfigUtils.onEvent(this);
|
|
|
}
|
|
}
|
|
|
- public void onEvent(Map<String, String> map){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public void onEvent(Map<String, String> map) {
|
|
|
UMConfigUtils.onEvent(this, map);
|
|
UMConfigUtils.onEvent(this, map);
|
|
|
}
|
|
}
|
|
|
- public void onEvent(Object...items){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public void onEvent(Object... items) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
|
for (int i = 0; i < items.length; ) {
|
|
for (int i = 0; i < items.length; ) {
|
|
|
map.put(items[i].toString(), items[i + 1].toString());
|
|
map.put(items[i].toString(), items[i + 1].toString());
|
|
@@ -141,38 +178,42 @@ public class UMConfigUtils {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
static {
|
|
static {
|
|
|
- if(BuildConfig.DEBUG)
|
|
|
|
|
|
|
+ if (BuildConfig.DEBUG)
|
|
|
Event.println();
|
|
Event.println();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public enum IdEvent{
|
|
|
|
|
|
|
+ public enum IdEvent {
|
|
|
HOME_LIST,//id 1 首页功能列表
|
|
HOME_LIST,//id 1 首页功能列表
|
|
|
BANNER(),//id 2 首页轮播图
|
|
BANNER(),//id 2 首页轮播图
|
|
|
TASK(),//id 3 任务列表
|
|
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 jsonObject = new JSONObject();
|
|
|
jsonObject.put("click_id", click_id);
|
|
jsonObject.put("click_id", click_id);
|
|
|
jsonObject.put("type", getType());
|
|
jsonObject.put("type", getType());
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().commitIdEvent(jsonObject)
|
|
SheepApp.getInstance().getNetComponent().getApiService().commitIdEvent(jsonObject)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onError(BaseMessage 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 QQ = "QQ";
|
|
|
public static final String WECHAT = "wechat";
|
|
public static final String WECHAT = "wechat";
|
|
|
public static final String SHEEP = "sheep";
|
|
public static final String SHEEP = "sheep";
|
|
@@ -182,56 +223,59 @@ 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,"");
|
|
|
|
|
|
|
+ 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())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onProfileSignIn(source,openid);
|
|
// MobclickAgent.onProfileSignIn(source,openid);
|
|
|
|
|
|
|
|
//自己的统计信息
|
|
//自己的统计信息
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signIn,"");
|
|
|
|
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signIn, "");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 登出
|
|
* 登出
|
|
|
*/
|
|
*/
|
|
|
- public static void onProfileSignOff(){
|
|
|
|
|
|
|
+ public static void onProfileSignOff() {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onProfileSignOff();
|
|
// MobclickAgent.onProfileSignOff();
|
|
|
|
|
|
|
|
//自己的统计退出
|
|
//自己的统计退出
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU,AppStatisticsConfig.DauSubType.signOff,"");
|
|
|
|
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.DAU, AppStatisticsConfig.DauSubType.signOff, "");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Umeng事件统计
|
|
* Umeng事件统计
|
|
|
|
|
+ *
|
|
|
* @param event
|
|
* @param event
|
|
|
*/
|
|
*/
|
|
|
- public static void onEvent(Event event){
|
|
|
|
|
- LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
|
|
|
|
|
- try{
|
|
|
|
|
|
|
+ public static void onEvent(Event event) {
|
|
|
|
|
+ LogUtil.println("SheepApp onEvent " + event.getId() + " " + event.getKey());
|
|
|
|
|
+ try {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onEvent(SheepApp.mContext,event.getKey());
|
|
// MobclickAgent.onEvent(SheepApp.mContext,event.getKey());
|
|
|
|
|
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(),"");
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), "");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Umeng事件统计
|
|
* Umeng事件统计
|
|
|
|
|
+ *
|
|
|
* @param event
|
|
* @param event
|
|
|
*/
|
|
*/
|
|
|
- public static void onEvent(Event event, Map<String, String> map){
|
|
|
|
|
- LogUtil.println("SheepApp onEvent "+event.getId()+" "+event.getKey());
|
|
|
|
|
- try{
|
|
|
|
|
|
|
+ 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())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onEvent(SheepApp.mContext,event.getKey(), map);
|
|
// MobclickAgent.onEvent(SheepApp.mContext,event.getKey(), map);
|
|
|
|
|
|
|
|
AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), JSON.toJSONString(map));
|
|
AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.ONCLICK_EVENT, event.getId(), JSON.toJSONString(map));
|
|
|
- }catch (Exception e){
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -239,72 +283,77 @@ public class UMConfigUtils {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 页面开始
|
|
* 页面开始
|
|
|
|
|
+ *
|
|
|
* @param context
|
|
* @param context
|
|
|
*/
|
|
*/
|
|
|
- public static void onPageStart(Context context){
|
|
|
|
|
|
|
+ public static void onPageStart(Context context) {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onResume(context);
|
|
// MobclickAgent.onResume(context);
|
|
|
|
|
|
|
|
String tag = context.getClass().getCanonicalName();
|
|
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
|
|
* @param tag
|
|
|
*/
|
|
*/
|
|
|
- public static void onPageStart(String tag){
|
|
|
|
|
|
|
+ public static void onPageStart(String tag) {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onPageStart(tag);
|
|
// MobclickAgent.onPageStart(tag);
|
|
|
|
|
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START,0,tag);
|
|
|
|
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_START, 0, tag);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 页面结束
|
|
* 页面结束
|
|
|
|
|
+ *
|
|
|
* @param context
|
|
* @param context
|
|
|
*/
|
|
*/
|
|
|
- public static void onPageEnd(Context context){
|
|
|
|
|
|
|
+ public static void onPageEnd(Context context) {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onPause(context);
|
|
// MobclickAgent.onPause(context);
|
|
|
|
|
|
|
|
String tag = context.getClass().getCanonicalName();
|
|
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
|
|
* @param tag
|
|
|
*/
|
|
*/
|
|
|
- public static void onPageEnd(String tag){
|
|
|
|
|
|
|
+ public static void onPageEnd(String tag) {
|
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
// if(SheepApp.getInstance().getConnectAddress() != null && SheepApp.getInstance().getConnectAddress().isUseUMStatistics())
|
|
|
// MobclickAgent.onPageEnd(tag);
|
|
// MobclickAgent.onPageEnd(tag);
|
|
|
|
|
|
|
|
- AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.PAGE_END,0,tag);
|
|
|
|
|
|
|
+ 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() {
|
|
|
|
|
+ AppStatistics.getInstance().sendDataToServer(AppStatisticsConfig.SuperType.TASK_FINISH, 0, "");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 当Fragment对用户的可见性发生了改变的时候就会回调此方法
|
|
* 当Fragment对用户的可见性发生了改变的时候就会回调此方法
|
|
|
- * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
|
|
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
|
|
|
* @param isHappenedInSetUserVisibleHintMethod true:本次回调发生在setUserVisibleHintMethod方法里;false:发生在onResume或onPause方法里
|
|
* @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
|
|
//umeng fragment
|
|
|
UMConfigUtils.onPageStart(tag);
|
|
UMConfigUtils.onPageStart(tag);
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
- if(tag != null){
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (tag != null) {
|
|
|
UMConfigUtils.onPageEnd(tag);
|
|
UMConfigUtils.onPageEnd(tag);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|