|
|
@@ -1,14 +1,159 @@
|
|
|
package com.sheep.gamegroup.util;
|
|
|
|
|
|
+
|
|
|
+import com.kfzs.duanduan.react.SharedPreferences;
|
|
|
+import com.kfzs.duanduan.utils.ShareUtils;
|
|
|
+import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
+import com.umeng.analytics.MobclickAgent;
|
|
|
+
|
|
|
/**
|
|
|
* Created by zhanghai on 2018/3/30.
|
|
|
*/
|
|
|
|
|
|
public class UMConfigUtils {
|
|
|
+
|
|
|
+ public static final String LOGIN_TYPE = "sheep_login_type";
|
|
|
+ public static final String LOGIN_OPENID = "sheep_login_openid";
|
|
|
+
|
|
|
public static class Event{
|
|
|
//下载点击事件
|
|
|
public static final String GAME_DOWNLOAD = "GameDownload";
|
|
|
//广告点击事件
|
|
|
public static final String BANNER_CLICK_HORIZONTAL = "BannerClickHorizontal";
|
|
|
+ //
|
|
|
+ public static final String TAB_GAME = "tab_game";
|
|
|
+ public static final String TAB_CATEGORY = "tab_category";
|
|
|
+ public static final String TAB_SHEEP = "tab_sheep";
|
|
|
+ public static final String TAB_JIEZHEWAN = "tab_jiezhewan";
|
|
|
+ public static final String TAB_CREDITCARD = "tab_creditcard";
|
|
|
+ public static final String SHEEP_TASK_TRY = "sheep_task_try";
|
|
|
+ public static final String SHEEP_TASK_INVITE = "sheep_task_invite";
|
|
|
+ public static final String SHEEP_TASK_LIE = "sheep_task_lie";
|
|
|
+ public static final String SHEEP_TIXIAN = "sheep_tixian";
|
|
|
+ public static final String TASK_DETAIL = "task_detail";
|
|
|
+ public static final String TASK_DOWNLOAD = "task_download";
|
|
|
+ public static final String TASK_UPLOAD_PICTURE = "task_upload_picture";
|
|
|
+ public static final String USER_ACCOUNT_SAFE = "user_account_safe";
|
|
|
+ public static final String USER_TASK_RECORD = "user_task_record";
|
|
|
+ public static final String USER_TIXIAN_DETAIL = "user_tixian_detail";
|
|
|
+ public static final String USER_BIND_PHONE = "user_bind_phone";
|
|
|
+ public static final String USER_BIND_WEIXIN = "user_bind_weixin";
|
|
|
+ public static final String USER_AUTHENTICATION = "user_authentication";
|
|
|
+ public static final String USER_LOGOUT = "user_logout";
|
|
|
+ public static final String GAME_SEARCH = "game_search";
|
|
|
+ public static final String GAME_DOWNLOAD_MANAGER = "game_download_manager";
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ public static class IntEvent{
|
|
|
+ //游戏下载次数
|
|
|
+ public static final int game_download = 1000;
|
|
|
+ //广告点击次数
|
|
|
+ public static final int banner_click_horizontal = 1001;
|
|
|
+ //游戏页签
|
|
|
+ public static final int tab_game = 1002;
|
|
|
+ //分类页签
|
|
|
+ public static final int tab_category = 1003;
|
|
|
+ //小绵羊页签
|
|
|
+ public static final int tab_sheep = 1004;
|
|
|
+ //借着玩页签
|
|
|
+ public static final int tab_jiezhewan = 1005;
|
|
|
+ //信用卡页签
|
|
|
+ public static final int tab_creditcard = 1006;
|
|
|
+ //试玩赚钱
|
|
|
+ public static final int sheep_task_try = 1007;
|
|
|
+ //邀请赚钱
|
|
|
+ public static final int sheep_task_invite = 1008;
|
|
|
+ //躺着赚钱
|
|
|
+ public static final int sheep_task_lie = 1009;
|
|
|
+ //提现
|
|
|
+ public static final int sheep_tixian = 1010;
|
|
|
+ //任务详情
|
|
|
+ public static final int task_detail = 1011;
|
|
|
+ //任务详情中->下载游戏
|
|
|
+ public static final int task_download = 1012;
|
|
|
+ //任务详情中->上传截图
|
|
|
+ public static final int task_upload_picture = 1013;
|
|
|
+ //个人中心 -> 账号安全
|
|
|
+ public static final int user_account_safe = 1014;
|
|
|
+ //个人中心 -> 任务记录
|
|
|
+ public static final int user_task_record = 1015;
|
|
|
+ //个人中心 -> 提现明细
|
|
|
+ public static final int user_tixian_detail = 1016;
|
|
|
+ //账号安全 -> 绑定手机号(确定按钮)
|
|
|
+ public static final int user_bind_phone = 1017;
|
|
|
+ //账号安全 -> 绑定微信号(立即绑定按钮)
|
|
|
+ public static final int user_bind_weixin = 1018;
|
|
|
+ //账号安全 -> 实名认证(提交按钮)
|
|
|
+ public static final int user_authentication = 1019;
|
|
|
+ //账号安全 -> 退出登录按钮
|
|
|
+ public static final int user_logout = 1020;
|
|
|
+ //搜索界面-> 搜索按钮
|
|
|
+ public static final int game_search = 1021;
|
|
|
+ //主界面右上角 -> 下载管理按钮
|
|
|
+ public static final int game_download_manager = 1022;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static class Source{
|
|
|
+ public static final String QQ = "QQ";
|
|
|
+ public static final String WECHAT = "wechat";
|
|
|
+ public static final String SHEEP = "sheep";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户信息统计
|
|
|
+ */
|
|
|
+ public static void onProfileSignIn(){
|
|
|
+ String source = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_TYPE,Source.SHEEP);
|
|
|
+ String openid = PreferenceUtils.getPrefString(SheepApp.mContext,LOGIN_OPENID,"");
|
|
|
+
|
|
|
+ MobclickAgent.onProfileSignIn(source,openid);
|
|
|
+
|
|
|
+ //自己的统计信息
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登出
|
|
|
+ */
|
|
|
+ public static void onProfileSignOff(){
|
|
|
+ MobclickAgent.onProfileSignOff();
|
|
|
+
|
|
|
+ //自己的统计退出
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Umeng事件统计
|
|
|
+ * @param event
|
|
|
+ */
|
|
|
+ public static void onEvent(String event){
|
|
|
+ MobclickAgent.onEvent(SheepApp.mContext,event);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 当Fragment对用户的可见性发生了改变的时候就会回调此方法
|
|
|
+ * @param isVisibleToUser true:用户能看见当前Fragment;false:用户看不见当前Fragment
|
|
|
+ * @param isHappenedInSetUserVisibleHintMethod true:本次回调发生在setUserVisibleHintMethod方法里;false:发生在onResume或onPause方法里
|
|
|
+ * @param tag fragment 名字
|
|
|
+ */
|
|
|
+ public static void onVisibilityChangedToUser(boolean isVisibleToUser, boolean isHappenedInSetUserVisibleHintMethod,String tag){
|
|
|
+ if(isVisibleToUser){
|
|
|
+ if(tag != null){
|
|
|
+ //umeng fragment
|
|
|
+ MobclickAgent.onPageStart(tag);
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(tag != null){
|
|
|
+ MobclickAgent.onPageEnd(tag);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|