From 3de972d12c7193c258d0bd0abd3036c08af50b86 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 22 Aug 2023 14:03:04 +0800 Subject: [PATCH 01/11] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 14 ++++++++++++++ build.gradle | 2 ++ common/build.gradle | 3 +++ 3 files changed, 19 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index bb48ad393..a2a939a1e 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -235,4 +235,18 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; } -keep class com.faceunity.wrapper.faceunity$LoadConfig*{ private static boolean sLoadedLibrary; +} +-keep class com.umeng.** {*;} + +-keep class org.repackage.** {*;} + +-keep class com.uyumao.** { *; } + +-keepclassmembers class * { + public (org.json.JSONObject); +} + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7d45ccc5a..412a03df4 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ buildscript { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.fabric.io/public' } maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库 + maven { url 'https://repo1.maven.org/maven2/' }//埋点 google() mavenCentral() } @@ -41,6 +42,7 @@ allprojects { maven { url 'https://maven.fabric.io/public' } maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库 maven { url "https://jitpack.io" } + maven { url 'https://repo1.maven.org/maven2/' }//埋点 google() // Google's Maven repository } } diff --git a/common/build.gradle b/common/build.gradle index 19700ba89..680e2065e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -196,4 +196,7 @@ dependencies { api 'com.github.gzu-liyujiang.AndroidPicker:WheelView:4.1.11' //自定义圆角图片 api 'com.makeramen:roundedimageview:2.3.0' + // 友盟统计SDK + implementation 'com.umeng.umsdk:common:9.6.3'// 必选 + implementation 'com.umeng.umsdk:asms:1.8.0'// 必选 } From 6bcaf2ba9c355ab7bd05fc2024c22b6d6b8f85a0 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 23 Aug 2023 15:05:32 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 55 +++++++++-------- .../java/com/shayu/phonelive/AppContext.java | 18 ++++++ common/build.gradle | 5 +- .../common/activity/WebViewActivity.java | 10 +++ .../yunbao/common/manager/IMLoginManager.java | 5 ++ .../yunbao/main/activity/MainActivity.java | 42 +++++++++++-- .../main/activity/MainListActivity.java | 8 ++- .../yunbao/main/activity/SearchActivity.java | 18 +++++- .../main/views/MainHomeLiveViewHolder.java | 61 ++++++++++++++----- .../yunbao/main/views/MainHomeViewHolder.java | 18 +++++- 10 files changed, 185 insertions(+), 55 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c6e47c1a3..b26c0e300 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,7 +6,8 @@ - - - + + - - + + - - - - - - + + + + + + + android:exported="false" + android:stopWithTask="false"> - + + tools:ignore="LockedOrientationActivity"> @@ -130,7 +131,8 @@ - + + @@ -162,13 +164,16 @@ - + + @@ -186,12 +191,12 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index b2674d02c..2dc5f808d 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -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 diff --git a/common/build.gradle b/common/build.gradle index 680e2065e..40486453e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -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及以上版本。需更新隐私声明。 } diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index efa509052..80cbad69f 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -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"); + } + + } diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index baa0d2a74..8b8fb66d0 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -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")) { diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index b14376874..1d5ae4a6d 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -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() { @@ -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; diff --git a/main/src/main/java/com/yunbao/main/activity/MainListActivity.java b/main/src/main/java/com/yunbao/main/activity/MainListActivity.java index d90c7a479..636b0b161 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainListActivity.java @@ -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"); + } } \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java index 31f7a975a..1fb2728f1 100644 --- a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java @@ -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"); + } } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index f6fe2b2d1..3efa1ca7d 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -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() { @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() { - @Override - public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { - ActivityCompat.startPostponedEnterTransition((Activity) mContext); - return false; - } + /* .addListener(new RequestListener() { + @Override + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { + ActivityCompat.startPostponedEnterTransition((Activity) mContext); + return false; + } - @Override - public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { - ActivityCompat.startPostponedEnterTransition((Activity) mContext); - return false; - } - })*/ + @Override + public boolean onResourceReady(Drawable resource, Object model, Target 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 map_ekv = new HashMap(); + 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); } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 551d97f44..57c5aee1d 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -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) { From bebf0820ca319d0f8a7218d81d2ec7a64c44a25d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 25 Aug 2023 15:12:48 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/activity/AbsActivity.java | 6 ++ .../common/activity/WebViewActivity.java | 2 - .../common/views/FunGamesViewHolder.java | 6 ++ config.gradle | 4 +- .../live/activity/LiveAudienceActivity.java | 2 + .../yunbao/live/adapter/GiftTitleAdapter.java | 2 +- .../yunbao/live/adapter/LiveChatAdapter.java | 2 + .../yunbao/live/dialog/BlowkissDialog.java | 2 + .../LiveContactDetailsSendGiftDialog.java | 3 + .../com/yunbao/live/dialog/LiveGiftPopup.java | 20 ++++- .../live/dialog/LiveInputDialogFragment.java | 6 ++ .../live/dialog/LiveUserDialogFragment.java | 38 +++++++++- .../live/dialog/SendRendPacketPopup.java | 11 ++- .../yunbao/live/views/AbsLiveViewHolder.java | 3 + .../live/views/FrameGiftViewHolder.java | 2 + .../live/views/GiftTitleViewHolder.java | 28 ++++++- .../live/views/LiveAudienceViewHolder.java | 5 ++ .../yunbao/live/views/LiveGiftFragment.java | 2 + .../yunbao/live/views/LiveRoomViewHolder.java | 73 +++++++++++++++---- .../live/views/PortraitLiveManager.java | 2 + .../yunbao/main/activity/MainActivity.java | 2 + .../main/activity/MainListActivity.java | 2 - .../main/activity/MyWalletActivity.java | 8 ++ .../main/activity/MyWebViewActivity.java | 6 ++ .../yunbao/main/activity/SearchActivity.java | 2 - .../main/dialog/MainStartDialogFragment.java | 3 + .../main/views/MainHomeLiveViewHolder.java | 2 +- .../yunbao/main/views/MainMeViewHolder.java | 36 +++++++++ .../main/views/MainMessageViewHolder.java | 5 ++ .../activity/AbsVideoCommentActivity.java | 11 +++ .../video/activity/AbsVideoPlayActivity.java | 4 + .../video/views/VideoScrollViewHolder.java | 2 + 32 files changed, 270 insertions(+), 32 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java index bf17f603a..85d72da90 100644 --- a/common/src/main/java/com/yunbao/common/activity/AbsActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/AbsActivity.java @@ -24,6 +24,7 @@ import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.R; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.LifeCycleListener; @@ -178,11 +179,15 @@ public abstract class AbsActivity extends AppCompatActivity { } //友盟统计 // MobclickAgent.onResume(this); + MobclickAgent.onPageStart(this.mTag); + Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag); } @Override protected void onPause() { super.onPause(); + MobclickAgent.onPageEnd(this.mTag); + Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag); if (mLifeCycleListeners != null) { for (LifeCycleListener listener : mLifeCycleListeners) { listener.onPause(); @@ -376,4 +381,5 @@ public abstract class AbsActivity extends AppCompatActivity { break; } } + } diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index 80cbad69f..7bc055371 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -297,7 +297,6 @@ 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() { @@ -440,7 +439,6 @@ public class WebViewActivity extends AbsActivity { @Override protected void onPause() { super.onPause(); - MobclickAgent.onPageEnd("WebViewActivity"); } diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java index 9534274c4..8c07a5a8d 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java @@ -9,6 +9,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.adapter.FunGamesAdapter; @@ -22,7 +23,9 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class FunGamesViewHolder extends RecyclerView.ViewHolder { private FunGamesAdapter funGamesAdapter; @@ -76,6 +79,9 @@ public class FunGamesViewHolder extends RecyclerView.ViewHolder { .append("&token=") .append(userInfo.getToken()); } + Map map_ekv = new HashMap(); + map_ekv.put("link", htmlUrl.toString()); + MobclickAgent.onEvent(itemView.getContext(), "live_room_slide", map_ekv); Bus.get().post(new CustomDrawerPopupEvent() .setDisMiss(true) .setHtmlUrl(htmlUrl.toString()) diff --git a/config.gradle b/config.gradle index 5f3bc3427..08d317359 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 -// serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", // 测试 - serverHost : " https://ceshi.yaoulive.com", +// serverHost : " https://ceshi.yaoulive.com", diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index b21768400..06d6ddc5d 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -37,6 +37,7 @@ import com.lxj.xpopup.core.BasePopupView; import com.lxj.xpopup.enums.PopupPosition; import com.lxj.xpopup.interfaces.XPopupCallback; import com.lzf.easyfloat.EasyFloat; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; @@ -551,6 +552,7 @@ public class LiveAudienceActivity extends LiveActivity { @Override public void onBackPressed() { + MobclickAgent.onEvent(mContext, "live_room_close", "退出直播间"); try { manager.onBackPressed(); if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) { diff --git a/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java index 898b9da7c..6f4993c91 100644 --- a/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/GiftTitleAdapter.java @@ -39,7 +39,7 @@ public class GiftTitleAdapter extends RecyclerView.Adapter { notifyDataSetChanged(); } }); - itemViewHolder.selectData(index == position); + itemViewHolder.selectData(index == position,name.get(position).getName()); } @Override diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 98a0245a9..87ff13b0d 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -39,6 +39,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.makeramen.roundedimageview.RoundedImageView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.IMLoginModel; @@ -158,6 +159,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { Log.i(TAG, "onScrolled: " + dy); mRecyclerViewScrolledDy = dy; isBottom = false; + MobclickAgent.onEvent(mContext, "live_room_chat_list", "滑动直播间聊天列表"); } @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/BlowkissDialog.java b/live/src/main/java/com/yunbao/live/dialog/BlowkissDialog.java index d1820c72d..97e0459c3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/BlowkissDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/BlowkissDialog.java @@ -13,6 +13,7 @@ import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.ToastUtil; @@ -135,6 +136,7 @@ public class BlowkissDialog extends AbsDialogFragment { btn_confirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + MobclickAgent.onEvent(mContext, "live_room_follow_sendgif", "弹的关注并送礼的按钮"); follow(); LiveHttpUtil.sendGift("0", mLiveUid, LiveActivity.mStream, gif_id, "1", new HttpCallback() { @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveContactDetailsSendGiftDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveContactDetailsSendGiftDialog.java index 46ea9c940..a0ea8c6ca 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveContactDetailsSendGiftDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveContactDetailsSendGiftDialog.java @@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.lxj.xpopup.XPopup; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.glide.ImgLoader; @@ -148,6 +149,7 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow { } private void send() { + MobclickAgent.onEvent(mContext, "contact_obtain", "点获取联系方式"); LiveHttpUtil.sendGift("0", mLiveUid, mStream, bean.getId(), "1", 1, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -164,6 +166,7 @@ public class LiveContactDetailsSendGiftDialog extends AbsDialogPopupWindow { } }).build().show(); } else { + MobclickAgent.onEvent(mContext, "contact_obtain_send_gif", "送出联系方式礼物"); dismiss(); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index f8623d2d3..2be645be7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -39,6 +39,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.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.R; @@ -55,6 +56,7 @@ import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.AppManager; @@ -79,7 +81,6 @@ import com.yunbao.live.event.GiftTitleEvent; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveGiftItemEvent; import com.yunbao.live.event.LiveParcelItemRefreshEvent; -import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.live.views.LiveGiftFragment; import com.yunbao.live.views.LiveParcelFragment; @@ -203,6 +204,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_pack_list", "用户点礼物栏包裹礼物按钮"); giftTitleAdapter.uncheck(); liveWrap.setAlpha(1.0f); liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); @@ -217,6 +219,8 @@ public class LiveGiftPopup extends AbsDialogFragment { mBtnSendGroup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + + MobclickAgent.onEvent(mContext, "gif_list_seed_gif", "用户送礼物"); sendGiftHandler.post(sendGiftRunnble); } }); @@ -225,6 +229,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(liveGiftSend, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_seed_gif", "用户送礼物"); sendGiftHandler.post(sendGiftRunnble); } @@ -233,6 +238,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.diamond_linear), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_recharge_list", "用户点礼物栏充值按钮"); forwardMyCoin(0); } }); @@ -247,6 +253,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(description, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_blind_box_info", "用户点开礼物列表盲盒页面的盲盒说明"); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); htmlUrl.append(CommonAppConfig.HOST) @@ -267,6 +274,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_luck_gift_tip), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_opened_noble", "用户点击开通贵族"); dismiss(); ((LiveActivity) mContext).openLuckGiftTip(); } @@ -275,6 +283,7 @@ public class LiveGiftPopup extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.leveling_layout), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "gif_list_grade", "用户点击等级页面"); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); htmlUrl.append(CommonAppConfig.HOST) @@ -460,7 +469,7 @@ public class LiveGiftPopup extends AbsDialogFragment { int nextLeve = Integer.parseInt(coinModel.getUserNextLevelRewards()); - BigDecimal maxLeve = new BigDecimal(coinModel.getUserLevelUpgrades()).add( new BigDecimal(coinModel.getUserLevelCurrentConsumption())); + BigDecimal maxLeve = new BigDecimal(coinModel.getUserLevelUpgrades()).add(new BigDecimal(coinModel.getUserLevelCurrentConsumption())); try { String leveNext = String.valueOf(nextLeve); String userNextLevel = coinModel.getUserLevelUpgrades(); @@ -527,6 +536,9 @@ public class LiveGiftPopup extends AbsDialogFragment { */ public void sendGift() { if (liveGiftModel == null) return; + if (liveGiftModel.getType() == 7) { + MobclickAgent.onEvent(mContext, "gif_list_blind_box_seed", "用户发送盲盒"); + } if (liveGiftModel.getTag() != null) { if (mCount.equals("1")) { LiveHttpUtil.setFrontTask("sendgift", mLiveUid, new HttpCallback() { @@ -731,6 +743,7 @@ public class LiveGiftPopup extends AbsDialogFragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onLiveGiftItemEvent(LiveGiftItemEvent event) { liveGiftModel = event.getLiveGiftModel(); + MobclickAgent.onEvent(mContext, "gif_list_choose", "用户选中某个礼物:" + liveGiftModel.getName()); if (!TextUtils.isEmpty(liveGiftModel.getNamingLiveuid()) && !TextUtils.isEmpty(liveGiftModel.getNamingUid()) && @@ -759,6 +772,7 @@ public class LiveGiftPopup extends AbsDialogFragment { } if (liveGiftModel.getType() == 7) { + MobclickAgent.onEvent(mContext, "gif_list_blind_box", "用户点开礼物列表盲盒"); iconArrow.setVisibility(View.GONE); showBlindProgress(liveGiftModel.getBlind_box_type()); } else { @@ -1231,6 +1245,8 @@ public class LiveGiftPopup extends AbsDialogFragment { @Override public void onConfirmClick(Dialog dialog, String content) { forwardMyCoin(0); + + MobclickAgent.onEvent(mContext, "user_to_recharge", "app内任意提示用户余额不足 用户充值点了提示里面的去充值"); } }).build().show(); } else { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 265dfb616..266ecd941 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -27,6 +27,7 @@ import android.widget.RadioGroup; import androidx.fragment.app.FragmentActivity; import com.blankj.utilcode.util.GsonUtils; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.Constants; import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.NobleTrumpetModel; @@ -143,6 +144,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onTextChanged(CharSequence s, int start, int before, int count) { + MobclickAgent.onEvent(mContext, "chat_btn_enter", "用户输入文字"); if (s.length() == 0) { mMyRadioButton.doChecked(false); } else { @@ -190,6 +192,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O ViewClicksAntiShake.clicksAntiShake(mRootView.findViewById(R.id.ai_te), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "chat_btn_at", "用户点聊天框上的艾特"); Intent intent = new Intent(getActivity(), OlineListActivity.class); intent.putExtra("liveID", mLiveUid); intent.putExtra("stream", bundle.getString(Constants.LIVE_STREAM)); @@ -211,6 +214,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O @Override public void onClick(View v) { + MobclickAgent.onEvent(mContext, "chat_btn_seed_msg", "用户点发送按钮"); sendMessage(); } @@ -318,10 +322,12 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O mInput.setHint(mHint2); messageType = SendMessageType.GENERALMESSAGE; } else if (radioButton.getId() == R.id.btn_1) { + MobclickAgent.onEvent(mContext, "chat_btn_wind", "用户点输入框上飘屏按钮"); radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(popupScreenP, null, null, null); mInput.setHint(mHint1); messageType = SendMessageType.POPUPSCREEN; } else { + MobclickAgent.onEvent(mContext, "chat_btn_trumpet", "用户点输入框上全站喇叭按钮"); radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(worldHornP, null, null, null); mInput.setHint(String.format(mContext.getString(R.string.whole_station_horn_hint), trumpetNum + "")); messageType = SendMessageType.WORLDHORN; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index f9786a208..e6d3ebaa7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -24,6 +24,7 @@ import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMManager; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.FansModel; @@ -32,14 +33,17 @@ import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.OlineUserlistModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.NewLevelManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.NobleUtil; import com.yunbao.common.utils.RouteUtil; @@ -52,9 +56,6 @@ import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.event.LiveRoomChangeEvent; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.live.utils.LiveTextRender; import org.greenrobot.eventbus.EventBus; @@ -249,7 +250,18 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On mLvVal = mRootView.findViewById(R.id.user_card_lv_val); mNobleIconLayout.setOnClickListener(this); mSetting.setOnClickListener(this); - mHonorLayout.setOnClickListener(v -> forwardHomePage()); + mHonorLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (!isAnchor) { + MobclickAgent.onEvent(mContext, "user_avatar_honor", "荣誉墙按钮"); + } else { + + MobclickAgent.onEvent(mContext, "anchor_avatar_honor", "主播荣誉墙"); + } + forwardHomePage(); + } + }); //用户名片连点三次粉丝弹出视频debug窗 /*mFansVal.setOnClickListener(new View.OnClickListener() { @@ -610,6 +622,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On * 跳转到个人主页 */ private void forwardHomePage() { + dismiss(); Constants.mStream = mStream; RouteUtil.forwardUserHome(mContext, mToUid, true, mLiveUid, 0); @@ -702,14 +715,30 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On public void onClick(View v) { int i = v.getId(); if (i == R.id.btn_follow) { + if (isAnchor) { + + MobclickAgent.onEvent(mContext, "anchor_avatar_follow", "点关注主播"); + } else { + + MobclickAgent.onEvent(mContext, "user_avatar_follow", "点关注用户"); + } setAttention(); } else if (i == R.id.btn_home_page) { + if (isAnchor) { + MobclickAgent.onEvent(mContext, "anchor_avatar_index", "点主播主页"); + } else { + MobclickAgent.onEvent(mContext, "user_avatar_index", "主页按钮"); + } forwardHomePage(); } else if (i == R.id.btn_report) { report(); } else if (i == R.id.avatar) { + if (isAnchor) { + MobclickAgent.onEvent(mContext, "anchor_avatar_btn", "点主播头像"); + } forwardHomePage(); } else if (i == R.id.btn_guard) { + MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮"); ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity, mToUid); } else if (i == R.id.btn_live) { gotoLive(mToUid); @@ -718,6 +747,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On dismiss(); ((LiveActivity) mContext).openFansWindow(mToUid); } else { + MobclickAgent.onEvent(mContext, "user_avatar_noble", "贵族按钮"); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.NOBLE)); } diff --git a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java index 3d2dd2c5a..54412f364 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/SendRendPacketPopup.java @@ -16,6 +16,7 @@ import androidx.annotation.NonNull; import com.alibaba.android.arouter.launcher.ARouter; import com.lxj.xpopup.core.CenterPopupView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; @@ -156,7 +157,13 @@ public class SendRendPacketPopup extends CenterPopupView { //红包初始数量 rill.setText("200"); total.setText("10"); - ViewClicksAntiShake.clicksAntiShake(iconInstructions, () -> redPacketIllustrate.setVisibility(VISIBLE)); + ViewClicksAntiShake.clicksAntiShake(iconInstructions, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + MobclickAgent.onEvent(getContext(), "gif_list_redpk_info", "用户点开礼物列表红包页面的红包说明"); + redPacketIllustrate.setVisibility(VISIBLE); + } + }); ViewClicksAntiShake.clicksAntiShake(illustrateClose, () -> redPacketIllustrate.setVisibility(GONE)); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.top_up_now), () -> { //我们的 @@ -201,6 +208,8 @@ public class SendRendPacketPopup extends CenterPopupView { conditions, new HttpCallback() { @Override public void onSuccess(String data) { + + MobclickAgent.onEvent(getContext(), "gif_list_redpk_seed", "用户发送红包"); ToastUtil.show(getContext().getString(R.string.red_envelope_released_successfully)); dismiss(); } diff --git a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java index 16b57fd00..4b22131a8 100644 --- a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java @@ -5,6 +5,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; @@ -37,8 +38,10 @@ public abstract class AbsLiveViewHolder extends AbsViewHolder implements View.On public void onClick(View v) { int i = v.getId(); if (i == R.id.btn_msg) { + MobclickAgent.onEvent(mContext, "live_room_envelope", "直播间信封按钮"); ((LiveActivity) mContext).openChatListWindow(); } else if (i == R.id.et_input) { + MobclickAgent.onEvent(mContext, "live_room_chat_btn", "直播间点开最下面的聊天按钮"); ((LiveActivity) mContext).openChatWindow(); } } diff --git a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java index 1c205691e..6d1cb9785 100644 --- a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java @@ -19,6 +19,7 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.glide.ImgLoader; @@ -150,6 +151,7 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { @Override public void onViewClicks() { if (model.getType() == 9999999) { + MobclickAgent.onEvent(mContext, "gif_list_redpk", "用户点开礼物列表红包"); Bus.get().post(new LiveGiftDialogEvent()); new XPopup.Builder(mContext) .asCustom(new SendRendPacketPopup(mContext, mLiveUid)) diff --git a/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java b/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java index d0732f450..4e4e54406 100644 --- a/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/GiftTitleViewHolder.java @@ -6,6 +6,7 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.custom.DrawableTextView; import com.yunbao.common.utils.Bus; import com.yunbao.common.views.weight.ViewClicksAntiShake; @@ -34,8 +35,33 @@ public class GiftTitleViewHolder extends RecyclerView.ViewHolder { }); } - public void selectData(boolean isSelect) { + public void selectData(boolean isSelect, String typeName) { if (isSelect) { + switch (typeName) { + case "熱門": + case "Hot": + MobclickAgent.onEvent(itemView.getContext(), "gif_list_hot_list", "用户点礼物栏热门礼物按钮"); + break; + case "貴族": + case "Aristocrats": + MobclickAgent.onEvent(itemView.getContext(), "gif_list_noble_list", "用户点礼物栏贵族礼物按钮"); + break; + case "守護": + case "Guard": + MobclickAgent.onEvent(itemView.getContext(), "gif_list_guard_list", "用户点礼物栏守护礼物按钮"); + break; + case "粉絲團": + case "Fans": + MobclickAgent.onEvent(itemView.getContext(), "gif_list_fan_list", "用户点礼物栏粉丝团礼物按钮"); + break; + case "專屬": + case "exclusive": + MobclickAgent.onEvent(itemView.getContext(), "gif_list_exclusive_list", "用户点礼物栏专属礼物按钮"); + break; + default: + MobclickAgent.onEvent(itemView.getContext(), "gif_list_other_list", "用户点礼物栏其他新配置的礼物分类按钮:"+typeName); + break; + } name.setAlpha(1.0f); name.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); } else { diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index e71075a0a..53ada05c8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -25,6 +25,7 @@ import android.widget.ViewFlipper; import androidx.fragment.app.FragmentActivity; import com.lxj.xpopup.XPopup; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.NewPeopleInfo; @@ -161,6 +162,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.total_image), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "live_room_more_sett", "直播间侧边栏更多设置"); Bus.get().post(new LiveAudienceEvent() .setActivity(false) .setType(LiveAudienceEvent.LiveAudienceType.BOTTOM_COLLECTION)); @@ -181,6 +183,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_cheat), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "live_room_h5_game", "直播间任意点用户头像"); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.WE_CHEAT)); @@ -206,6 +209,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { // ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_cheat : R.mipmap.live_icon_cheat_en, mCheat); voiceButton.setOnTouchListener((v, event) -> { + MobclickAgent.onEvent(mContext, "live_room_voice_chat_btn", "直播间点开最下面的语音输入的聊天按钮"); if (event.getAction() == MotionEvent.ACTION_DOWN) { downY = event.getY(); if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) { @@ -384,6 +388,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } else if (i == R.id.live_new_people) { openNewPeopleDialog(); } else if (i == R.id.live_privilege) { + MobclickAgent.onEvent(mContext, "live_room_privilege", "直播间下面打开皇冠按钮"); openRoleDialog(); } else if (i == R.id.live_cheat) { diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java index 6c6103bee..5740c41ea 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java @@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; import com.alibaba.fastjson.JSON; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.fragment.BaseFragment; import com.yunbao.live.R; @@ -117,6 +118,7 @@ public class LiveGiftFragment extends BaseFragment { @Override public void onPageSelected(int position) { + MobclickAgent.onEvent(getContext(), "gif_list_slide", "用户左右滑动礼物列表"); if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) { ((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 4e780859d..d104e8de4 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -60,6 +60,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.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; @@ -96,11 +97,14 @@ import com.yunbao.common.bean.XydCompleteModel; import com.yunbao.common.event.AllServerNotifyEvent; import com.yunbao.common.event.AnchorInfoEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.API; 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.live.LiveNetManager; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.OnItemClickListener; @@ -111,6 +115,7 @@ import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; @@ -162,14 +167,10 @@ import com.yunbao.live.dialog.ReceiveRendPacketPopup; import com.yunbao.live.dialog.ResultRendPacketPopup; import com.yunbao.live.event.LiveAnchorEvent; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.event.LiveRoomChangeEvent; -import com.yunbao.common.http.LiveHttpConsts; -import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveDanmuPresenter; import com.yunbao.live.presenter.LiveEnterRoomAnimPresenter; import com.yunbao.live.presenter.LiveGiftAnimPresenter; import com.yunbao.live.presenter.LiveLightAnimPresenter; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.live.utils.LiveRoomVoteManager; import com.yunbao.live.utils.LiveTextRender; import com.yunbao.live.utils.LoadDian9TuUtil; @@ -182,8 +183,10 @@ import java.lang.ref.WeakReference; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; @@ -886,7 +889,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mAnchorSayImage = (ImageView) findViewById(R.id.anchor_say_icon); mAnchorSayText = (TextView) findViewById(R.id.anchor_say_text); mAnchorSayHide = (ImageView) findViewById(R.id.anchor_say_hide); - mAnchorSayHide.setOnClickListener(v -> hideAnchorSay()); + mAnchorSayHide.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮"); + hideAnchorSay(); + } + }); + mAnchorSay.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮"); + + } + }); svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif); svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double); svga_new_user_follow = (SVGAImageView) findViewById(R.id.svga_new_user_follow); @@ -1765,6 +1781,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis StringBuffer htmlUrl = new StringBuffer(); //判断是否是星级活动 if (bean.isStart()) { + + type = bean.getModel().getType(); htmlUrl.append(CommonAppConfig.HOST) .append("/") @@ -1781,7 +1799,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(System.currentTimeMillis()) .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); - + Map map_ekv = new HashMap(); + map_ekv.put("link", htmlUrl.toString()); + MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); } else { type = bean.getShow_type(); htmlUrl.append(bean.getLink()) @@ -1797,7 +1817,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -1863,7 +1883,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -2017,10 +2037,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else { url = CommonAppConfig.HOST + "/h5/activity/firstTopUp/newUp.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); } - ZhuangBanActivity.forward(mContext, url, false,1); + ZhuangBanActivity.forward(mContext, url, false, 1); } else if (link.equals("zxb")) { String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, url, false,1); + ZhuangBanActivity.forward(mContext, url, false, 1); } else if (link.equals("xyd")) { openWishListWindow(); } @@ -2105,6 +2125,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis flipper.startFlipping(); flipper.setOnClickListener(view -> { + + MobclickAgent.onEvent(mContext, "live_room_hot", "热度按钮"); Bundle bundle = new Bundle(); String path = model.getHourchartH5Url(); if (!path.startsWith("/")) { @@ -2261,6 +2283,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (bean != null) { initPkRankView(bean); if (!StringUtil.isEmpty(bean.getClickUrl())) { + + MobclickAgent.onEvent(mContext, "live_room_sky", "天梯赛按钮"); pkRankVf.setOnClickListener(v -> { Bundle bundle = new Bundle(); String path = bean.getClickUrl(); @@ -2890,8 +2914,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); } - ViewClicksAntiShake.clicksAntiShake(weekView, () -> Bus.get().post(new LiveAudienceEvent() - .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS))); + ViewClicksAntiShake.clicksAntiShake(weekView, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + MobclickAgent.onEvent(mContext, "live_room_week", "周星榜按钮"); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)); + } + }); wksAndGiftWall.addView(weekView); wksAndGiftWall.startFlipping(); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1); @@ -2931,9 +2961,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis return; } if (i == R.id.avatar) { + MobclickAgent.onEvent(mContext, "live_room_anchor_avatar", "点主播头像"); showAnchorUserDialog(); } else if (i == R.id.btn_follow) { + MobclickAgent.onEvent(mContext, "live_room_follow_anchor", "直播间左上角关注主播按钮"); follow(); if (((LiveAudienceActivity) mContext).getCountDownTimer() != null) { ((LiveAudienceActivity) mContext).getCountDownTimer().cancel(); @@ -2957,11 +2989,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == R.id.btn_prize_pool_level) { ((LiveActivity) mContext).openPrizePoolWindow(); } else if (i == R.id.user_more) { + MobclickAgent.onEvent(mContext, "live_room_audience_list", "直播间上面点观众列表按钮"); ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.hot_btn) { ((LiveActivity) mContext).openUserMoreListWindow(1, false, false, mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.noble_seat) { + MobclickAgent.onEvent(mContext, "live_room_noble", "贵族按钮"); ((LiveActivity) mContext).openUserMoreListWindow(1, false, true, mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.btn_close) { close(); @@ -3403,6 +3437,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis */ public void showUserDialog(String toUid) { if (!TextUtils.isEmpty(mLiveUid) && !TextUtils.isEmpty(toUid)) { + MobclickAgent.onEvent(mContext, "live_room_user_avatar", "直播间任意点用户头像"); LiveUserDialogFragment fragment = new LiveUserDialogFragment(); Bundle bundle = new Bundle(); bundle.putString(Constants.LIVE_UID, mLiveUid); @@ -4094,6 +4129,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onBannerClick(List datas, int p) { + if (TextUtils.equals("特惠首充", mBannerList4.get(p).getName())){ + + Map map_ekv = new HashMap(); + map_ekv.put("link", mBannerList4.get(p).getLink()); + MobclickAgent.onEvent(mContext, "live_room_first_charge", map_ekv); + } Log.i("debug", "onBannerClick: " + mBannerList4.get(p).toString()); BannerBean bean = mBannerList4.get(p); if (showLoadingDialog()) { @@ -5218,6 +5259,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onBannerClick(List datas, int position) { if (datas.size() > 0 && mTopBannerList != null && mTopBannerList.size() > 0) { if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { + MobclickAgent.onEvent(mContext, "live_room_contact", "联系方式按钮"); Dialog loading = DialogUitl.loadingDialog(mContext); loading.show(); LiveNetManager.get(mContext) @@ -5253,6 +5295,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); } else { + MobclickAgent.onEvent(mContext, "live_room_wish", "心愿单按钮"); BannerBean bean = mTopBannerList.get(position); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); String type = ""; @@ -5272,7 +5315,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -5298,6 +5341,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis position = 0; } if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { + MobclickAgent.onEvent(mContext, "live_room_contact", "联系方式按钮"); Dialog loading = DialogUitl.loadingDialog(mContext); loading.show(); LiveNetManager.get(mContext) @@ -5333,6 +5377,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); } else { + MobclickAgent.onEvent(mContext, "live_room_wish", "心愿单按钮"); BannerBean bean = mTopBannerList.get(position); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); String type = ""; @@ -5352,7 +5397,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index d4b8cdb8d..fd7ce6297 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -29,6 +29,7 @@ import com.blankj.utilcode.util.GsonUtils; import com.lzf.easyfloat.EasyFloat; import com.lzf.easyfloat.permission.PermissionUtils; import com.lzf.easyfloat.utils.LifecycleUtils; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; @@ -1831,6 +1832,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe */ public void light() { if (!mLighted) { + MobclickAgent.onEvent(mContext, "live_room_light", "直播间点亮"); mLighted = true; int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE; SocketRyChatUtil.sendLightMessage(mLiveBean.getUid(), 1 + RandomUtil.nextInt(6), guardType); diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 1d5ae4a6d..0d9e0025f 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -453,6 +453,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override public void onNext(Unit unit) { + MobclickAgent.onEvent(mContext, "home_page_to_recommend", "首页点击右下角去推荐直播间按钮"); String Uid = floatBanner.getUid(); LiveHttpUtil.getLiveInfo(Uid + "", new HttpCallback() { @Override @@ -1453,6 +1454,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene title.setImageResource(R.mipmap.icon_red_packet_float_text_en); } floatRedPacket.setOnClickListener(v -> { + MobclickAgent.onEvent(mContext, "home_page_to_redpk", "首页点击右下角去红包专区"); mainHomeViewHolder.setCurPosition(3); }); } diff --git a/main/src/main/java/com/yunbao/main/activity/MainListActivity.java b/main/src/main/java/com/yunbao/main/activity/MainListActivity.java index 636b0b161..31d08b8b8 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainListActivity.java @@ -101,7 +101,6 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener @Override protected void onResume() { super.onResume(); - MobclickAgent.onPageStart("MainListActivity"); } @Override @@ -313,7 +312,6 @@ public class MainListActivity extends AbsActivity implements OnItemClickListener @Override protected void onPause() { super.onPause(); - MobclickAgent.onPageEnd("MainListActivity"); } diff --git a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java index f2029490b..b419fe14b 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWalletActivity.java @@ -19,6 +19,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; import com.android.billingclient.api.BillingResult; import com.android.billingclient.api.Purchase; import com.android.billingclient.api.PurchasesResponseListener; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.fragment.LoadingDialog; @@ -162,6 +163,13 @@ public class MyWalletActivity extends AbsActivity { @Override public void onClick(View view) { vp_content.setCurrentItem(index); + if (index==0){ + MobclickAgent.onEvent(mContext, "recharge_zs", "用户在充值页面选择左右切换到钻石或者点到钻石"); + }else if (index==1){ + MobclickAgent.onEvent(mContext, "recharge_xb", "用户在充值页面选择左右切换到星币或者点到星币"); + }else if (index==2){ + MobclickAgent.onEvent(mContext, "recharge_jd", "用户在充值页面选择左右切换到金豆或者点到金豆"); + } } }); return colorTransitionPagerTitleView; diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java index f0cd94024..35d0fd668 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java @@ -599,4 +599,10 @@ public class MyWebViewActivity extends AbsActivity { } } } + + @Override + protected void onPause() { + super.onPause(); + + } } diff --git a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java index 1fb2728f1..1ef37dbfe 100644 --- a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java @@ -224,12 +224,10 @@ public class SearchActivity extends AbsActivity { @Override protected void onPause() { super.onPause(); - MobclickAgent.onPageEnd("SearchActivity"); } @Override protected void onResume() { super.onResume(); - MobclickAgent.onPageStart("SearchActivity"); } } diff --git a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java index 74a2bbf45..7f184741d 100644 --- a/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java +++ b/main/src/main/java/com/yunbao/main/dialog/MainStartDialogFragment.java @@ -17,6 +17,7 @@ import android.widget.LinearLayout; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; @@ -268,10 +269,12 @@ public class MainStartDialogFragment extends AbsDialogFragment implements View.O if (i == R.id.btn_close) { } else if (i == R.id.btn_live) { if (mCallback != null) { + MobclickAgent.onEvent(mContext, "home_page_broadcast", "点击开播按钮"); mCallback.onLiveClick(); } } else if (i == R.id.btn_video) { if (mCallback != null) { + MobclickAgent.onEvent(mContext, "home_page_post", "点击发动态按钮"); mCallback.onVideoClick(); } } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 3efa1ca7d..56fe6bd30 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -452,7 +452,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement Map map_ekv = new HashMap(); map_ekv.put("link", link); - MobclickAgent.onEvent(mContext, "ome_page_recommend_banner", map_ekv); + MobclickAgent.onEvent(mContext, "home_page_recommend_banner", map_ekv); if (link.contains("http")) { WebViewActivity.forward(mContext, link, true, false); diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index f55f7da66..b7fa56b82 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -27,6 +27,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.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; @@ -74,8 +75,10 @@ import org.greenrobot.eventbus.EventBus; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; /** * Created by cxf on 2018/9/22. @@ -127,6 +130,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi ViewClicksAntiShake.clicksAntiShake(mAvatar, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮"); RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2); } }); @@ -358,6 +362,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi tv_level.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + MobclickAgent.onEvent(mContext, "my_top_level", "个人中心最上面的等级"); String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&for"; ZhuangBanActivity.forward(mContext, url); } @@ -373,6 +378,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi tv_level.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + MobclickAgent.onEvent(mContext, "my_top_level", "个人中心最上面的等级"); String url = CommonAppConfig.HOST + "/h5/Grade/index.html?" + "token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); ZhuangBanActivity.forward(mContext, url); } @@ -434,6 +440,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi forwardProfit(); break; case 2: + MobclickAgent.onEvent(mContext, "my_wallet", "个人中心点钱包"); forwardCoin(); break; case 13: @@ -443,6 +450,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi forwardMyVideo(); break; case 20: + MobclickAgent.onEvent(mContext, "my_room", "个人中心点房间管理"); forwardRoomManage(); break; } @@ -453,22 +461,32 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi ThreeDistributActivity.forward(mContext, bean.getName(), url); } else { if (bean.getId() == 31) { + MobclickAgent.onEvent(mContext, "my_medal", "个人中心点勋章"); //跳转网页版粉丝徽章 WebViewActivityMedal.forward(mContext, url); } else if (bean.getId() == 5) { Constants.isTitle = true; ZhuangBanActivity.forward(mContext, CommonAppConfig.HOST + "/h5/Personality.html"); } else if (bean.getId() == 23) { //獎勵中心 + MobclickAgent.onEvent(mContext, "my_award", "獎勵中心"); Log.i("tsa", url); RewardActivity.forward(mContext, url); } else if (bean.getId() == 4) { + url = HtmlConfig.SHOP + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); WebViewActivity.forward(mContext, url, false); } else if (bean.getId() == 3) {//我的等级 + MobclickAgent.onEvent(mContext, "my_level", "个人中心点我的等级"); Constants.myIntoIndex = 2; Constants.isTitle = false; ZhuangBanActivity.forward(mContext, url); } else { + if (bean.getId() == 11){ + MobclickAgent.onEvent(mContext, "my_anchor", "个人中心点主播中心"); + } + if (bean.getId() == 25){ + MobclickAgent.onEvent(mContext, "my_friend_invitation", "个人中心点好友邀请"); + } WebViewActivity.forward(mContext, url, false); } @@ -486,10 +504,17 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi } else if (i == R.id.signature) { mContext.startActivity(new Intent(mContext, EditProfileActivity.class)); } else if (i == R.id.lt_star_coin) { + Map map_ekv = new HashMap(); + map_ekv.put("from", "xb"); + MobclickAgent.onEvent(mContext, "my_recharge", map_ekv); mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 1)); } else if (i == R.id.btn_coin) { + Map map_ekv = new HashMap(); + map_ekv.put("from", "zs"); + MobclickAgent.onEvent(mContext, "my_recharge", map_ekv); mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 0)); } else if (i == R.id.btn_gold) { + MobclickAgent.onEvent(mContext, "my_receive", "充值旁边领取金豆的按钮"); // mContext.startActivity(new Intent(mContext, MyWalletActivity.class).putExtra("p", 2)); String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index"; RewardActivity.forward(mContext, url); @@ -498,6 +523,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi } else if (i == R.id.rt_setting) { forwardSetting(); } else if (i == R.id.lt_noble) { + MobclickAgent.onEvent(mContext, "my_noble", "个人中心点贵族"); Constants.isTitle = true; UserBean u = CommonAppConfig.getInstance().getUserBean(); String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid(); @@ -595,6 +621,11 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi Constants.isTitle = true; String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); WebViewActivity.forward(mContext, url, false, false); + + Map map_ekv = new HashMap(); + map_ekv.put("link", url); + MobclickAgent.onEvent(mContext, "my_banner", map_ekv); + } } } @@ -616,6 +647,11 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi Constants.isTitle = true; String url = bean.getSlide_url() + "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); RouteUtil.forwardCustomerService(url); + + Map map_ekv = new HashMap(); + map_ekv.put("link", url); + MobclickAgent.onEvent(mContext, "my_banner", map_ekv); + /*if(bean.getSlide_id().equals("95")){ RouteUtil.forwardCustomerService(url); }else { diff --git a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java index f1a9f7983..ee21d8e91 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java @@ -25,6 +25,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.bean.ImUserInfoModel; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; @@ -233,6 +234,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice); ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> { + MobclickAgent.onEvent(mContext, "information_official_notice", "官方通知"); type = userBean.getType(); netHandler.post(systemNumberRunnable); mContext.startActivity(new Intent(mContext, SystemMessageActivity.class) @@ -252,6 +254,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction); ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> { + MobclickAgent.onEvent(mContext, "information_system_interactive", "互動消息"); type = userBean.getType(); netHandler.post(systemNumberRunnable); mContext.startActivity(new Intent(mContext, SystemMessageActivity.class) @@ -271,6 +274,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { } ImgLoader.display(mContext, userBean.getNewImage(), imgNewsOnline); ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> { + MobclickAgent.onEvent(mContext, "information_system_service", "在線客服"); type = userBean.getType(); netHandler.post(systemNumberRunnable); FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null); @@ -297,6 +301,7 @@ public class MainMessageViewHolder extends AbsMainViewHolder { } ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages); ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> { + MobclickAgent.onEvent(mContext, "information_system_notice", "系统消息"); type = userBean.getType(); netHandler.post(systemNumberRunnable); mContext.startActivity(new Intent(mContext, SystemMessageActivity.class) diff --git a/video/src/main/java/com/yunbao/video/activity/AbsVideoCommentActivity.java b/video/src/main/java/com/yunbao/video/activity/AbsVideoCommentActivity.java index 781881f0e..113ec90c1 100644 --- a/video/src/main/java/com/yunbao/video/activity/AbsVideoCommentActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/AbsVideoCommentActivity.java @@ -9,6 +9,7 @@ import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.adapter.ImChatFacePagerAdapter; @@ -180,4 +181,14 @@ public abstract class AbsVideoCommentActivity extends AbsActivity implements Vie } return super.dispatchTouchEvent(ev); } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + } } diff --git a/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java b/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java index ed8457dc3..8c95f5302 100644 --- a/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java +++ b/video/src/main/java/com/yunbao/video/activity/AbsVideoPlayActivity.java @@ -9,6 +9,7 @@ import android.media.MediaMetadataRetriever; import android.text.TextUtils; import android.view.WindowManager; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.http.HttpCallback; @@ -253,4 +254,7 @@ public abstract class AbsVideoPlayActivity extends AbsVideoCommentActivity { public void setVideoScrollViewHolder(VideoScrollViewHolder videoScrollViewHolder) { mVideoScrollViewHolder = videoScrollViewHolder; } + + + } diff --git a/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java b/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java index 8e3466515..1bc5445a4 100644 --- a/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java +++ b/video/src/main/java/com/yunbao/video/views/VideoScrollViewHolder.java @@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.event.FollowEvent; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.video.R; @@ -141,6 +142,7 @@ public class VideoScrollViewHolder extends AbsViewHolder implements @Override public void onPageSelected(VideoPlayWrapViewHolder videoPlayWrapViewHolder, boolean needLoadMore) { if (videoPlayWrapViewHolder != null) { + MobclickAgent.onEvent(mContext, "community_video_slide", "社区视频上下滑动"); VideoBean videoBean = videoPlayWrapViewHolder.getVideoBean(); if (videoBean != null) { mVideoBean = videoBean; From 1a58311e260ae5ad82552400031c9d2fdca9ae1d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 28 Aug 2023 16:52:19 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shayu/phonelive/AppContext.java | 3 +-- .../yunbao/common/utils/GiftCacheUtil.java | 24 ++++++++++------- common/src/main/res/values-en-rUS/string.xml | 2 +- common/src/main/res/values-zh-rHK/strings.xml | 2 +- common/src/main/res/values-zh-rTW/strings.xml | 2 +- common/src/main/res/values-zh/strings.xml | 2 +- common/src/main/res/values/strings.xml | 2 +- config.gradle | 4 +-- .../live/dialog/LiveGameDialogFragment.java | 26 ++++++++++++++++--- .../yunbao/main/dialog/LoginTipsDialog.java | 3 +++ 10 files changed, 47 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 2dc5f808d..d26bdc5a8 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -168,8 +168,7 @@ public class AppContext extends CommonAppContext { //设置LOG开关,默认为false UMConfigure.setLogEnabled(true); - //友盟预初始化 - UMConfigure.preInit(getApplicationContext(),"64e40ee55488fe7b3afa2c96","PDLive"); + //友盟正式初始化 UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96"); diff --git a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java index 1a42452e7..01ec230f9 100644 --- a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java @@ -3,6 +3,7 @@ package com.yunbao.common.utils; import android.content.Context; import android.os.Handler; import android.os.Looper; +import android.text.TextUtils; import android.util.Log; import com.yunbao.common.CommonAppConfig; @@ -151,16 +152,19 @@ public class GiftCacheUtil { return; } clickId.add(bean.getId()+""); - getFile(context,getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback() { - @Override - public void callback(File bean) { - if(bean!=null) { - clickId.remove(getIdForFileName(bean.getName())+""); - downloadCache.remove(getIdForFileName(bean.getName())); + if (!TextUtils.isEmpty( bean.getSwf())){ + getFile(context,getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback() { + @Override + public void callback(File bean) { + if(bean!=null) { + clickId.remove(getIdForFileName(bean.getName())+""); + downloadCache.remove(getIdForFileName(bean.getName())); + } + mDownloadGifCallback.callback(bean); } - mDownloadGifCallback.callback(bean); - } - }); + }); + } + } /** @@ -241,7 +245,7 @@ public class GiftCacheUtil { if (clickId.contains(id+"")) { continue; } - if (bean.getSwf().isEmpty()) { + if (TextUtils.isEmpty(bean.getSwf())) { handler.post(() -> commonCallback.callback(null)); continue; } diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index e784a8e72..c7c5a59a8 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1054,7 +1054,7 @@ Limited ride And limited avatar frame Terms and policies For details, please read the following message to install the application: Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection. - In order to provide you with one-click sharing service, our product integrates Mob+U-Share SDK, The Mob+SDK needs to collect your device Mac address, unique device identifier (1MEIandroid IDIDFAOPENUDIDGUID, SIM card IMSI information), and public social account information that you need to share in order to complete the one-click sharing service. And through the geographical location calibration report data accuracy, provide basic anti-cheating services. For the sake of your information security, we have made data security and confidentiality agreements with third-party SDK service providers, and these companies will strictly abide by our data privacy and security requirements. We will not share your personally identifiable information with them unless we have your consent. To facilitate you better understand/Mob + data types and USES, and how to protect your personal information, you can log on to https:www.mob.com aboutpolicy understand [Mob +] privacy policy). + In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy Clicking Agree means you have read and agree to all of the above.。 agreement Welcome to PD LIVE. diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 3742dc4ea..9b17ba09e 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1080,7 +1080,7 @@ 條款和政策 歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。 詳情請您閱讀以下安裝應用程序的消息: - 為了向您提供一鍵分享服務,我們的產品集成Mob+U-Share SDK,Mob+SDK需要收集您的設備Mac地址、唯一設備識別碼(1MEI/android ID/IDFA/OPENUDID/GUID、 SIM卡IMSI信息)以及您需要分享的社交賬號公開信息,以便完成一鍵分享服務。並通過地理位置校準報表數據準確性,提供基礎反作弊服務。為了您的信息安全,我們已與第三方SDK服務商進行數據安全保密約定,這些公司會嚴格遵守我們的數據隱私和安全要求。 除非得到您的同意,我們不會與其共享您的個人身份信息。為便於您更好地了解[Mob+]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸https://www.mob.com/about/policy了解[Mob+]隱私權政)。 + 為了給用戶提供更好的服務,我們的產品集成[友盟SDK],SDK需要收集您的设备信息(IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸:https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy 同意 點擊同意後即代表您已閱讀並同意以上所有內容。 本應用會收集位置數據以支持登錄和註冊的功能使用。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index df1963a96..8a3d28859 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1080,7 +1080,7 @@ 條款和政策 歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。 詳情請您閱讀以下安裝應用程序的消息: - 為了向您提供一鍵分享服務,我們的產品集成Mob+U-Share SDK,Mob+SDK需要收集您的設備Mac地址、唯一設備識別碼(1MEI/android ID/IDFA/OPENUDID/GUID、 SIM卡IMSI信息)以及您需要分享的社交賬號公開信息,以便完成一鍵分享服務。並通過地理位置校準報表數據準確性,提供基礎反作弊服務。為了您的信息安全,我們已與第三方SDK服務商進行數據安全保密約定,這些公司會嚴格遵守我們的數據隱私和安全要求。 除非得到您的同意,我們不會與其共享您的個人身份信息。為便於您更好地了解[Mob+]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸https://www.mob.com/about/policy了解[Mob+]隱私權政)。 + 為了給用戶提供更好的服務,我們的產品集成[友盟SDK],SDK需要收集您的设备信息(IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸:https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy 同意 點擊同意後即代表您已閱讀並同意以上所有內容。 本應用會收集位置數據以支持登錄和註冊的功能使用。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 673c59614..697cde0a0 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1080,7 +1080,7 @@ 條款和政策 歡迎來到PD LIVE,對於您的個人信息及隱私,我們將採用最高標準對待和保護。 詳情請您閱讀以下安裝應用程序的消息: - 為了向您提供一鍵分享服務,我們的產品集成Mob+U-Share SDK,Mob+SDK需要收集您的設備Mac地址、唯一設備識別碼(1MEI/android ID/IDFA/OPENUDID/GUID、 SIM卡IMSI信息)以及您需要分享的社交賬號公開信息,以便完成一鍵分享服務。並通過地理位置校準報表數據準確性,提供基礎反作弊服務。為了您的信息安全,我們已與第三方SDK服務商進行數據安全保密約定,這些公司會嚴格遵守我們的數據隱私和安全要求。 除非得到您的同意,我們不會與其共享您的個人身份信息。為便於您更好地了解[Mob+]採集的數據類型及用途,以及何保護您的個人信息,您可以登陸https://www.mob.com/about/policy了解[Mob+]隱私權政)。 + 為了給用戶提供更好的服務,我們的產品集成[友盟SDK],SDK需要收集您的设备信息(IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP地址/SIM 卡 IMSI 信息等),為便於您更好地了解[友盟SDK]采集的數據類型及用途,以及何保護您的個人信息,您可以登陸:https://www.umeng.com/page/policy 了解[友盟SDK]隱私權政策【友盟+】隐私政策【友盟+】,第三方全域大数据服务提供商,为客户提供PC/APP/线下统计,广告效果监测,消息推送/微社区/分享/IM等运营工具,DIP,全域指数与行业报告等。https://www.umeng.com/page/policy 同意 點擊同意後即代表您已閱讀並同意以上所有內容。 本應用會收集位置數據以支持登錄和註冊的功能使用。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index c802d3fd7..0fd4498e8 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1054,7 +1054,7 @@ Limited ride And limited avatar frame Terms and policies For details, please read the following message to install the application: Welcome to PD LIVE. For your personal information and privacy, we will adopt the highest standards of treatment and protection. - In order to provide you with one-click sharing service, our product integrates Mob+U-Share SDK, The Mob+SDK needs to collect your device Mac address, unique device identifier (1MEIandroid IDIDFAOPENUDIDGUID, SIM card IMSI information), and public social account information that you need to share in order to complete the one-click sharing service. And through the geographical location calibration report data accuracy, provide basic anti-cheating services. For the sake of your information security, we have made data security and confidentiality agreements with third-party SDK service providers, and these companies will strictly abide by our data privacy and security requirements. We will not share your personally identifiable information with them unless we have your consent. To facilitate you better understand/Mob + data types and USES, and how to protect your personal information, you can log on to https:www.mob.com aboutpolicy understand [Mob +] privacy policy). + In order to provide users with better services, our products integrate [Alliance SDK], SDK needs to collect your device information (IMEI/MAC/Android ID/IDFA/OpenUDID/GUID/IP address /SIM card IMSI information, etc.), In order for you to better understand the types and purposes of the data collected by [Alliance SDK] and how to protect your personal information, you can log on to: https://www.umeng.com/page/policy Learn about [Alliance SDK] Privacy Policy [Alliance +] Privacy Policy [Alliance +], a third-party global big data service provider, providing customers with PC/APP/ offline statistics, advertising effect monitoring, message push/micro community/sharing /IM and other operating tools,DIP, global index and industry reports. https://www.umeng.com/page/policy Clicking Agree means you have read and agree to all of the above.。 agreement Welcome to PD LIVE. diff --git a/config.gradle b/config.gradle index 08d317359..5f3bc3427 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : " https://ceshi.yaoulive.com", + serverHost : " https://ceshi.yaoulive.com", diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java index cb9a3ca94..76c8b6a2d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java @@ -23,6 +23,7 @@ import androidx.annotation.Nullable; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.android.material.tabs.TabLayout; +import com.umeng.analytics.MobclickAgent; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.ActiveModel; @@ -31,11 +32,13 @@ import com.yunbao.common.bean.LiveBean; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; @@ -43,8 +46,6 @@ import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -202,7 +203,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { @Override public void onError(String error) { Log.i("debug", "onError: " + error); - ToastUtil.show( R.string.net_error); + ToastUtil.show(R.string.net_error); dismiss(); } }); @@ -252,6 +253,23 @@ public class LiveGameDialogFragment extends AbsDialogFragment { if (tab != null) { tab.select(); ActiveModel model = (ActiveModel) tab.getTag(); + switch (model.getActiveName()) { + case "闖關熱戀": + MobclickAgent.onEvent(mContext, "through_index", "进入闯关页面"); + break; + case "怪物大作戰": + MobclickAgent.onEvent(mContext, "plant_index", "进入怪物页面"); + break; + case "甜蜜約會": + MobclickAgent.onEvent(mContext, "sweet_index", "进入甜蜜页面"); + break; + case "娛樂整蠱": + MobclickAgent.onEvent(mContext, "tricky_index", "进入娱乐整蛊页面"); + break; + case "幸运天使": + MobclickAgent.onEvent(mContext, "angel_index", "进入幸运天使页面"); + break; + } if (model != null) { if (!StringUtil.isEmpty(model.getBgColor()) && !"#".equals(model.getBgColor())) { tabLayout.setBackgroundColor(Color.parseColor(model.getBgColor())); @@ -297,7 +315,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { 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 diff --git a/main/src/main/java/com/yunbao/main/dialog/LoginTipsDialog.java b/main/src/main/java/com/yunbao/main/dialog/LoginTipsDialog.java index c5db3d1e1..6495ec9ba 100644 --- a/main/src/main/java/com/yunbao/main/dialog/LoginTipsDialog.java +++ b/main/src/main/java/com/yunbao/main/dialog/LoginTipsDialog.java @@ -10,6 +10,7 @@ import android.view.Window; import android.view.WindowManager; import android.widget.Button; +import com.umeng.commonsdk.UMConfigure; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.utils.DpUtil; import com.yunbao.main.R; @@ -53,6 +54,8 @@ public class LoginTipsDialog extends AbsDialogFragment{ btn_agree.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { + //友盟预初始化 + UMConfigure.preInit(mContext,"64e40ee55488fe7b3afa2c96","PDLive"); EntryActivity.ToLogin(); dismiss(); } From 33930f3e325a8de58f6e5c80afb5815c3cd159f4 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 29 Aug 2023 13:35:38 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/dialog/LiveGameDialogFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java index 76c8b6a2d..4aa7606a8 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java @@ -268,8 +268,7 @@ public class LiveGameDialogFragment extends AbsDialogFragment { break; case "幸运天使": MobclickAgent.onEvent(mContext, "angel_index", "进入幸运天使页面"); - break; - } + break; } if (model != null) { if (!StringUtil.isEmpty(model.getBgColor()) && !"#".equals(model.getBgColor())) { tabLayout.setBackgroundColor(Color.parseColor(model.getBgColor())); From 7a31ca52da1af35501fcbd83c8e98671ad9a0ae1 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 30 Aug 2023 09:44:26 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 56fe6bd30..5464a2297 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -295,7 +295,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement MobclickAgent.onEvent(mContext, "home_page_recommend_hot", "热门"); break; case "New": - MobclickAgent.onEvent(mContext, "home_page_recommend_new", "热门"); + MobclickAgent.onEvent(mContext, "home_page_recommend_new", "新秀"); break; case "Pretty": MobclickAgent.onEvent(mContext, "home_page_recommend_pretty", "颜值"); From 72e96330456a574c7b6408aea0094d014c675e0a Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 30 Aug 2023 13:21:40 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/views/FunGamesViewHolder.java | 4 +-- .../yunbao/live/adapter/LiveChatAdapter.java | 2 +- .../live/dialog/LiveGameDialogFragment.java | 5 +++ .../live/views/LiveAudienceViewHolder.java | 2 +- .../yunbao/live/views/LiveRoomViewHolder.java | 19 ++++++++--- .../live/views/PortraitLiveManager.java | 1 + .../yunbao/main/activity/MainActivity.java | 33 ++++++++++--------- .../yunbao/main/views/MainMeViewHolder.java | 5 +++ 8 files changed, 45 insertions(+), 26 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java index 8c07a5a8d..1266df02a 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java @@ -79,9 +79,7 @@ public class FunGamesViewHolder extends RecyclerView.ViewHolder { .append("&token=") .append(userInfo.getToken()); } - Map map_ekv = new HashMap(); - map_ekv.put("link", htmlUrl.toString()); - MobclickAgent.onEvent(itemView.getContext(), "live_room_slide", map_ekv); + Bus.get().post(new CustomDrawerPopupEvent() .setDisMiss(true) .setHtmlUrl(htmlUrl.toString()) diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 87ff13b0d..17eecd2cf 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -159,7 +159,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { Log.i(TAG, "onScrolled: " + dy); mRecyclerViewScrolledDy = dy; isBottom = false; - MobclickAgent.onEvent(mContext, "live_room_chat_list", "滑动直播间聊天列表"); + } @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java index 4aa7606a8..1b3c78293 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGameDialogFragment.java @@ -50,7 +50,9 @@ import com.yunbao.live.activity.LiveRyAnchorActivity; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 趣味游戏对话框 @@ -253,6 +255,9 @@ public class LiveGameDialogFragment extends AbsDialogFragment { if (tab != null) { tab.select(); ActiveModel model = (ActiveModel) tab.getTag(); + Map map_ekv = new HashMap(); + map_ekv.put("link", model.getActiveSrc()); + MobclickAgent.onEvent(mContext, "live_room_slide", map_ekv); switch (model.getActiveName()) { case "闖關熱戀": MobclickAgent.onEvent(mContext, "through_index", "进入闯关页面"); diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 53ada05c8..94273cd3b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -183,7 +183,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_cheat), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - MobclickAgent.onEvent(mContext, "live_room_h5_game", "直播间任意点用户头像"); + MobclickAgent.onEvent(mContext, "live_room_h5_game", "直播间下面鼓掌按钮"); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.WE_CHEAT)); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index d104e8de4..1e56d38a0 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1799,9 +1799,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(System.currentTimeMillis()) .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); - Map map_ekv = new HashMap(); - map_ekv.put("link", htmlUrl.toString()); - MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); } else { type = bean.getShow_type(); htmlUrl.append(bean.getLink()) @@ -1816,6 +1813,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } + if (htmlUrl.toString().contains("StarChallenge")){ + Map map_ekv = new HashMap(); + map_ekv.put("link", htmlUrl.toString()); + MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); + } if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { @@ -1865,6 +1867,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(System.currentTimeMillis()) .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + } else { type = bean.getShow_type(); htmlUrl.append(bean.getLink()) @@ -1882,6 +1885,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } + if (htmlUrl.toString().contains("StarChallenge")){ + Map map_ekv = new HashMap(); + map_ekv.put("link", htmlUrl.toString()); + MobclickAgent.onEvent(mContext, "live_room_star", map_ekv); + } if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 1); } else { @@ -2284,8 +2292,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis initPkRankView(bean); if (!StringUtil.isEmpty(bean.getClickUrl())) { - MobclickAgent.onEvent(mContext, "live_room_sky", "天梯赛按钮"); + pkRankVf.setOnClickListener(v -> { + MobclickAgent.onEvent(mContext, "live_room_sky", "天梯赛按钮"); Bundle bundle = new Bundle(); String path = bean.getClickUrl(); if (!path.startsWith("/") && !path.startsWith("http")) { @@ -4129,7 +4138,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onBannerClick(List datas, int p) { - if (TextUtils.equals("特惠首充", mBannerList4.get(p).getName())){ + if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())){ Map map_ekv = new HashMap(); map_ekv.put("link", mBannerList4.get(p).getLink()); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index fd7ce6297..4170e2ddf 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -276,6 +276,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { isEnterRoom = false; + MobclickAgent.onEvent(mContext, "live_room_chat_list", "滑动直播间聊天列表"); openParametersModel = new OpenParametersModel(); if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.UpPkTwo(); diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 0d9e0025f..a88fdfdac 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -334,7 +334,21 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override public void onPageSelected(int position) { - + 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; + } if (mTabButtonGroup.getCurPosition() != position) { System.err.println("重连IM:" + IMLoginManager.isLogin(mContext)); if (!IMLoginManager.isLogin(mContext)) { @@ -715,6 +729,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene int i = v.getId(); if (i == R.id.btn_start) { showStartDialog(); + MobclickAgent.onEvent(mContext, "broadcast", "开播按钮"); } else if (i == R.id.btn_search) { SearchActivity.forward(mContext); @@ -1082,21 +1097,7 @@ 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()) { diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index b7fa56b82..95e2a3d50 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -141,6 +141,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi ViewClicksAntiShake.clicksAntiShake(gift_svga, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "my_avatar", "个人头像按钮"); RouteUtil.forwardUserHome(mContext, CommonAppConfig.getInstance().getUid(), 2); } }); @@ -465,6 +466,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi //跳转网页版粉丝徽章 WebViewActivityMedal.forward(mContext, url); } else if (bean.getId() == 5) { + MobclickAgent.onEvent(mContext, "my_decorate", "个人中心点装扮"); Constants.isTitle = true; ZhuangBanActivity.forward(mContext, CommonAppConfig.HOST + "/h5/Personality.html"); } else if (bean.getId() == 23) { //獎勵中心 @@ -486,6 +488,9 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi } if (bean.getId() == 25){ MobclickAgent.onEvent(mContext, "my_friend_invitation", "个人中心点好友邀请"); + } + if (bean.getId() == 24){ + MobclickAgent.onEvent(mContext, "my_pack", "个人中心点包裹"); } WebViewActivity.forward(mContext, url, false); } From 233469c7e44aa3f4b4a8a7681300350e53257baf Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 30 Aug 2023 13:44:56 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/views/MainHomeViewHolder.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 57c5aee1d..74ad6b9e4 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -54,6 +54,20 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { @Override protected void loadPageData(int position) { + switch (position) { + case 0: + MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮"); + break; + case 1: + MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮"); + break; + case 2: + MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮"); + break; + case 3: + MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮"); + break; + } if (mViewHolders == null) { return; } @@ -68,19 +82,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) { From dd6600a89ef7d0ad49324420384766c489f8e298 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 31 Aug 2023 09:56:41 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/view_full_service_notification.xml | 2 +- main/src/main/res/layout/view_main_message.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/src/main/res/layout/view_full_service_notification.xml b/common/src/main/res/layout/view_full_service_notification.xml index fcd1f1cb0..07a4e6fad 100644 --- a/common/src/main/res/layout/view_full_service_notification.xml +++ b/common/src/main/res/layout/view_full_service_notification.xml @@ -42,7 +42,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="19dp" + android:layout_marginStart="75dp" android:layout_marginTop="42dp" android:layout_marginEnd="20dp" android:layout_toStartOf="@+id/goto_room_view" diff --git a/main/src/main/res/layout/view_main_message.xml b/main/src/main/res/layout/view_main_message.xml index d4dbdfe78..c7650df8c 100644 --- a/main/src/main/res/layout/view_main_message.xml +++ b/main/src/main/res/layout/view_main_message.xml @@ -62,7 +62,7 @@ android:text="7" android:textColor="@color/white" android:textSize="12sp" - android:visibility="visible" /> + android:visibility="gone" /> + android:visibility="gone" /> + android:visibility="gone" /> + android:visibility="gone" /> From 93aa8e55e54c96351d6170f0bc4f99b1b6a1d857 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 2 Sep 2023 10:10:50 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 3 ++- .../main/java/com/yunbao/live/dialog/LiveGiftPopup.java | 3 +++ .../java/com/yunbao/live/views/LiveRoomViewHolder.java | 1 + .../main/java/com/yunbao/main/activity/MainActivity.java | 1 + .../java/com/yunbao/main/views/MainHomeViewHolder.java | 7 ------- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config.gradle b/config.gradle index 5f3bc3427..f96322d1c 100644 --- a/config.gradle +++ b/config.gradle @@ -18,7 +18,8 @@ ext { //百度语音识别 baiduAppId : "23774720", - baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB", + baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnR B", + baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false isGooglePlay : false, diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 2be645be7..6422a5f6d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -325,6 +325,7 @@ public class LiveGiftPopup extends AbsDialogFragment { StringBuffer htmlUrl = new StringBuffer(); htmlUrl.append(CommonAppConfig.HOST) .append(liveGiftModel.getOperateUrl()) + .append("?uid=") .append(userInfo.getId()) .append("&token=") .append(userInfo.getToken()) @@ -799,6 +800,8 @@ public class LiveGiftPopup extends AbsDialogFragment { if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) { operateImage.setVisibility(View.VISIBLE); ImgLoader.display(getContext(), liveGiftModel.getOperateImage(), operateImage); + }else { + operateImage.setVisibility(View.GONE); } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 1e56d38a0..3909d443e 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -3014,6 +3014,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == R.id.ft_hot_add) { ((LiveActivity) mContext).openHotListWindow(1); } else if (i == R.id.user_guard) { + MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮"); // ((LiveActivity) mContext).openUserMoreListWindow(2, true); ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index a88fdfdac..b5df237a6 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -1010,6 +1010,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { + MobclickAgent.onEvent(mContext, "home_page_enter_room", "首页点击直播间"); RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 74ad6b9e4..c96c1f535 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -38,16 +38,9 @@ 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); } - @Override - public void release() { - super.release(); - MobclickAgent.onPageEnd(mPageName); - } - public void setCurPosition(int position) { mViewPager.setCurrentItem(position); } From 82fd35305a447d36c2334b4782165f85585db804 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 5 Sep 2023 13:24:21 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/LiveGiftBean.java | 24 ++- .../com/yunbao/common/http/LiveHttpUtil.java | 30 ++-- common/src/main/res/values/strings.xml | 2 + .../yunbao/live/adapter/FrameGiftAdapter.java | 10 ++ .../java/com/yunbao/live/bean/CoinModel.java | 15 +- .../com/yunbao/live/dialog/LiveGiftPopup.java | 149 +++++++++++++++--- .../live/event/LiveGiftItemRefreshEvent.java | 17 ++ .../yunbao/live/views/LiveGiftFragment.java | 7 + .../live/views/LiveGiftItemFragment.java | 5 + 9 files changed, 218 insertions(+), 41 deletions(-) create mode 100644 live/src/main/java/com/yunbao/live/event/LiveGiftItemRefreshEvent.java diff --git a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java index 2dac9e946..31c65e757 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java @@ -66,6 +66,28 @@ public class LiveGiftBean { private String namingCoin; @JSONField(name = "naming_user_coin") private String namingUserCoin; + @JSONField(name = "blind_box_ticket") + private int blindBoxTicket; + @JSONField(name = "blind_box_ticket_id") + private int blindBoxTicketId; + + public int getBlindBoxTicketId() { + return blindBoxTicketId; + } + + public LiveGiftBean setBlindBoxTicketId(int blindBoxTicketId) { + this.blindBoxTicketId = blindBoxTicketId; + return this; + } + + public int getBlindBoxTicket() { + return blindBoxTicket; + } + + public LiveGiftBean setBlindBoxTicket(int blindBoxTicket) { + this.blindBoxTicket = blindBoxTicket; + return this; + } public String getNamingUserCoin() { return namingUserCoin; @@ -202,7 +224,7 @@ public class LiveGiftBean { return this; } - private int fansGiftLevel=0;//粉丝团礼物等级要求 + private int fansGiftLevel = 0;//粉丝团礼物等级要求 public int getFansGiftLevel() { return fansGiftLevel; diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index 77deacb8a..7de5fd2cf 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -6,10 +6,6 @@ import com.lzy.okgo.request.GetRequest; import com.lzy.okgo.request.PostRequest; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; -import com.yunbao.common.http.CommonHttpUtil; -import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.http.HttpClient; -import com.yunbao.common.http.JsonBean; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.L; import com.yunbao.common.utils.MD5Util; @@ -292,6 +288,7 @@ public class LiveHttpUtil { /** * 主播或管理员禁言 + * * @param time 禁言时间 (分) */ public static void setShutUp(String liveUid, String stream, int type, String touid, String time, HttpCallback callback) { @@ -619,17 +616,19 @@ public class LiveHttpUtil { * 观众给主播送礼物 */ public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) { - sendGift(by, liveUid, stream, giftId, giftCount, 0, false,callback); + sendGift(by, liveUid, stream, giftId, giftCount, 0, false, callback); } - public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, HttpCallback callback) { - sendGift(by, liveUid, stream, giftId, giftCount, isContactGift, false,callback); + + public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, HttpCallback callback) { + sendGift(by, liveUid, stream, giftId, giftCount, isContactGift, false, callback); } + /** * 观众给主播送礼物 * * @param isContactGift 是否为联系方式礼物 */ - public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift,HttpCallback callback) { + public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, boolean isFansGroupGift, HttpCallback callback) { HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT) .params("liveuid", liveUid) .params("stream", stream) @@ -637,7 +636,20 @@ public class LiveHttpUtil { .params("isContactGift", isContactGift) .params("giftcount", giftCount) .params("isprank", by) - .params("fans_exclusive_pack",isFansGroupGift?"1":"0") + .params("fans_exclusive_pack", isFansGroupGift ? "1" : "0") + .params("appVersion", CommonAppConfig.getInstance().getVersion()) + .execute(callback); + } + + public static void sendBlindBoxTicket(String by, String liveUid, String stream, int giftId, HttpCallback callback) { + HttpClient.getInstance().get("Live.sendBlindBoxTicket", LiveHttpConsts.SEND_GIFT) + .params("liveuid", liveUid) + .params("stream", stream) + .params("giftid", giftId) + .params("isContactGift", 0) + .params("giftcount", "1") + .params("isprank", by) + .params("fans_exclusive_pack", "0") .params("appVersion", CommonAppConfig.getInstance().getVersion()) .execute(callback); } diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 0fd4498e8..36c81b4e1 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1313,5 +1313,7 @@ Limited ride And limited avatar frame cancel settings Too many gifts + 是否使用試用劵 + 使用鑽石 diff --git a/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java b/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java index 05e78fd3b..3ff3a7269 100644 --- a/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/FrameGiftAdapter.java @@ -66,4 +66,14 @@ public class FrameGiftAdapter extends RecyclerView.Adapter { public int getItemCount() { return giftJson.size(); } + + public void refreshWrapListAfterSend(LiveGiftBean model) { + for (int i = 0; i < giftJson.size(); i++) { + if (giftJson.get(i).getId() == model.getId()) { + int giftNum = giftJson.get(i).getBlindBoxTicket(); + giftJson.get(i).setBlindBoxTicket(giftNum - 1); + } + } + notifyDataSetChanged(); + } } diff --git a/live/src/main/java/com/yunbao/live/bean/CoinModel.java b/live/src/main/java/com/yunbao/live/bean/CoinModel.java index 67e8595e2..b78325dbd 100644 --- a/live/src/main/java/com/yunbao/live/bean/CoinModel.java +++ b/live/src/main/java/com/yunbao/live/bean/CoinModel.java @@ -34,15 +34,20 @@ public class CoinModel extends BaseModel { public String getCoin() { long coinMoney = Long.parseLong(coin); + String coinStr = coin; if (999999999 < coinMoney && coinMoney <= 999999999999L) { - coin = coin.substring(0, coin.length() - 3); - coin = coin + "k"; + coinStr = coinStr.substring(0, coinStr.length() - 3); + coinStr = coinStr + "k"; } if (999999999999L < coinMoney && coinMoney <= 999999999999999L) { - coin = coin.substring(0, coin.length() - 6); - coin = coin + "M"; + coinStr = coinStr.substring(0, coinStr.length() - 6); + coinStr = coinStr + "M"; } - return coin; + return coinStr; + } + + public Long getCoinLong() { + return Long.parseLong(coin); } public CoinModel setCoin(String coin) { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 6422a5f6d..f810fa39a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -230,7 +230,36 @@ public class LiveGiftPopup extends AbsDialogFragment { @Override public void onViewClicks() { MobclickAgent.onEvent(mContext, "gif_list_seed_gif", "用户送礼物"); - sendGiftHandler.post(sendGiftRunnble); + + if (liveGiftModel != null && liveGiftModel.getBlindBoxTicket() > 0) { + BigDecimal needcoin = new BigDecimal(liveGiftModel.getPrice()).multiply(new BigDecimal(mCount)); + + if (needcoin.longValue() > diamond) { + + sendBlindBoxTicket(); + } else { + new DialogUitl.Builder(mContext) + .setView(R.layout.dialog_live_unfollow) + .setConfirmString(mContext.getString(R.string.aristocrat_determine)) + .setCancelString(mContext.getString(R.string.use_diamonds)) + .setContent(mContext.getString(R.string.trial_coupon)) + .setClickCallback(new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + sendGiftHandler.post(sendGiftRunnble); + } + + @Override + public void onConfirmClick(Dialog dialog, String content) { + sendBlindBoxTicket(); + } + }).setCancelable(true).build().show(); + } + + } else { + sendGiftHandler.post(sendGiftRunnble); + } + } }); @@ -453,6 +482,8 @@ public class LiveGiftPopup extends AbsDialogFragment { /** * 获取砖石和金豆余额 */ + long diamond = 0; + private void getCoin() { LiveHttpUtil.getCoin(new HttpCallback() { @Override @@ -462,6 +493,7 @@ public class LiveGiftPopup extends AbsDialogFragment { CoinModel coinModel = GsonUtils.fromJson(info[0], CoinModel.class); goldText.setText(coinModel.getGold()); diamondText.setText(coinModel.getCoin()); + diamond = coinModel.getCoinLong(); lvStr.setText("Lv." + coinModel.getUserLevel()); findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) && @@ -528,10 +560,66 @@ public class LiveGiftPopup extends AbsDialogFragment { private Runnable sendGiftRunnble = new Runnable() { @Override public void run() { - sendGift(); + if (isWrap && liveGiftModel.getType() == 7) { + sendBlindBoxTicket(); + } else { + sendGift(); + } + } }; + //使用优惠券 + public void sendBlindBoxTicket() { + if (TextUtils.isEmpty(mLiveUid) || + TextUtils.isEmpty(mStream) || + liveGiftModel == null) + return; + + LiveHttpUtil.sendBlindBoxTicket((by != null ? "1" : "0"), + mLiveUid, + mStream, + isWrap ? liveGiftModel.getId() : liveGiftModel.getBlindBoxTicketId(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + if (liveGiftModel.getSwf().contains("svga")) { + dismiss(); + } + if (info.length > 0) { + JSONObject obj = JSON.parseObject(info[0]); + String coin = obj.getString("coin"); + String goldCoin = obj.getString("gold"); + UserBean u = CommonAppConfig.getInstance().getUserBean(); + if (u != null) { + u.setLevel(obj.getIntValue("level")); + //送礼物后更新粉丝徽章等级 + u.setMedalLevel(obj.getIntValue("medal_level")); + u.setMedalName(obj.getString("medal_name")); + u.setCoin(coin); + } + if (diamondText != null) { + diamondText.setText(coin); + } + if (goldText != null) { + goldText.setText(goldCoin); + } + if (!isWrap) { + liveGiftModel.setBlindBoxTicket(liveGiftModel.getBlindBoxTicket() - 1); + } + isGetNewWrap = true; + if (isWrap) { + Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel)); + } + } + } else { + ToastUtil.show(msg); + } + } + + }); + } + /** * 赠送礼物 */ @@ -655,39 +743,45 @@ public class LiveGiftPopup extends AbsDialogFragment { lianSongHandler.removeCallbacks(lianSongRunnable); mShowLianBtn = false; getCoin(); + LiveNetManager.get(mContext) .getGiftNamingInfo(liveGiftModel.getId() + "", new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(GiftNamingInfoModel data) { - liveGiftModel = JSONObject.parseObject(GsonUtils.toJson(data), LiveGiftBean.class); - if (!TextUtils.isEmpty(liveGiftModel.getNamingLiveuid()) && - !TextUtils.isEmpty(liveGiftModel.getNamingUid()) && - !TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") && - !TextUtils.equals(liveGiftModel.getNamingUid(), "0")) { - namingLayout.setVisibility(View.VISIBLE); - ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar); - StringBuffer namingNameText = new StringBuffer(); - if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { - namingNameText.append("获取冠名:") - .append(liveGiftModel.getNamingUserCoin()) - .append(" "); + if (TextUtils.equals(data.getNamingStatus(), "1")) { + liveGiftModel = JSONObject.parseObject(GsonUtils.toJson(data), LiveGiftBean.class); + if (!TextUtils.isEmpty(liveGiftModel.getNamingLiveuid()) && + !TextUtils.isEmpty(liveGiftModel.getNamingUid()) && + !TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") && + !TextUtils.equals(liveGiftModel.getNamingUid(), "0")) { + namingLayout.setVisibility(View.VISIBLE); + ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar); + StringBuffer namingNameText = new StringBuffer(); + if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { + namingNameText.append("获取冠名:") + .append(liveGiftModel.getNamingUserCoin()) + .append(" "); + } else { + namingNameText.append("Get title: ") + .append(liveGiftModel.getNamingUserCoin()) + .append(" "); + } + namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor)) + .append(liveGiftModel.getNamingLiveName()) + .append(" ") + .append(mContext.getText(com.yunbao.live.R.string.the_title_financier)) + .append(" ") + .append(liveGiftModel.getNamingUserName()); + namingName.setText(namingNameText.toString()); } else { - namingNameText.append("Get title: ") - .append(liveGiftModel.getNamingUserCoin()) - .append(" "); + namingLayout.setVisibility(View.GONE); + } - namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor)) - .append(liveGiftModel.getNamingLiveName()) - .append(" ") - .append(mContext.getText(com.yunbao.live.R.string.the_title_financier)) - .append(" ") - .append(liveGiftModel.getNamingUserName()); - namingName.setText(namingNameText.toString()); } else { namingLayout.setVisibility(View.GONE); - } + } @Override @@ -800,7 +894,7 @@ public class LiveGiftPopup extends AbsDialogFragment { if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) { operateImage.setVisibility(View.VISIBLE); ImgLoader.display(getContext(), liveGiftModel.getOperateImage(), operateImage); - }else { + } else { operateImage.setVisibility(View.GONE); } @@ -1185,12 +1279,15 @@ public class LiveGiftPopup extends AbsDialogFragment { if (goldText != null) { goldText.setText(goldCoin); } + if (!mGiftBean.getSwf().contains("svga")) { showLianBtn(); } if (mGiftBean.getType() == 7) { showLianBtn(); + } + // //刷新包裹列表wrap_gift_num -1:表示数量没有变化 // mObjGiftSendback = obj; isGetNewWrap = true; diff --git a/live/src/main/java/com/yunbao/live/event/LiveGiftItemRefreshEvent.java b/live/src/main/java/com/yunbao/live/event/LiveGiftItemRefreshEvent.java new file mode 100644 index 000000000..4101b375f --- /dev/null +++ b/live/src/main/java/com/yunbao/live/event/LiveGiftItemRefreshEvent.java @@ -0,0 +1,17 @@ +package com.yunbao.live.event; + +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.LiveGiftBean; + +public class LiveGiftItemRefreshEvent extends BaseModel { + private LiveGiftBean liveGiftModel; + + public LiveGiftBean getLiveGiftModel() { + return liveGiftModel; + } + + public LiveGiftItemRefreshEvent setLiveGiftModel(LiveGiftBean liveGiftModel) { + this.liveGiftModel = liveGiftModel; + return this; + } +} diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java index 5740c41ea..d198e079e 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java @@ -19,6 +19,11 @@ import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.fragment.BaseFragment; import com.yunbao.live.R; import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter; +import com.yunbao.live.event.LiveGiftItemRefreshEvent; +import com.yunbao.live.event.LiveParcelItemRefreshEvent; + +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; import java.util.ArrayList; import java.util.List; @@ -148,4 +153,6 @@ public class LiveGiftFragment extends BaseFragment { liveGiftFragment.setArguments(bundle); return liveGiftFragment; } + + } diff --git a/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java b/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java index f2de5474c..72a927be9 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java +++ b/live/src/main/java/com/yunbao/live/views/LiveGiftItemFragment.java @@ -17,6 +17,7 @@ import com.yunbao.common.utils.Bus; import com.yunbao.live.R; import com.yunbao.live.adapter.FrameGiftAdapter; import com.yunbao.live.event.LiveGiftItemEvent; +import com.yunbao.live.event.LiveGiftItemRefreshEvent; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -79,4 +80,8 @@ public class LiveGiftItemFragment extends BaseFragment { public void onLiveGiftItemEvent(LiveGiftItemEvent event) { frameGiftAdapter.giftSelect(event.getLiveGiftModel()); } + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveGiftItemRefreshEvent(LiveGiftItemRefreshEvent event) { + frameGiftAdapter.refreshWrapListAfterSend(event.getLiveGiftModel()); + } }