diff --git a/common/src/main/res/layout/view_live_total.xml b/common/src/main/res/layout/view_live_total.xml index 58178fddf..a9464fad4 100644 --- a/common/src/main/res/layout/view_live_total.xml +++ b/common/src/main/res/layout/view_live_total.xml @@ -35,9 +35,31 @@ android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginTop="10dp"> + + + + + + + + + + + + + + + + + + + + + + + + + 屏蔽座駕特效 您已在當前直播間 是否清空未讀消息 + 人氣票 + 系統通知 + 在線客服 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 0d4f75635..d454a09b4 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1,5 +1,8 @@ package com.yunbao.live.activity; +import static com.yunbao.live.views.LivePlayRyViewHolder.Micing; + +import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.media.AudioManager; @@ -16,12 +19,17 @@ import android.widget.ImageView; import androidx.annotation.IdRes; import androidx.viewpager.widget.ViewPager; +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustEvent; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.blankj.utilcode.util.GsonUtils; +import com.facebook.appevents.AppEventsLogger; +import com.google.firebase.analytics.FirebaseAnalytics; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.IMLoginModel; @@ -46,10 +54,10 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.VerticalViewPager; import com.yunbao.live.R; import com.yunbao.live.adapter.VerticalPagerAdapter; +import com.yunbao.live.bean.ImUserBean; import com.yunbao.live.bean.LiveBean; import com.yunbao.live.dialog.LiveFansFragment; import com.yunbao.live.dialog.LiveGiftDialogFragment; -import com.yunbao.live.dialog.LiveGuardDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveMicUserDialogFragment; import com.yunbao.live.dialog.LiveTotalDialog; @@ -58,6 +66,7 @@ import com.yunbao.live.dialog.SidebarLiveAudience; import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveRoomChangeEvent; +import com.yunbao.live.http.ImHttpUtil; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; @@ -68,10 +77,9 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import static com.yunbao.live.views.LivePlayRyViewHolder.Micing; - /** * Created by cxf on 2018/10/10. * 看直播 @@ -773,11 +781,71 @@ public class LiveAudienceActivity extends LiveActivity { case REPORT: LiveReportActivity.forward(mContext, event.getBean().getUid()); break; + case POPULAR: + url = CommonAppConfig.HOST + "/h5/activity/PopularityTask/index.html"; + url += "?anchorUid=" + mLiveUid + + "&stream=" + mStream + + "&uid=" + CommonAppConfig.getInstance().getUid() + + "&token=" + CommonAppConfig.getInstance().getToken(); + liveHDDialogFragment=new LiveHDDialogFragment(); + bundle.putString("url", url); + bundle.putInt("show_type", 1); + liveHDDialogFragment.show(getSupportFragmentManager(),"LiveHDDialogFragment"); + break; + case NOTICE: + toSysMsgWeb("1"); + break; + case ONLINE: + toSysMsgWeb("3"); + break; } } + /** + * 跳转到消息中心的系统信息web + * @param type 1、官方通知 2、互动信息 3、在线客服 + */ + private void toSysMsgWeb(String type){ + ImHttpUtil.getImUserInfo("", new HttpCallback() { + + @SuppressLint("MissingPermission") + @Override + public void onSuccess(int code, String msg, String[] info) { + List list = JSON.parseArray(Arrays.toString(info), ImUserBean.class); + for (ImUserBean bean : list) { + if(type.equals(bean.getType())){ + switch (type){ + case "1": + startActivity(new Intent(mContext, SystemMessageActivity.class) + .putExtra("type", bean.getType()) + .putExtra("uid", "") + .putExtra("title", bean.getTitle()) + .putExtra("headImg", "")); + break; + case "3": + FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null); + AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); + AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p"); + Adjust.trackEvent(adjustEvent1); + if (bean.getLink() != null && !"".equals(bean.getLink())) { + WebViewActivity.forward(mContext, bean.getLink()); + } else { + startActivity(new Intent(mContext, SystemMessageActivity.class) + .putExtra("type", bean.getType()) + .putExtra("uid", "") + .putExtra("title", "") + .putExtra("headImg", "")); + } + break; + } + + } + } + } + }); + } @Override public boolean canBackPressed() { return super.canBackPressed(); diff --git a/live/src/main/java/com/yunbao/live/activity/MyConversationListFragment.java b/live/src/main/java/com/yunbao/live/activity/MyConversationListFragment.java deleted file mode 100644 index 3c4a14e87..000000000 --- a/live/src/main/java/com/yunbao/live/activity/MyConversationListFragment.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.yunbao.live.activity; - -import android.os.Bundle; -import android.view.View; - - -import io.rong.common.RLog; -import io.rong.imkit.config.ConversationListBehaviorListener; -import io.rong.imkit.config.RongConfigCenter; -import io.rong.imkit.conversationlist.ConversationListFragment; -import io.rong.imkit.conversationlist.model.BaseUiConversation; -import io.rong.imkit.conversationlist.model.GatheredConversation; -import io.rong.imkit.utils.RouteUtils; -import io.rong.imkit.widget.adapter.ViewHolder; - -/** - * 会话界面需要配置参数,复写onItemClick给view这是bundle的tag,在会话界面可以获取该bundle - */ -public class MyConversationListFragment extends ConversationListFragment { - private final String TAG = ConversationListFragment.class.getSimpleName(); - private Bundle bundle=new Bundle(); - - public void setBundle(Bundle bundle) { - this.bundle = bundle; - } - - @Override - public void onItemClick(View view, ViewHolder holder, int position) { - if (position >= 0) { - BaseUiConversation baseUiConversation = (BaseUiConversation)this.mAdapter.getItem(position); - ConversationListBehaviorListener listBehaviorListener = RongConfigCenter.conversationListConfig().getListener(); - view.setTag(bundle); - if (listBehaviorListener != null && listBehaviorListener.onConversationClick(view.getContext(), view, baseUiConversation)) { - RLog.d(this.TAG, "ConversationList item click event has been intercepted by App."); - } else { - if (baseUiConversation != null && baseUiConversation.mCore != null) { - if (baseUiConversation instanceof GatheredConversation) { - RouteUtils.routeToSubConversationListActivity(view.getContext(), - ((GatheredConversation)baseUiConversation).mGatheredType, - baseUiConversation.mCore.getConversationTitle()); - } else { - RouteUtils.routeToConversationActivity(view.getContext(), - baseUiConversation.mCore.getConversationType(), - baseUiConversation.mCore.getTargetId(),bundle); - } - } else { - RLog.e(this.TAG, "invalid conversation."); - } - - } - view.setTag(null); - } - } -} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java index 81850c1b7..b680d8eea 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java @@ -126,6 +126,24 @@ public class LiveTotalDialog extends AbsDialogFragment { .setType(LiveAudienceEvent.LiveAudienceType.REPORT)); dismiss(); }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.popular), () -> { + Bus.get().post(new LiveAudienceEvent() + .setBean(anchorBean) + .setType(LiveAudienceEvent.LiveAudienceType.POPULAR)); + dismiss(); + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), () -> { + Bus.get().post(new LiveAudienceEvent() + .setBean(anchorBean) + .setType(LiveAudienceEvent.LiveAudienceType.NOTICE)); + dismiss(); + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.online), () -> { + Bus.get().post(new LiveAudienceEvent() + .setBean(anchorBean) + .setType(LiveAudienceEvent.LiveAudienceType.ONLINE)); + dismiss(); + }); } @Override diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index abd971209..7492bfb7e 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -114,7 +114,10 @@ public class LiveAudienceEvent extends BaseModel { ACTIVITY_CENTER(13, "活動中心"), LIVE_ROOM_EXCEPTION(14, "直播间异常"), REFRESH_THE_LIVEl_PAGE(15, "刷新直播页面"), - REPORT(16, "舉報"); + REPORT(16, "舉報"), + POPULAR(17, "人气票任务"), + NOTICE(18, "系统通知"), + ONLINE(19, "在线客服"); private int type; private String name; 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 01a6ba6e9..d576c8f3b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -901,7 +901,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis params1.bottomMargin = 0; mChatRecyclerView.setLayoutParams(params1); }); - + // mBanner2.setVisibility(View.GONE); if (fastMsgRecyclerView.getVisibility() == View.GONE) { params1.bottomMargin = 0; mChatRecyclerView.setLayoutParams(params1); @@ -1770,7 +1770,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis RongIMClient.getInstance().getConversationListByPage(new RongIMClient.ResultCallback>() { @Override public void onSuccess(List conversations) { - if(!conversations.isEmpty()){ + if(conversations!=null&&!conversations.isEmpty()){ Conversation conversation = conversations.get(0); UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(conversation.getTargetId()); if(userInfo!=null){