埋点配置
This commit is contained in:
parent
3de972d12c
commit
6bcaf2ba9c
@ -6,7 +6,8 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
<uses-permission
|
||||
android:name="android.permission.CHANGE_CONFIGURATION"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_LOGS"
|
||||
@ -81,12 +82,12 @@
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- Android11新增 -->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||
<queries>
|
||||
<package android:name="com.twitter.android"/>
|
||||
<package android:name="jp.naver.line.android"/>
|
||||
<package android:name="com.twitter.android" />
|
||||
<package android:name="jp.naver.line.android" />
|
||||
|
||||
</queries>
|
||||
<application
|
||||
@ -95,30 +96,30 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </service>-->
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.shayu.phonelive.utils.MyNotificationService">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </service>-->
|
||||
<service
|
||||
android:name="io.rong.push.platform.google.RongFirebaseMessagingService"
|
||||
android:stopWithTask="false"
|
||||
android:exported="false">
|
||||
android:exported="false"
|
||||
android:stopWithTask="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity"
|
||||
android:exported="true">
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -130,7 +131,8 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data android:scheme="smvslm" />
|
||||
|
||||
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@ -162,13 +164,16 @@
|
||||
<meta-data
|
||||
android:name="com.facebook.sdk.ClientToken"
|
||||
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
|
||||
android:name="firebase_messaging_auto_init_enabled"
|
||||
android:value="false" />
|
||||
<meta-data
|
||||
android:name="firebase_analytics_collection_enabled"
|
||||
android:value="false" />
|
||||
|
||||
<receiver
|
||||
android:name="com.shayu.phonelive.utils.CustomMessageReceiver"
|
||||
android:exported="true">
|
||||
@ -186,12 +191,12 @@
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||
<!-- android:value="106936673"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.cpid"-->
|
||||
<!-- android:value="30086000612391734"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||
<!-- android:value="106936673"/>-->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.huawei.hms.client.cpid"-->
|
||||
<!-- android:value="30086000612391734"/>-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -32,6 +32,8 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
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.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@ -163,7 +165,23 @@ public class AppContext extends CommonAppContext {
|
||||
if (isMainProcess()) {
|
||||
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());
|
||||
//初始化 AndroidUtilCode
|
||||
|
@ -197,6 +197,7 @@ dependencies {
|
||||
//自定义圆角图片
|
||||
api 'com.makeramen:roundedimageview:2.3.0'
|
||||
// 友盟统计SDK
|
||||
implementation 'com.umeng.umsdk:common:9.6.3'// 必选
|
||||
implementation 'com.umeng.umsdk:asms:1.8.0'// 必选
|
||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
||||
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
||||
api 'com.umeng.umsdk:uyumao:1.1.2' //高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
@ -296,6 +297,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MobclickAgent.onPageStart("WebViewActivity");
|
||||
if (Constants.myIntoIndex == 2 && mWebView != null && indexInto == 1) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
mWebView.post(new Runnable() {
|
||||
@ -330,6 +332,7 @@ public class WebViewActivity extends AbsActivity {
|
||||
if (Constants.isShowPage != -1) {
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@ -434,4 +437,11 @@ public class WebViewActivity extends AbsActivity {
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
MobclickAgent.onPageEnd("WebViewActivity");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
@ -301,6 +302,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
* @param model
|
||||
*/
|
||||
public void setupLoginUser(@NonNull IMLoginModel model) {
|
||||
//当用户使用自有账号登录时,可以这样统计:
|
||||
MobclickAgent.onProfileSignIn(String.valueOf(model.getId()));
|
||||
this.userInfo = model;
|
||||
if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
|
||||
token = userInfo.getToken();
|
||||
@ -425,6 +428,8 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
// IMCenter.getInstance().clearConversations(null, Conversation.ConversationType.PRIVATE);
|
||||
RongcloudIMManager.logoutIM();
|
||||
MessageIMManager.get(activity).logout();
|
||||
//登出
|
||||
MobclickAgent.onProfileSignOff();
|
||||
put(IS_HINT, 0);
|
||||
APPEasyFloat.getInstance().dismiss(activity);
|
||||
if (EasyFloat.isShow("LiveFloatView")) {
|
||||
|
@ -52,6 +52,7 @@ import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKConfig;
|
||||
import com.tencent.imsdk.v2.V2TIMSDKListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
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.CommonHttpUtil;
|
||||
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.interfaces.CommonCallback;
|
||||
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.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.LocationUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
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.weight.LiveFloatView;
|
||||
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.main.R;
|
||||
import com.yunbao.main.adapter.FullAdToBannerTransition;
|
||||
@ -206,6 +207,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
ActivityCompat.postponeEnterTransition(this);
|
||||
@ -279,7 +286,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
|
||||
} else if (getIntent().getStringExtra("type") != null && getIntent().getStringExtra("type").equals("8")) {
|
||||
WebViewActivity.forward(mContext, getIntent().getStringExtra("activityUrl"), true,false);
|
||||
WebViewActivity.forward(mContext, getIntent().getStringExtra("activityUrl"), true, false);
|
||||
}
|
||||
FirebaseMessaging.getInstance().getToken()
|
||||
.addOnCompleteListener(new OnCompleteListener<String>() {
|
||||
@ -327,6 +334,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
||||
if (mTabButtonGroup.getCurPosition() != position) {
|
||||
System.err.println("重连IM:" + IMLoginManager.isLogin(mContext));
|
||||
if (!IMLoginManager.isLogin(mContext)) {
|
||||
@ -708,11 +716,15 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
showStartDialog();
|
||||
} else if (i == R.id.btn_search) {
|
||||
SearchActivity.forward(mContext);
|
||||
|
||||
MobclickAgent.onEvent(mContext, "home_page_search", "右上角搜索按钮");
|
||||
|
||||
} else if (i == R.id.btn_follow) {
|
||||
//关注
|
||||
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0);
|
||||
} else if (i == R.id.img_trophy) {
|
||||
MainListActivity.forward(mContext, 0);
|
||||
MobclickAgent.onEvent(mContext, "home_page_ranking", "右上角排行榜按钮");
|
||||
//RandomPkDialogFragment fragment = new RandomPkDialogFragment();
|
||||
//fragment.show(this.getSupportFragmentManager(), "RandomPkDialogFragment");
|
||||
}
|
||||
@ -847,6 +859,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
NoviceInstructorManager.get(mContext).getNoviceInstructor();
|
||||
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
|
||||
initAnchorRecommendBanner();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1068,7 +1081,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
ToastUtil.showDebug("Holders为空");
|
||||
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];
|
||||
if (vh == null) {
|
||||
if (mViewList != null && position < mViewList.size()) {
|
||||
@ -1079,15 +1106,20 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
if (position == 0) {
|
||||
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);
|
||||
vh = mainHomeViewHolder;
|
||||
|
||||
} else if (position == 1) {
|
||||
mMainHomeCommunityViewHolder = new MainHomeCommunityViewHolder(mContext, parent, this);//社区
|
||||
vh = mMainHomeCommunityViewHolder;
|
||||
|
||||
} else if (position == 2) {
|
||||
mainMessageViewHolder = new MainMessageViewHolder(this, parent);
|
||||
vh = mainMessageViewHolder;
|
||||
|
||||
|
||||
} else if (position == 3) {
|
||||
mMeViewHolder = new MainMeViewHolder(mContext, parent);
|
||||
vh = mMeViewHolder;
|
||||
|
||||
}
|
||||
if (vh == null) {
|
||||
return;
|
||||
|
@ -20,6 +20,7 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.adapter.ViewPagerAdapter;
|
||||
@ -100,7 +101,7 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
MobclickAgent.onPageStart("MainListActivity");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -309,6 +310,11 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener
|
||||
public void onItemClick(ListBean bean, int position) {
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
MobclickAgent.onPageEnd("MainListActivity");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -17,16 +17,17 @@ import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.event.CloseEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.SearchHistoryRecordManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
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.event.JumpUserHomeEvent;
|
||||
import com.yunbao.main.fragment.SearchRecommendFragment;
|
||||
@ -176,7 +177,7 @@ public class SearchActivity extends AbsActivity {
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import com.bumptech.glide.request.target.DrawableImageViewTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.ms.banner.Banner;
|
||||
import com.ms.banner.listener.OnBannerClickListener;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
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.custom.CommonRefreshView;
|
||||
import com.yunbao.common.custom.ItemDecoration;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.LiveClassManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
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.views.LiveRoomViewHolder;
|
||||
import com.yunbao.main.R;
|
||||
@ -289,6 +290,29 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
topAdapter.setOnItemClickListener(new OnItemClickListener<LiveClassBean>() {
|
||||
@Override
|
||||
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()) {
|
||||
return;
|
||||
}
|
||||
@ -340,19 +364,19 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
return false;
|
||||
}
|
||||
})
|
||||
/* .addListener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
||||
ActivityCompat.startPostponedEnterTransition((Activity) mContext);
|
||||
return false;
|
||||
}
|
||||
/* .addListener(new RequestListener<Drawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
|
||||
ActivityCompat.startPostponedEnterTransition((Activity) mContext);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
||||
ActivityCompat.startPostponedEnterTransition((Activity) mContext);
|
||||
return false;
|
||||
}
|
||||
})*/
|
||||
@Override
|
||||
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
|
||||
ActivityCompat.startPostponedEnterTransition((Activity) mContext);
|
||||
return false;
|
||||
}
|
||||
})*/
|
||||
.error(R.mipmap.ic_launcher)
|
||||
.into(new DrawableImageViewTarget(ad));
|
||||
|
||||
@ -425,8 +449,13 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
}
|
||||
}
|
||||
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")) {
|
||||
WebViewActivity.forward(mContext, link, true,false);
|
||||
WebViewActivity.forward(mContext, link, true, false);
|
||||
} else {
|
||||
gotoLive(link);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.main.R;
|
||||
|
||||
@ -18,7 +19,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
private MainHomeLiveViewHolder mainHomeLiveViewHolder;
|
||||
private MainHomeRecomLiveViewHolder mainHomeRecomLiveViewHolder;
|
||||
private MainHomeRedPacketLiveViewHolder mainHomeRedPacketLiveViewHolder;
|
||||
|
||||
private final String mPageName = "home_page";
|
||||
private ImageView img_trophy;
|
||||
|
||||
public MainHomeViewHolder(Context context, ViewGroup parentView) {
|
||||
@ -37,10 +38,17 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
||||
|
||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||
|
||||
MobclickAgent.onPageStart(mPageName);
|
||||
|
||||
}
|
||||
public void setCurPosition(int position){
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
super.release();
|
||||
MobclickAgent.onPageEnd(mPageName);
|
||||
}
|
||||
|
||||
public void setCurPosition(int position) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
|
||||
@ -60,15 +68,19 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
} else if (position == 0) {
|
||||
mainHomeFollLiveViewHolder = new MainHomeFollLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeFollLiveViewHolder;
|
||||
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
|
||||
} else if (position == 1) {
|
||||
mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeLiveViewHolder;
|
||||
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
|
||||
} else if (position == 2) {
|
||||
mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeRecomLiveViewHolder;
|
||||
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
|
||||
} else if (position == 3) {
|
||||
mainHomeRedPacketLiveViewHolder = new MainHomeRedPacketLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeRedPacketLiveViewHolder;
|
||||
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
|
||||
}
|
||||
|
||||
if (vh == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user