埋点配置

This commit is contained in:
18401019693 2023-08-23 15:05:32 +08:00
parent 3de972d12c
commit 6bcaf2ba9c
10 changed files with 185 additions and 55 deletions

View File

@ -6,7 +6,8 @@
<uses-permission <uses-permission
android:name="android.permission.CALL_PHONE" android:name="android.permission.CALL_PHONE"
tools:node="remove" /> tools:node="remove" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" <uses-permission
android:name="android.permission.CHANGE_CONFIGURATION"
tools:ignore="ProtectedPermissions" /> tools:ignore="ProtectedPermissions" />
<uses-permission <uses-permission
android:name="android.permission.READ_LOGS" android:name="android.permission.READ_LOGS"
@ -95,9 +96,9 @@
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:largeHeap="true" android:largeHeap="true"
android:supportsRtl="true"
android:preserveLegacyExternalStorage="true" android:preserveLegacyExternalStorage="true"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
tools:replace="theme,label,icon,allowBackup"> tools:replace="theme,label,icon,allowBackup">
<!-- <service--> <!-- <service-->
@ -108,17 +109,17 @@
<!-- </service>--> <!-- </service>-->
<service <service
android:name="io.rong.push.platform.google.RongFirebaseMessagingService" android:name="io.rong.push.platform.google.RongFirebaseMessagingService"
android:stopWithTask="false" android:exported="false"
android:exported="false"> android:stopWithTask="false">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter> </intent-filter>
</service> </service>
<activity <activity
android:name="com.shayu.phonelive.activity.LauncherActivity" android:name="com.shayu.phonelive.activity.LauncherActivity"
android:exported="true"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" tools:ignore="LockedOrientationActivity">
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -130,7 +131,8 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="smvslm" />
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
</intent-filter> </intent-filter>
</activity> </activity>
@ -162,13 +164,16 @@
<meta-data <meta-data
android:name="com.facebook.sdk.ClientToken" android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" /> android:value="@string/facebook_client_token" />
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/> <meta-data
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
android:value="false" />
<meta-data <meta-data
android:name="firebase_messaging_auto_init_enabled" android:name="firebase_messaging_auto_init_enabled"
android:value="false" /> android:value="false" />
<meta-data <meta-data
android:name="firebase_analytics_collection_enabled" android:name="firebase_analytics_collection_enabled"
android:value="false" /> android:value="false" />
<receiver <receiver
android:name="com.shayu.phonelive.utils.CustomMessageReceiver" android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
android:exported="true"> android:exported="true">

View File

@ -32,6 +32,8 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener; import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
import com.tencent.imsdk.v2.V2TIMUserInfo; import com.tencent.imsdk.v2.V2TIMUserInfo;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
import com.yunbao.common.BuildConfig; import com.yunbao.common.BuildConfig;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
@ -163,7 +165,23 @@ public class AppContext extends CommonAppContext {
if (isMainProcess()) { if (isMainProcess()) {
OpenInstall.init(this); OpenInstall.init(this);
} }
//设置LOG开关默认为false
UMConfigure.setLogEnabled(true);
//友盟预初始化
UMConfigure.preInit(getApplicationContext(),"64e40ee55488fe7b3afa2c96","PDLive");
//友盟正式初始化
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE,
"64e40ee55488fe7b3afa2c96");
//集成umeng-crash-vx.x.x.aar则需要关闭原有统计SDK异常捕获功能
MobclickAgent.setCatchUncaughtExceptions(false);
//PushSDK初始化(如使用推送SDK必须调用此方法)
//统计SDK是否支持采集在子进程中打点的自定义事件默认不支持
UMConfigure.setProcessEvent(true);//支持多进程打点
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
//初始化 AndroidUtilCode //初始化 AndroidUtilCode

View File

@ -197,6 +197,7 @@ dependencies {
// //
api 'com.makeramen:roundedimageview:2.3.0' api 'com.makeramen:roundedimageview:2.3.0'
// SDK // SDK
implementation 'com.umeng.umsdk:common:9.6.3'// api 'com.umeng.umsdk:common:9.6.3'//
implementation 'com.umeng.umsdk:asms:1.8.0'// api 'com.umeng.umsdk:asms:1.8.0'//
api 'com.umeng.umsdk:uyumao:1.1.2' //使使common需搭配v9.6.3asms需搭配v1.7.0
} }

View File

