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;