@ -25,6 +25,7 @@ import androidx.annotation.RequiresApi;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -296,6 +297,7 @@ public class WebViewActivity extends AbsActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
MobclickAgent.onPageStart("WebViewActivity");
if (Constants.myIntoIndex == 2 && mWebView != null && indexInto == 1) { if (Constants.myIntoIndex == 2 && mWebView != null && indexInto == 1) {
if (Build.VERSION.SDK_INT >= 21) { if (Build.VERSION.SDK_INT >= 21) {
mWebView.post(new Runnable() { mWebView.post(new Runnable() {
@ -330,6 +332,7 @@ public class WebViewActivity extends AbsActivity {
if (Constants.isShowPage != -1) { if (Constants.isShowPage != -1) {
finish(); finish();
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
@ -434,4 +437,11 @@ public class WebViewActivity extends AbsActivity {
} }
@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPageEnd("WebViewActivity");
}
} }

View File

@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.lzf.easyfloat.EasyFloat; import com.lzf.easyfloat.EasyFloat;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.event.DataUserInfoEvent; import com.yunbao.common.event.DataUserInfoEvent;
@ -301,6 +302,8 @@ public class IMLoginManager extends BaseCacheManager {
* @param model * @param model
*/ */
public void setupLoginUser(@NonNull IMLoginModel model) { public void setupLoginUser(@NonNull IMLoginModel model) {
//当用户使用自有账号登录时可以这样统计
MobclickAgent.onProfileSignIn(String.valueOf(model.getId()));
this.userInfo = model; this.userInfo = model;
if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) { if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
token = userInfo.getToken(); token = userInfo.getToken();
@ -425,6 +428,8 @@ public class IMLoginManager extends BaseCacheManager {
// IMCenter.getInstance().clearConversations(null, Conversation.ConversationType.PRIVATE); // IMCenter.getInstance().clearConversations(null, Conversation.ConversationType.PRIVATE);
RongcloudIMManager.logoutIM(); RongcloudIMManager.logoutIM();
MessageIMManager.get(activity).logout(); MessageIMManager.get(activity).logout();
//登出
MobclickAgent.onProfileSignOff();
put(IS_HINT, 0); put(IS_HINT, 0);
APPEasyFloat.getInstance().dismiss(activity); APPEasyFloat.getInstance().dismiss(activity);
if (EasyFloat.isShow("LiveFloatView")) { if (EasyFloat.isShow("LiveFloatView")) {

View File

@ -52,6 +52,7 @@ import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSDKConfig; import com.tencent.imsdk.v2.V2TIMSDKConfig;
import com.tencent.imsdk.v2.V2TIMSDKListener; import com.tencent.imsdk.v2.V2TIMSDKListener;
import com.tencent.imsdk.v2.V2TIMUserFullInfo; import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
@ -80,6 +81,8 @@ import com.yunbao.common.event.UpdateTablePointMe;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.main.MainNetManager; import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.manager.APKManager; import com.yunbao.common.manager.APKManager;
@ -89,6 +92,7 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.GiftCacheUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.LocationUtil; import com.yunbao.common.utils.LocationUtil;
import com.yunbao.common.utils.ProcessResultUtil; import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
@ -101,9 +105,6 @@ import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.weight.LiveFloatView; import com.yunbao.common.views.weight.LiveFloatView;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.common.http.LiveHttpConsts;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.live.utils.LiveStorge; import com.yunbao.live.utils.LiveStorge;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.adapter.FullAdToBannerTransition; import com.yunbao.main.adapter.FullAdToBannerTransition;
@ -206,6 +207,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
@Override
protected void onPause() {
super.onPause();
}
@Override @Override
protected void main() { protected void main() {
ActivityCompat.postponeEnterTransition(this); ActivityCompat.postponeEnterTransition(this);
@ -327,6 +334,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
if (mTabButtonGroup.getCurPosition() != position) { if (mTabButtonGroup.getCurPosition() != position) {
System.err.println("重连IM:" + IMLoginManager.isLogin(mContext)); System.err.println("重连IM:" + IMLoginManager.isLogin(mContext));
if (!IMLoginManager.isLogin(mContext)) { if (!IMLoginManager.isLogin(mContext)) {
@ -708,11 +716,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
showStartDialog(); showStartDialog();
} else if (i == R.id.btn_search) { } else if (i == R.id.btn_search) {
SearchActivity.forward(mContext); SearchActivity.forward(mContext);
MobclickAgent.onEvent(mContext, "home_page_search", "右上角搜索按钮");
} else if (i == R.id.btn_follow) { } else if (i == R.id.btn_follow) {
//关注 //关注
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0); FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0);
} else if (i == R.id.img_trophy) { } else if (i == R.id.img_trophy) {
MainListActivity.forward(mContext, 0); MainListActivity.forward(mContext, 0);
MobclickAgent.onEvent(mContext, "home_page_ranking", "右上角排行榜按钮");
//RandomPkDialogFragment fragment = new RandomPkDialogFragment(); //RandomPkDialogFragment fragment = new RandomPkDialogFragment();
//fragment.show(this.getSupportFragmentManager(), "RandomPkDialogFragment"); //fragment.show(this.getSupportFragmentManager(), "RandomPkDialogFragment");
} }
@ -847,6 +859,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
NoviceInstructorManager.get(mContext).getNoviceInstructor(); NoviceInstructorManager.get(mContext).getNoviceInstructor();
NoviceInstructorManager.get(mContext).checktHomeZdyPop(); NoviceInstructorManager.get(mContext).checktHomeZdyPop();
initAnchorRecommendBanner(); initAnchorRecommendBanner();
} }
/** /**
@ -1068,7 +1081,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
ToastUtil.showDebug("Holders为空"); ToastUtil.showDebug("Holders为空");
return; return;
} }
switch (position) {
case 0:
//点击埋点
MobclickAgent.onEvent(mContext, "home_page", "首页");
break;
case 1:
MobclickAgent.onEvent(mContext, "community", "社区");
break;
case 2:
MobclickAgent.onEvent(mContext, "information", "消息");
break;
case 3:
MobclickAgent.onEvent(mContext, "my", "我的");
break;
}
AbsMainViewHolder vh = mViewHolders[position]; AbsMainViewHolder vh = mViewHolders[position];
if (vh == null) { if (vh == null) {
if (mViewList != null && position < mViewList.size()) { if (mViewList != null && position < mViewList.size()) {
@ -1079,15 +1106,20 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (position == 0) { if (position == 0) {
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent); mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
vh = mainHomeViewHolder; vh = mainHomeViewHolder;
} else if (position == 1) { } else if (position == 1) {
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区 mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区
vh = mMainHomeCommunityViewHolder; vh = mMainHomeCommunityViewHolder;
} else if (position == 2) { } else if (position == 2) {
mainMessageViewHolder = new MainMessageViewHolder(this, parent); mainMessageViewHolder = new MainMessageViewHolder(this, parent);
vh = mainMessageViewHolder; vh = mainMessageViewHolder;
} else if (position == 3) { } else if (position == 3) {
mMeViewHolder = new MainMeViewHolder(mContext, parent); mMeViewHolder = new MainMeViewHolder(mContext, parent);
vh = mMeViewHolder; vh = mMeViewHolder;
} }
if (vh == null) { if (vh == null) {
return; return;

View File

@ -20,6 +20,7 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity; import com.opensource.svgaplayer.SVGAVideoEntity;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.adapter.ViewPagerAdapter; import com.yunbao.common.adapter.ViewPagerAdapter;
@ -100,7 +101,7 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
MobclickAgent.onPageStart("MainListActivity");
} }
@Override @Override
@ -309,6 +310,11 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
public void onItemClick(ListBean bean, int position) { public void onItemClick(ListBean bean, int position) {
} }
@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPageEnd("MainListActivity");
}
} }

View File

@ -17,16 +17,17 @@ import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.CloseEvent; import com.yunbao.common.event.CloseEvent;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.manager.SearchHistoryRecordManager; import com.yunbao.common.manager.SearchHistoryRecordManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.WordsTypeUtil; import com.yunbao.common.utils.WordsTypeUtil;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.event.JumpUserHomeEvent; import com.yunbao.main.event.JumpUserHomeEvent;
import com.yunbao.main.fragment.SearchRecommendFragment; import com.yunbao.main.fragment.SearchRecommendFragment;
@ -220,4 +221,15 @@ public class SearchActivity extends AbsActivity {
} }
@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPageEnd("SearchActivity");
}
@Override
protected void onResume() {
super.onResume();
MobclickAgent.onPageStart("SearchActivity");
}
} }

View File

@ -29,6 +29,7 @@ import com.bumptech.glide.request.target.DrawableImageViewTarget;
import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.target.Target;
import com.ms.banner.Banner; import com.ms.banner.Banner;
import com.ms.banner.listener.OnBannerClickListener; import com.ms.banner.listener.OnBannerClickListener;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
@ -40,18 +41,18 @@ import com.yunbao.common.bean.LiveClassBean;
import com.yunbao.common.bean.WeekListBean; import com.yunbao.common.bean.WeekListBean;
import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.LiveClassManager; import com.yunbao.common.manager.LiveClassManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.CustomViewHolder; import com.yunbao.common.views.CustomViewHolder;
import com.yunbao.common.event.LiveRoomChangeEvent;
import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.live.utils.LiveStorge; import com.yunbao.live.utils.LiveStorge;
import com.yunbao.live.views.LiveRoomViewHolder; import com.yunbao.live.views.LiveRoomViewHolder;
import com.yunbao.main.R; import com.yunbao.main.R;
@ -289,6 +290,29 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
topAdapter.setOnItemClickListener(new OnItemClickListener<LiveClassBean>() { topAdapter.setOnItemClickListener(new OnItemClickListener<LiveClassBean>() {
@Override @Override
public void onItemClick(LiveClassBean bean, int position) { public void onItemClick(LiveClassBean bean, int position) {
switch (bean.getEnglish()) {
case "Hot":
MobclickAgent.onEvent(mContext, "home_page_recommend_hot", "热门");
break;
case "New":
MobclickAgent.onEvent(mContext, "home_page_recommend_new", "热门");
break;
case "Pretty":
MobclickAgent.onEvent(mContext, "home_page_recommend_pretty", "颜值");
break;
case "Dance":
MobclickAgent.onEvent(mContext, "home_page_recommend_dance", "舞蹈");
break;
case "Mr.Right":
MobclickAgent.onEvent(mContext, "home_page_recommend_mr.right", "男神");
break;
case "Music":
MobclickAgent.onEvent(mContext, "home_page_recommend_music", "音乐");
break;
default:
MobclickAgent.onEvent(mContext, "home_page_recommend_other", "其他");
break;
}
if (!canClick()) { if (!canClick()) {
return; return;
} }
@ -425,6 +449,11 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
} }
} }
showLoadingDialog(); showLoadingDialog();
Map<String, String> map_ekv = new HashMap<String, String>();
map_ekv.put("link", link);
MobclickAgent.onEvent(mContext, "ome_page_recommend_banner", map_ekv);
if (link.contains("http")) { if (link.contains("http")) {
WebViewActivity.forward(mContext, link, true, false); WebViewActivity.forward(mContext, link, true, false);
} else { } else {

View File

@ -5,6 +5,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.main.R; import com.yunbao.main.R;
@ -18,7 +19,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
private MainHomeLiveViewHolder mainHomeLiveViewHolder; private MainHomeLiveViewHolder mainHomeLiveViewHolder;
private MainHomeRecomLiveViewHolder mainHomeRecomLiveViewHolder; private MainHomeRecomLiveViewHolder mainHomeRecomLiveViewHolder;
private MainHomeRedPacketLiveViewHolder mainHomeRedPacketLiveViewHolder; private MainHomeRedPacketLiveViewHolder mainHomeRedPacketLiveViewHolder;
private final String mPageName = "home_page";
private ImageView img_trophy; private ImageView img_trophy;
public MainHomeViewHolder(Context context, ViewGroup parentView) { public MainHomeViewHolder(Context context, ViewGroup parentView) {
@ -37,9 +38,16 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
img_trophy = (ImageView) findViewById(R.id.img_trophy); img_trophy = (ImageView) findViewById(R.id.img_trophy);
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
MobclickAgent.onPageStart(mPageName);
} }
@Override
public void release() {
super.release();
MobclickAgent.onPageEnd(mPageName);
}
public void setCurPosition(int position) { public void setCurPosition(int position) {
mViewPager.setCurrentItem(position); mViewPager.setCurrentItem(position);
} }
@ -60,15 +68,19 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
} else if (position == 0) { } else if (position == 0) {
mainHomeFollLiveViewHolder = new MainHomeFollLiveViewHolder(mContext, parent); mainHomeFollLiveViewHolder = new MainHomeFollLiveViewHolder(mContext, parent);
vh = mainHomeFollLiveViewHolder; vh = mainHomeFollLiveViewHolder;
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
} else if (position == 1) { } else if (position == 1) {
mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent); mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);
vh = mainHomeLiveViewHolder; vh = mainHomeLiveViewHolder;
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
} else if (position == 2) { } else if (position == 2) {
mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent); mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent);
vh = mainHomeRecomLiveViewHolder; vh = mainHomeRecomLiveViewHolder;
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
} else if (position == 3) { } else if (position == 3) {
mainHomeRedPacketLiveViewHolder = new MainHomeRedPacketLiveViewHolder(mContext, parent); mainHomeRedPacketLiveViewHolder = new MainHomeRedPacketLiveViewHolder(mContext, parent);
vh = mainHomeRedPacketLiveViewHolder; vh = mainHomeRedPacketLiveViewHolder;
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
} }
if (vh == null) { if (vh == null) {