Merge branch 'master' into dev_random_pk
# Conflicts: # live/src/main/res/values/strings.xml
@@ -3,6 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.yunbao.live">
|
||||
<!--com.kugou.fanxing.allinone.watch.liveroominone.media.FALiveRoomInOneActivity"-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
||||
@@ -23,8 +23,10 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.WebViewActivity;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.event.CoinChangeEvent;
|
||||
@@ -51,7 +53,6 @@ import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.dialog.GiftPrizePoolFragment;
|
||||
import com.yunbao.live.dialog.LiveChatRoomDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveFansFragment;
|
||||
@@ -60,6 +61,7 @@ import com.yunbao.live.dialog.LiveGiveHotDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGuardBuyDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGuardDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveMicAnchorDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveMoreDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewGuardBuyDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewGuardListDialogFragment;
|
||||
@@ -96,13 +98,14 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/7.
|
||||
*/
|
||||
|
||||
public abstract class LiveActivity extends AbsActivity implements SocketMessageListener, LiveShareDialogFragment.ActionListener, KeyBoardHeightChangeListener {
|
||||
|
||||
public String anyway;
|
||||
public ViewGroup mContainer;
|
||||
protected ViewGroup mPageContainer;
|
||||
protected LiveRoomViewHolder mLiveRoomViewHolder;
|
||||
@@ -146,7 +149,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
// public static boolean isRy = true;
|
||||
private List<String> outRankHide = new ArrayList<>();
|
||||
private boolean outRankHideFirst = true;
|
||||
|
||||
protected TreeMap<String, LinkMicUserBean> mMicQueueList = new TreeMap<>();
|
||||
protected List<LiveUserGiftBean> mAudienceList = new ArrayList<>();
|
||||
protected LiveMicAnchorDialogFragment.OnMicListener micListener = null;
|
||||
@Override
|
||||
protected void main() {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
@@ -374,15 +379,11 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
*/
|
||||
@Override
|
||||
public void onSendGiftPk(long leftGift, long rightGift, LivePKUserListBean bean) {
|
||||
// if (isRy == false) {
|
||||
// if (mLiveLinkMicPkPresenter != null) {
|
||||
// mLiveLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
||||
// }
|
||||
// } else {
|
||||
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
mLiveRyLinkMicPkPresenter.onPkProgressChanged(leftGift, rightGift, bean);
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,9 +618,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
*/
|
||||
@Override
|
||||
public void onLinkMicAnchorPlayUrl(String pkUid, String playUrl) {
|
||||
if (LiveAudienceActivity.anyway == null) {
|
||||
if (anyway == null) {
|
||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, playUrl);
|
||||
} else if (mLiveLinkMicAnchorPresenter != null && LiveAudienceActivity.anyway.equals("0")) {
|
||||
} else if (mLiveLinkMicAnchorPresenter != null && anyway.equals("0")) {
|
||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, playUrl);
|
||||
}
|
||||
if (this instanceof LiveAudienceActivity) {
|
||||
@@ -843,13 +844,13 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
* 打开聊天输入框
|
||||
*/
|
||||
public void openChatWindow() {
|
||||
if (mKeyBoardHeightUtil == null) {
|
||||
mKeyBoardHeightUtil = new KeyBoardHeightUtil2(mContext, super.findViewById(android.R.id.content), this);
|
||||
mKeyBoardHeightUtil.start();
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.chatScrollToBottom();
|
||||
}
|
||||
// if (mKeyBoardHeightUtil == null) {
|
||||
// mKeyBoardHeightUtil = new KeyBoardHeightUtil2(mContext, super.findViewById(android.R.id.content), this);
|
||||
// mKeyBoardHeightUtil.start();
|
||||
// }
|
||||
// if (mLiveRoomViewHolder != null) {
|
||||
// mLiveRoomViewHolder.chatScrollToBottom();
|
||||
// }
|
||||
LiveInputDialogFragment fragment = new LiveInputDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice);
|
||||
@@ -1200,11 +1201,12 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
* 守护列表弹窗
|
||||
*/
|
||||
public void openNewGuardListWindow(boolean showBuyView) {
|
||||
openNewGuardListWindow(showBuyView,null);
|
||||
openNewGuardListWindow(showBuyView, null);
|
||||
}
|
||||
public void openNewGuardListWindow(boolean showBuyView,String uid) {
|
||||
if(uid==null){
|
||||
uid=mLiveUid;
|
||||
|
||||
public void openNewGuardListWindow(boolean showBuyView, String uid) {
|
||||
if (uid == null) {
|
||||
uid = mLiveUid;
|
||||
}
|
||||
LiveHttpUtil.getGuardList(uid, 1, new HttpCallback() {
|
||||
@Override
|
||||
@@ -1234,9 +1236,10 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
public void openFansWindow() {
|
||||
openFansWindow(null);
|
||||
}
|
||||
|
||||
public void openFansWindow(String uid) {
|
||||
if(uid==null){
|
||||
uid=mLiveUid;
|
||||
if (uid == null) {
|
||||
uid = mLiveUid;
|
||||
}
|
||||
LiveFansFragment fragment = new LiveFansFragment(mContext);
|
||||
Bundle bundle = new Bundle();
|
||||
@@ -1277,7 +1280,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
bundle.putBoolean("showBuyView", !showBuyView);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
|
||||
LiveUserMoreDialogFragment.activity = (LiveActivity) mContext;
|
||||
outRankHideFirst = false;
|
||||
}
|
||||
|
||||
@@ -1299,7 +1301,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
bundle.putString("outRankHide", GsonUtils.toJson(outRankHide));
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment");
|
||||
LiveUserMoreDialogFragment.activity = this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1556,6 +1557,41 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开连麦UI
|
||||
*/
|
||||
protected void openMicWindow(int index) {
|
||||
LiveMicAnchorDialogFragment fragment = new LiveMicAnchorDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.STREAM, mStream);
|
||||
bundle.putString("By", index + "");
|
||||
fragment.setArguments(bundle);
|
||||
micListener = fragment.getMicListener();
|
||||
fragment.setMicQueueList(mMicQueueList);
|
||||
fragment.setAudienceList(mAudienceList);
|
||||
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveMicAnchorDialogFragment");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取连麦列表
|
||||
*/
|
||||
public void showMicList(String uid,LiveRoomViewHolder mLiveRoomViewHolder) {
|
||||
LiveNetManager.get(mContext)
|
||||
.getDRMicUserList(uid, new com.yunbao.common.http.base.HttpCallback<List<LinkMicUserBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LinkMicUserBean> data) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.updataMicList(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
System.out.println("live.getDrLm error = " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
release();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.media.AudioManager;
|
||||
@@ -24,8 +22,6 @@ import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.core.view.WindowInsetsControllerCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -46,8 +42,10 @@ import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.SlideInfoModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.EffectsSettingsDialog;
|
||||
@@ -70,9 +68,12 @@ import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomDrawerPopupView;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.VerticalViewPager;
|
||||
@@ -98,6 +99,7 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -105,7 +107,6 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/10.
|
||||
@@ -115,9 +116,8 @@ import java.util.Map;
|
||||
public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
private static final String TAG = "LiveAudienceActivity";
|
||||
public static String anyway;
|
||||
|
||||
public JSONObject pkInfo;
|
||||
public static LiveAudienceActivity liveAudienceActivity;
|
||||
|
||||
// 竖直滑动 ViewPager
|
||||
private VerticalViewPager verticalViewPager;
|
||||
@@ -139,7 +139,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
private LiveBean mLiveBean;
|
||||
//当前直播间下标
|
||||
private int mCurrentItem, mCurrentPage;
|
||||
private static PortraitLiveManager manager;
|
||||
private PortraitLiveManager manager;
|
||||
private int mLastPosition = -1;
|
||||
|
||||
private ViewGroup mViewGroup;
|
||||
@@ -148,6 +148,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
private Handler liveHandler = new Handler();
|
||||
private ImageView voicePress;
|
||||
private View titleLine;
|
||||
private boolean liveIndex = true;
|
||||
|
||||
@Override
|
||||
public <T extends View> T findViewById(@IdRes int id) {
|
||||
@@ -164,7 +165,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
protected void main() {
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
liveAudienceActivity = this;
|
||||
CrashSaveBean.getInstance().addEnterRoom();
|
||||
mProcessResultUtil = new ProcessResultUtil(this);
|
||||
Intent intent = getIntent();
|
||||
@@ -172,15 +172,28 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
L.e(TAG, "直播sdk----->" + (mLiveSDK == Constants.LIVE_SDK_KSY ? "金山云" : "腾讯云"));
|
||||
mLiveType = intent.getIntExtra(Constants.LIVE_TYPE, Constants.LIVE_TYPE_NORMAL);
|
||||
mLiveTypeVal = intent.getIntExtra(Constants.LIVE_TYPE_VAL, 0);
|
||||
initView();
|
||||
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||
manager = new PortraitLiveManager(this, intent);
|
||||
mLiveBean = intent.getParcelableExtra(Constants.LIVE_BEAN);
|
||||
mLiveUid = mLiveBean.getUid();
|
||||
mStream = mLiveBean.getStream();
|
||||
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||
manager = new PortraitLiveManager(this, intent);
|
||||
initView();
|
||||
initData();
|
||||
MicStatusManager.getInstance().addOnMicListener(onMicStatusListener);
|
||||
}
|
||||
|
||||
private final MicStatusManager.OnMicStatusListener onMicStatusListener = new MicStatusManager.OnMicStatusListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
verticalViewPager.setEnableScroll(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
verticalViewPager.setEnableScroll(true);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化界面
|
||||
*/
|
||||
@@ -202,12 +215,12 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
manager.setBackIndex(backIndex);
|
||||
}
|
||||
|
||||
public static LiveRoomPlayViewHolder getmLivePlayViewHolder() {
|
||||
public LiveRoomPlayViewHolder getmLivePlayViewHolder() {
|
||||
|
||||
return manager == null ? null : manager.getmLivePlayViewHolder();
|
||||
}
|
||||
|
||||
public static void setCurrentItem(int index) {
|
||||
public void setCurrentItem(int index) {
|
||||
manager.mViewPager.setCurrentItem(index);
|
||||
}
|
||||
|
||||
@@ -224,11 +237,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
if (Micing == 1) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
|
||||
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
verticalViewPager.setEnableScroll(false);
|
||||
} else if (Micing == 2) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
verticalViewPager.setEnableScroll(false);
|
||||
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
|
||||
@@ -291,13 +304,13 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
});
|
||||
getDrawer();
|
||||
|
||||
}
|
||||
|
||||
private void loadData(ViewGroup viewGroup, int currentItem) {
|
||||
mViewGroup = viewGroup;
|
||||
mLastPosition = currentItem;
|
||||
liveHandler.post(liveRunnable);
|
||||
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
|
||||
|
||||
}
|
||||
|
||||
@@ -305,37 +318,46 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
private Runnable liveRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (itemModelList.size() <= mCurrentPage) {
|
||||
mCurrentPage = 0;
|
||||
}
|
||||
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
|
||||
if (mCurrentPage == 0 && liveIndex) {
|
||||
View rootView = manager.getRootView();
|
||||
if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {
|
||||
((ViewGroup) (rootView.getParent())).removeView(rootView);
|
||||
manager.onRemove(false);
|
||||
}
|
||||
mViewGroup.addView(manager.getRootView());
|
||||
mLiveUid = mLiveBean.getUid();
|
||||
mStream = mLiveBean.getStream();
|
||||
mAncherName = mLiveBean.getUserNiceName();
|
||||
mAncherIcon = mLiveBean.getAvatar();
|
||||
manager.onAdd(mLiveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||
//加载完页面后再后台静默下载礼物svga
|
||||
downloadAllGift();
|
||||
over();
|
||||
|
||||
//获取直播间状态
|
||||
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取直播间状态
|
||||
*/
|
||||
private HttpCallback liveInfo = new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
//主播正在直播
|
||||
if (liveBean1 == null) {
|
||||
return;
|
||||
}
|
||||
runOnUiThread(() -> {
|
||||
mLiveSDK = liveSdk;
|
||||
} else {
|
||||
new LiveRoomCheckLivePresenter(mContext, data.getUid(), data.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
liveIndex = false;
|
||||
try {
|
||||
mLiveSDK = Integer.parseInt(liveSdk);
|
||||
mLiveTypeVal = Integer.parseInt(liveTypeVal);
|
||||
} catch (NumberFormatException e) {
|
||||
mLiveSDK = 0;
|
||||
mLiveTypeVal = 0;
|
||||
}
|
||||
mLiveType = liveType;
|
||||
mLiveTypeVal = liveTypeVal;
|
||||
mLiveBean = liveBean1;
|
||||
mLiveUid = liveBean1.getUid();
|
||||
mStream = liveBean1.getStream();
|
||||
mAncherName = liveBean1.getUserNiceName();
|
||||
mAncherIcon = liveBean1.getAvatar();
|
||||
String json = GsonUtils.toJson(data);
|
||||
mLiveBean = GsonUtils.fromJson(json, LiveBean.class);
|
||||
mLiveBean.setUserNiceName(data.getUserNicename());
|
||||
mLiveUid = mLiveBean.getUid();
|
||||
mStream = mLiveBean.getStream();
|
||||
mAncherName = mLiveBean.getUserNiceName();
|
||||
mAncherIcon = mLiveBean.getAvatar();
|
||||
Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid);
|
||||
//加载当前页面数据
|
||||
View rootView = manager.getRootView();
|
||||
@@ -345,20 +367,19 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
mViewGroup.addView(manager.getRootView());
|
||||
|
||||
manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk);
|
||||
manager.onAdd(mLiveBean, liveType, mLiveTypeVal, mLiveSDK);
|
||||
//加载完页面后再后台静默下载礼物svga
|
||||
downloadAllGift();
|
||||
over();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
//主播未直播时自动下滑至下一个直播间
|
||||
verticalViewPager.setCurrentItem(mCurrentPage + 1);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -492,9 +513,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
public void onBackPressed() {
|
||||
try {
|
||||
manager.onBackPressed();
|
||||
if (Micing == 1) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else if (Micing == 2) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else {
|
||||
manager.onRemove(true);
|
||||
@@ -524,6 +545,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
super.onDestroy();
|
||||
ImgLoader.clearMemory(this);
|
||||
overridePendingTransition(0, 0);
|
||||
MicStatusManager.getInstance().removeOnMicListener(onMicStatusListener);
|
||||
Bus.getOff(this);
|
||||
L.e("LiveAudienceActivity-------onDestroy------->");
|
||||
}
|
||||
@@ -531,21 +553,30 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
manager.onPause();
|
||||
if (manager != null) {
|
||||
manager.onPause();
|
||||
}
|
||||
|
||||
GiftCacheUtil.getInstance().pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
manager.onStop();
|
||||
if (manager != null) {
|
||||
manager.onStop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点亮
|
||||
*/
|
||||
public void light() {
|
||||
manager.light();
|
||||
if (manager != null) {
|
||||
manager.light();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -553,21 +584,24 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
* 计时收费更新主播映票数
|
||||
*/
|
||||
public void roomChargeUpdateVotes() {
|
||||
manager.sendUpdateVotesMessage();
|
||||
if (manager != null)
|
||||
manager.sendUpdateVotesMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停播放
|
||||
*/
|
||||
public void pausePlay() {
|
||||
manager.pausePlay();
|
||||
if (manager != null)
|
||||
manager.pausePlay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复播放
|
||||
*/
|
||||
public void resumePlay() {
|
||||
manager.resumePlay();
|
||||
if (manager != null)
|
||||
manager.resumePlay();
|
||||
}
|
||||
|
||||
public CountDownTimer getCountDownTimer() {
|
||||
@@ -578,7 +612,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
* 充值成功
|
||||
*/
|
||||
public void onChargeSuccess() {
|
||||
manager.onChargeSuccess();
|
||||
if (manager != null)
|
||||
manager.onChargeSuccess();
|
||||
}
|
||||
|
||||
public void setCoinNotEnough(boolean coinNotEnough) {
|
||||
@@ -665,7 +700,9 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
manager.onResume();
|
||||
if (manager != null) {
|
||||
manager.onResume();
|
||||
}
|
||||
GiftCacheUtil.getInstance().restart();
|
||||
}
|
||||
|
||||
@@ -718,6 +755,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
list.remove(userIndex);
|
||||
}
|
||||
CustomDrawerPopupView customDrawerPopupView = new CustomDrawerPopupView(mContext).setList(list).setLiveId(mLiveBean.getUid());
|
||||
|
||||
customDrawerPopupView.setCallBack(new CustomDrawerPopupView.CustomDrawerPopupCallBack() {
|
||||
@Override
|
||||
public void funGamesID(int zfunGamesID) {
|
||||
@@ -734,7 +772,30 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
@Override
|
||||
public void goToLive(AnchorRecommendItemModel model) {
|
||||
//获取直播间状态
|
||||
LiveHttpUtil.getLiveInfo(model.getUid(), liveInfo);
|
||||
LiveHttpUtil.getLiveInfo(model.getUid(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
customDrawerPopupView.dismiss();
|
||||
}
|
||||
|
||||
@@ -838,7 +899,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Override
|
||||
public void onShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -944,6 +1004,10 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
if (event.getMicIng() == 1) {
|
||||
manager.micIngTypeOne(event.getBean(), event.getLiveType(), event.getLiveTypeVal());
|
||||
} else if (event.getMicIng() == 2) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
manager.micIngTypeTwo(event.getBean(), event.getLiveType(), event.getLiveTypeVal());
|
||||
} else {
|
||||
//获取房间连麦状态
|
||||
@@ -1020,9 +1084,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
break;
|
||||
case LIVE_ROOM_EXCEPTION:
|
||||
//主播未直播时自动下滑至下一个直播间
|
||||
itemModelList.remove(mCurrentPage);
|
||||
mPagerAdapter.notifyDataSetChanged();
|
||||
verticalViewPager.setCurrentItem(mCurrentPage + 1);
|
||||
mCurrentPage = mCurrentPage + 1;
|
||||
liveHandler.post(liveRunnable);
|
||||
break;
|
||||
case REFRESH_THE_LIVEl_PAGE:
|
||||
getDrawer();
|
||||
@@ -1100,7 +1163,72 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
case LUCKY_ANGEL:
|
||||
manager.luckyAngel(event.getMsgModel());
|
||||
break;
|
||||
|
||||
case LINK_MIC:
|
||||
if (!StringUtil.isEmpty(((LinkMicUserBean) event.getObject()).getUid())) {
|
||||
mMicQueueList.put(((LinkMicUserBean) event.getObject()).getUid(), (LinkMicUserBean) event.getObject());
|
||||
}
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
DialogUitl.showSimpleDialog(mContext,
|
||||
String.format(WordUtil.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()),
|
||||
new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
openMicWindow(2);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_CANCEL:
|
||||
mMicQueueList.remove(((LinkMicUserBean) event.getObject()).getUid());
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_UPDATE_MIC_LIST:
|
||||
List<LinkMicUserBean> list = (List<LinkMicUserBean>) event.getObject();
|
||||
mMicQueueList.clear();
|
||||
for (LinkMicUserBean bean : list) {
|
||||
if (!StringUtil.isEmpty(bean.getUid())) {
|
||||
mMicQueueList.put(bean.getUid(), bean);
|
||||
}
|
||||
}
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
}
|
||||
if (manager.mLiveRoomViewHolder != null) {
|
||||
manager.mLiveRoomViewHolder.updataMicList(list);
|
||||
Log.i("多人连麦", "onOpenDrawer: " + list.size());
|
||||
for (LinkMicUserBean userBean : list) {
|
||||
Log.i("多人连麦", "u list: " + userBean.toString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_UPDATE_AUDIENCE_LIST:
|
||||
mAudienceList = (List<LiveUserGiftBean>) event.getObject();
|
||||
if (micListener != null) {
|
||||
micListener.updateAudienceList(mAudienceList);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_CLOSE:
|
||||
if (manager.mLiveRoomViewHolder != null) {
|
||||
manager.mLiveRoomViewHolder.updataCleanMic();
|
||||
}
|
||||
break;
|
||||
case SOCKET_LIVE_DRPK_SET_PK_VIEW:
|
||||
ToastUtil.show("setPkView");
|
||||
if (manager.getmLivePlayViewHolder() != null) {
|
||||
manager.getmLivePlayViewHolder().setPkview();
|
||||
}
|
||||
break;
|
||||
case SOCKET_LIVE_DRPK_SET_PK_END_VIEW:
|
||||
ToastUtil.show("setPkEndview");
|
||||
if (manager.getmLivePlayViewHolder() != null) {
|
||||
manager.getmLivePlayViewHolder().setPkEndview();
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -1132,8 +1260,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
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 {
|
||||
@@ -1159,33 +1285,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
return super.canBackPressed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转当前页面
|
||||
*/
|
||||
public static void forward(Context context, LiveBean liveBean, int liveType,
|
||||
int liveTypeVal, String key, int position, int liveSdk) {
|
||||
forward(context, liveBean, liveType, liveTypeVal, key, null, position, liveSdk);
|
||||
}
|
||||
|
||||
public static void forward(Context context, LiveBean liveBean, int liveType,
|
||||
int liveTypeVal, String key, Map<String, String> map, int position, int liveSdk) {
|
||||
Intent intent = new Intent(context, LiveAudienceActivity.class);
|
||||
intent.putExtra(Constants.LIVE_BEAN, liveBean);
|
||||
intent.putExtra(Constants.LIVE_TYPE, liveType);
|
||||
intent.putExtra(Constants.LIVE_TYPE_VAL, liveTypeVal);
|
||||
intent.putExtra(Constants.LIVE_KEY, key);
|
||||
intent.putExtra(Constants.LIVE_POSITION, position);
|
||||
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
||||
intent.putExtra(Constants.LIVE_SDK, liveSdk);
|
||||
if (map != null) {
|
||||
for (String _key : map.keySet()) {
|
||||
intent.putExtra(_key, map.get(_key));
|
||||
}
|
||||
}
|
||||
intent.putExtra("landscape", liveBean.getLandscape());
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取侧边栏数据
|
||||
@@ -1212,6 +1311,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
public void onError(String error) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onFollowEvent(FollowEvent e) {
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.NotCancelableDialog;
|
||||
@@ -47,6 +48,7 @@ import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.BitmapUtil;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
@@ -56,6 +58,7 @@ import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LogUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.faceunity.FaceManager;
|
||||
@@ -63,7 +66,10 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveMicAnchorDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
||||
@@ -81,6 +87,7 @@ import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
|
||||
import com.yunbao.live.socket.SocketRyChatUtil;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.socket.SocketSendBean;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.live.views.LiveEndViewHolder;
|
||||
import com.yunbao.live.views.LiveMusicViewHolder;
|
||||
import com.yunbao.live.views.LiveNewReadyRyViewHolder;
|
||||
@@ -92,7 +99,9 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
@@ -144,7 +153,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
public static int backIndex = 0;//0=未判断,1=已判断
|
||||
private FaceManager manager;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_live_anchor;
|
||||
@@ -233,6 +241,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
int mrr = 0;
|
||||
public int leave = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(int functionID) {
|
||||
switch (functionID) {
|
||||
@@ -240,7 +249,8 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
ToastUtil.show("開發中,敬請期待");
|
||||
break;
|
||||
case Constants.LIVE_FUNC_MIC://語音
|
||||
ToastUtil.show("開發中,敬請期待");
|
||||
//ToastUtil.show("開發中,敬請期待");
|
||||
openMicWindow(1);
|
||||
break;
|
||||
case Constants.LIVE_FUNC_DR://多人PK
|
||||
if (isDRPK != 1) {
|
||||
@@ -386,6 +396,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 主播展示离开直播间
|
||||
*/
|
||||
@@ -899,6 +910,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
mLivePushViewHolder = null;
|
||||
mLiveReadyViewHolder = null;
|
||||
mLiveAnchorViewHolder = null;
|
||||
if (MicStatusManager.getInstance().isAnchorOpenRoom()) {
|
||||
MicStatusManager.getInstance().closeMic(mContext);
|
||||
}
|
||||
L.e("LiveAnchorActivity-------onDestroy------->");
|
||||
Bus.getOff(this);
|
||||
}
|
||||
@@ -1314,6 +1328,82 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
leaveLive();
|
||||
}
|
||||
break;
|
||||
case LINK_MIC:
|
||||
if (!StringUtil.isEmpty(((LinkMicUserBean) event.getObject()).getUid())) {
|
||||
mMicQueueList.put(((LinkMicUserBean) event.getObject()).getUid(), (LinkMicUserBean) event.getObject());
|
||||
}
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
DialogUitl.showSimpleDialog(mContext,
|
||||
String.format(WordUtil.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()),
|
||||
new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
openMicWindow(2);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_CANCEL:
|
||||
mMicQueueList.remove(((LinkMicUserBean) event.getObject()).getUid());
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_UPDATE_MIC_LIST:
|
||||
List<LinkMicUserBean> list = (List<LinkMicUserBean>) event.getObject();
|
||||
mMicQueueList.clear();
|
||||
for (LinkMicUserBean bean : list) {
|
||||
if (!StringUtil.isEmpty(bean.getUid())) {
|
||||
mMicQueueList.put(bean.getUid(), bean);
|
||||
}
|
||||
}
|
||||
if (micListener != null) {
|
||||
micListener.updateMicList(mMicQueueList);
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.updataMicList(list);
|
||||
Log.i("多人连麦", "onOpenDrawer: "+list.size());
|
||||
for (LinkMicUserBean userBean : list) {
|
||||
Log.i("多人连麦", "u list: "+userBean.toString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_UPDATE_AUDIENCE_LIST:
|
||||
mAudienceList = (List<LiveUserGiftBean>) event.getObject();
|
||||
if (micListener != null) {
|
||||
micListener.updateAudienceList(mAudienceList);
|
||||
}
|
||||
break;
|
||||
case LINK_MIC_CLOSE:
|
||||
if(mLiveRoomViewHolder!=null){
|
||||
mLiveRoomViewHolder.updataCleanMic();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 检查指定直播间连麦人数
|
||||
*
|
||||
* @param mLiveUid 直播间
|
||||
*/
|
||||
public static void checkMicUserLength(String mLiveUid, LiveFunctionClickListener listener) {
|
||||
LiveHttpUtil.getMicList(mLiveUid, 0, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
try {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
List<MicUserBean> list = JSON.parseArray(obj.getString("userlist"), MicUserBean.class);
|
||||
listener.onClick(list.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
@@ -24,8 +25,6 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
@@ -64,9 +63,6 @@ import io.rong.imlib.model.Message;
|
||||
import io.rong.message.RecallNotificationMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
public class MyTUIConversationFragment extends Fragment {
|
||||
|
||||
private LinearLayout lt_nodata_msg;
|
||||
@@ -168,18 +164,7 @@ public class MyTUIConversationFragment extends Fragment {
|
||||
mAdapter.setActionListener(new ImListAdapter.ActionListener() {
|
||||
@Override
|
||||
public void onItemClick(ImUserBean bean) {
|
||||
if (bean.getContent().equals("在線客服")) {
|
||||
mFirebaseAnalytics.logEvent("FS_customer_service", null);
|
||||
logger.logEvent("FB_customer_service");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
} else if (bean.getContent().equals("新手指導員")) {
|
||||
mFirebaseAnalytics.logEvent("FS_guide", null);
|
||||
logger.logEvent("FB_guide", null);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("m0nfpn");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
}
|
||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||
// startActivity(new Intent(getContext(), ZhuangBanActivity.class).putExtra("url", bean.getLink()));
|
||||
startActivity(new Intent(getContext(), WebViewActivity.class).putExtra("url", bean.getLink()));
|
||||
|
||||
@@ -17,6 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
@@ -25,8 +26,6 @@ import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.SystemChatMessageAdapter;
|
||||
import com.yunbao.live.bean.ImUserBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.event.RecommendLiveRoomEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -196,14 +195,18 @@ public class PDLIiveChatActivity extends FragmentActivity {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
if (liveBean1 == null) {
|
||||
return;
|
||||
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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
finish();
|
||||
});
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -18,18 +17,12 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.SelectImageActivity;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.bean.NoviceInstructorModel;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
@@ -111,18 +104,6 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
|
||||
}
|
||||
isAdmin = true;
|
||||
imgMore.setVisibility(View.GONE);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("exlgn3");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("exlgn3", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_read", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_read");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {//非指导员
|
||||
isAdmin = false;
|
||||
imgMore.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -140,7 +140,7 @@ public class WebViewActivityMedal extends AbsActivity {
|
||||
}
|
||||
|
||||
});
|
||||
mWebView.addJavascriptInterface( JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView), "androidObject");
|
||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(mContext, mWebView), "androidObject");
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
@@ -166,10 +166,18 @@ public class WebViewActivityMedal extends AbsActivity {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
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));
|
||||
}
|
||||
|
||||
LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0);
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
@@ -29,8 +27,6 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
@@ -57,6 +53,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
;
|
||||
|
||||
@Route(path = RouteUtil.PATH_LiveZHUANGBANACTIVITY)
|
||||
public class ZhuangBanActivity extends AbsActivity {
|
||||
|
||||
@@ -97,9 +95,6 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
} else {
|
||||
if (TextUtils.equals(titleString, "blank")) {
|
||||
title.setVisibility(View.GONE);
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) rootView.getLayoutParams();
|
||||
params.topMargin = DpUtil.dp2px(24);
|
||||
rootView.setLayoutParams(params);
|
||||
} else {
|
||||
title.setVisibility(View.VISIBLE);
|
||||
titleView.setText(titleString);
|
||||
@@ -152,9 +147,9 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
// 这个方法在6.0才出现
|
||||
int statusCode = errorResponse.getStatusCode();
|
||||
if (404 == statusCode || 500 == statusCode) {
|
||||
if ( !request.getUrl().toString().contains("favicon")){
|
||||
if (!request.getUrl().toString().contains("favicon")) {
|
||||
htmlError.setVisibility(View.VISIBLE);
|
||||
htmlError.setText("errorCode:" + statusCode +"\n failingUrl:" + request.getUrl());
|
||||
htmlError.setText("errorCode:" + statusCode + "\n failingUrl:" + request.getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -374,11 +369,6 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "AndroidAdjustConsume")) {
|
||||
mFirebaseAnalytics.logEvent("FS_event_interaction", null);
|
||||
logger.logEvent("FB_event_interaction", null);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("rq2c5n");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.interfaces.LiveFunctionClickListener;
|
||||
import com.yunbao.live.socket.SocketSendBean;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
|
||||
public static final int TYPE_MIC_LIST = 1;//连麦列表
|
||||
public static final int TYPE_MIC_REQUEST = 2;//请求连麦
|
||||
public static final int TYPE_MIC_INVITE = 3;//邀请连麦
|
||||
|
||||
private AbsDialogFragment fragments;
|
||||
private CommonRefreshView refreshView;
|
||||
private String mLiveUid;
|
||||
|
||||
public AnchorUserMicInfoAdapter(Context context, AbsDialogFragment fragment) {
|
||||
super(context);
|
||||
this.fragments = fragment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setRefreshView(CommonRefreshView refreshView) {
|
||||
this.refreshView = refreshView;
|
||||
}
|
||||
|
||||
public void setLiveUid(String mLiveUid) {
|
||||
this.mLiveUid = mLiveUid;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
return new AnchorUserMicInfoAdapter.Vh(mInflater.inflate(R.layout.item_anchor_mic_info, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
// vh.setIsRecyclable(false);
|
||||
((AnchorUserMicInfoAdapter.Vh) vh).setData(mList.get(position), position);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
ImageView mAvatar;
|
||||
TextView mName;
|
||||
ImageView mSex;
|
||||
ImageView mLevel;
|
||||
ImageView mClose;
|
||||
SVGAImageView gift_svga;
|
||||
Button mBtn;
|
||||
|
||||
public Vh(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
|
||||
mName = (TextView) itemView.findViewById(R.id.name);
|
||||
mSex = (ImageView) itemView.findViewById(R.id.sex);
|
||||
mLevel = (ImageView) itemView.findViewById(R.id.level);
|
||||
gift_svga = (SVGAImageView) itemView.findViewById(R.id.gift_svga);
|
||||
mBtn = itemView.findViewById(R.id.mic_btn);
|
||||
mClose = itemView.findViewById(R.id.mic_exit);
|
||||
mBtn.setOnClickListener(v -> {
|
||||
if (v.getTag() != null) {
|
||||
MicUserBean tag = (MicUserBean) v.getTag();
|
||||
LiveRyAnchorActivity.checkMicUserLength(mLiveUid, new LiveFunctionClickListener() {
|
||||
@Override
|
||||
public void onClick(int length) {
|
||||
//只允许最多3人连麦(加主播4人)
|
||||
if (length <= 4) {
|
||||
if (tag.getType() == TYPE_MIC_REQUEST) {
|
||||
applyMic(tag, 4, createSocketSendBean());
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_mic_request));
|
||||
} else if (tag.getType() == TYPE_MIC_INVITE) {
|
||||
SocketSendBean bean = createSocketSendBean().param("targetId", tag.getId());
|
||||
applyMic(tag, 1, bean);
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_mic_invite));
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_mic_max));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
mClose.setOnClickListener(v -> {
|
||||
if (v.getTag() != null) {
|
||||
API.get().createPDLiveApi(true)
|
||||
.killDrLm(((MicUserBean) v.getTag()).getId(), mLiveUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<BaseModel> stringResponseModel) throws Exception {
|
||||
applyMic((MicUserBean) v.getTag(), 8, createSocketSendBean());
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_mic_user_down));
|
||||
}
|
||||
}, Throwable::printStackTrace).isDisposed();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
SocketSendBean createSocketSendBean() {
|
||||
return new SocketSendBean()
|
||||
.param("_method_", Constants.LIAN_MAI)
|
||||
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||
.param("avatar", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("uid", CommonAppConfig.getInstance().getUid());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送IM消息
|
||||
* @param action 4为同意请求,1为邀请,其余见 {@link com.yunbao.live.socket.SocketRyClient} Constants.LIAN_MAI解析
|
||||
*/
|
||||
void applyMic(MicUserBean bean, int action, SocketSendBean msg) {
|
||||
msg.param("action", action);
|
||||
msg.create();
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(bean.getId(), conversationType, messageContent);
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||
Log.e("ry", "发送成功");
|
||||
refreshView.initData();
|
||||
IMCenter.getInstance().deleteRemoteMessages(Conversation.ConversationType.PRIVATE, message.getTargetId(), new Message[]{message}, null);
|
||||
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, message.getTargetId(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||
Log.e("ry", "发送失敗" + errorCode.toString());
|
||||
refreshView.initData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void setData(final MicUserBean bean, int position) {
|
||||
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((LiveActivity) mContext).showUserDialog(bean.getId());
|
||||
fragments.dismiss();
|
||||
}
|
||||
});
|
||||
mClose.setTag(bean);
|
||||
mBtn.setTag(bean);
|
||||
switch (bean.getType()) {
|
||||
case TYPE_MIC_LIST:
|
||||
mClose.setVisibility(View.VISIBLE);
|
||||
mBtn.setVisibility(View.GONE);
|
||||
break;
|
||||
case TYPE_MIC_REQUEST:
|
||||
case TYPE_MIC_INVITE:
|
||||
mClose.setVisibility(View.GONE);
|
||||
mBtn.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
if (bean.getType() == TYPE_MIC_REQUEST) {
|
||||
mBtn.setText("同意");
|
||||
mBtn.setBackgroundResource(R.drawable.bg_anchor_mic_info_btn_ok);
|
||||
} else if (bean.getType() == TYPE_MIC_INVITE) {
|
||||
mBtn.setText("邀请");
|
||||
mBtn.setBackgroundResource(R.drawable.bg_anchor_mic_info_btn_invite);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
|
||||
if (bean.getDress_avatar() != null) {
|
||||
if (bean.getDress_avatar().contains("svga")) {
|
||||
try {
|
||||
new SVGAParser(mContext).parse(new URL(bean.getDress_avatar()), new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
gift_svga.setImageDrawable(drawable);
|
||||
SVGAViewUtils.playEndClear(gift_svga);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
}
|
||||
});
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
ImgLoader.display(mContext, bean.getDress_avatar(), gift_svga);
|
||||
}
|
||||
}
|
||||
|
||||
mName.setText(bean.getUserNiceName());
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -319,17 +319,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
} else if (bean.getType() == -2) {//自动消息,点击发言
|
||||
boolean isContains = false;
|
||||
for (LiveChatBean model : mList) {
|
||||
if (bean.getType() == -2) {
|
||||
isContains = true;
|
||||
}
|
||||
}
|
||||
if (isContains) {
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(R.string.automatic_chat);
|
||||
bean.setHeart(position);
|
||||
}
|
||||
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(R.string.automatic_chat);
|
||||
bean.setHeart(position);
|
||||
} else if (bean.getType() == MSG_HOUR_RANK_CHANGE) {
|
||||
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
|
||||
mTextView.setText(bean.getContent());
|
||||
@@ -388,7 +381,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
mList.add(bean);
|
||||
|
||||
if (isSlideToBottom(mRecyclerView)) {
|
||||
mRecyclerView.scrollToPosition(getItemCount() - 1);
|
||||
scrollToBottom(mRecyclerView);
|
||||
} else {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.NEW_MESSAGE_REMINDER));
|
||||
@@ -403,6 +396,19 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
|
||||
}
|
||||
|
||||
private void scrollToBottom(final RecyclerView recyclerView) {
|
||||
// scroll to last item to get the view of last item
|
||||
final LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
||||
final int lastItemPosition = getItemCount() - 1;
|
||||
recyclerView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layoutManager.scrollToPositionWithOffset(lastItemPosition, Integer.MIN_VALUE);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否滚到底部
|
||||
*
|
||||
@@ -411,8 +417,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
*/
|
||||
public boolean isSlideToBottom(RecyclerView recyclerView) {
|
||||
if (recyclerView == null) return false;
|
||||
if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset()
|
||||
>= recyclerView.computeVerticalScrollRange())
|
||||
if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset() >= recyclerView.computeVerticalScrollRange())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Shader;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -34,8 +40,9 @@ public class LiveNewGuardBuyItemsAdapter extends RecyclerView.Adapter<LiveNewGua
|
||||
public void setItems(List<GuardBuyBean> items) {
|
||||
this.items = items;
|
||||
}
|
||||
public void setOnItemSelectListener(OnItemSelectListener listener){
|
||||
this.itemSelect=listener;
|
||||
|
||||
public void setOnItemSelectListener(OnItemSelectListener listener) {
|
||||
this.itemSelect = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -75,10 +82,10 @@ public class LiveNewGuardBuyItemsAdapter extends RecyclerView.Adapter<LiveNewGua
|
||||
|
||||
buyButton.setOnClickListener(view -> {
|
||||
buyButton.setBackgroundResource(R.drawable.img_k_selected);
|
||||
changeItem((int)title.getTag());
|
||||
changeItem((int) title.getTag());
|
||||
notifyDataSetChanged();
|
||||
if(itemSelect!=null){
|
||||
itemSelect.onSelectId((int)title.getTag());
|
||||
if (itemSelect != null) {
|
||||
itemSelect.onSelectId((int) title.getTag());
|
||||
}
|
||||
|
||||
});
|
||||
@@ -87,13 +94,32 @@ public class LiveNewGuardBuyItemsAdapter extends RecyclerView.Adapter<LiveNewGua
|
||||
private void setData(GuardBuyBean bean, int id) {
|
||||
String coin = bean.getCoin() + "";
|
||||
title.setText(bean.getName());
|
||||
if (getAbsoluteAdapterPosition() == 2) {//全年守护要渐变色
|
||||
int[] colors = {
|
||||
Color.parseColor("#E38100"),
|
||||
Color.parseColor("#F1B868"),
|
||||
Color.parseColor("#DA9505"),
|
||||
Color.parseColor("#FDB871"),
|
||||
Color.parseColor("#E57810")
|
||||
};
|
||||
float[] position = {
|
||||
0f,
|
||||
0.2f,
|
||||
0.4f,
|
||||
0.8f,
|
||||
1.0f
|
||||
};
|
||||
LinearGradient mLinearGradient = new LinearGradient(0, 0, title.getPaint().getTextSize() * title.getText().length(), 0, colors, position, Shader.TileMode.CLAMP);
|
||||
title.getPaint().setShader(mLinearGradient);
|
||||
title.invalidate();
|
||||
}
|
||||
title.setTag(id);
|
||||
String msgText = WordUtil.getString(R.string.buy_guard_back_coin);
|
||||
msg.setText(msgText + coin);
|
||||
this.coin.setText(coin);
|
||||
if(id==selectId){
|
||||
if (id == selectId) {
|
||||
buyButton.setBackgroundResource(R.drawable.img_k_selected);
|
||||
}else {
|
||||
} else {
|
||||
buyButton.setBackgroundResource(R.drawable.img_k_uncheck);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -117,7 +117,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter<LiveUserAdapter.Vh> {
|
||||
ImgLoader.display2(mContext, userBean.getAvatar(), mAvatar,100,100);
|
||||
// ImageLoadUtils.loadUrl(userBean.getAvatar(),32,32,mAvatar);
|
||||
}
|
||||
|
||||
gift_svga.setImageDrawable(null);
|
||||
if (userBean.getDress() != null) {
|
||||
if (userBean.getDress().getAvatar_frame().contains("svga")) {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -11,8 +12,6 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
@@ -50,6 +49,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
|
||||
return new SystemChatMessageViewHolder(mInflater.inflate(R.layout.view_system_message_item, parent, false));
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
ImUserBean model = listUserBean.get(position);
|
||||
@@ -90,8 +90,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter {
|
||||
if (model1.getContent().equals("在線客服")) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("ww5z2p");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
|
||||
}
|
||||
if (!TextUtils.isEmpty(model1.getLink())) {
|
||||
mContext.startActivity(new Intent(mContext, WebViewActivity.class).putExtra("url", model1.getLink()));
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.View;
|
||||
@@ -24,7 +23,7 @@ import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.bean.MicUserBean;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserRankBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -35,7 +36,6 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
@@ -153,7 +153,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
title.setVisibility(View.GONE);
|
||||
title1.setVisibility(View.GONE);
|
||||
Log.i("tag", "" + num);
|
||||
ivIcon.setVisibility(View.VISIBLE);
|
||||
ivIcon.setVisibility(View.GONE);
|
||||
mIcon.setImageBitmap(null);
|
||||
|
||||
tvName.setVisibility(View.GONE);
|
||||
@@ -175,7 +175,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
if (guardType == Constants.GUARD_TYPE_DAY) {
|
||||
mIcon.setImageDrawable(mGuardDrawable0);
|
||||
} else if (guardType == Constants.GUARD_TYPE_MONTH) {
|
||||
mIcon.setImageDrawable(mGuardDrawable1);
|
||||
// mIcon.setImageDrawable(mGuardDrawable1); //观众列表不显示粉丝牌
|
||||
} else if (guardType == Constants.GUARD_TYPE_YEAR) {
|
||||
mIcon.setImageDrawable(mGuardDrawable2);
|
||||
}
|
||||
@@ -206,8 +206,13 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
ImgLoader.displayDrawable(mContext, bean.getFans_pic(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
RelativeLayout.LayoutParams ivLayoutParams = (RelativeLayout.LayoutParams) ivIcon.getLayoutParams();
|
||||
ivLayoutParams.height = DpUtil.dp2px(40);
|
||||
ivLayoutParams.width = DpUtil.dp2px(70);
|
||||
ivIcon.setLayoutParams(ivLayoutParams);
|
||||
ivIcon.setImageDrawable(drawable);
|
||||
tvName.setText(bean.getMedal_name());
|
||||
tvName.setTextSize(9);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,6 +225,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
tvName.setText(((LiveUserRankBean) bean).getTotal() + "");
|
||||
tvName.setTextColor(Color.parseColor("#9E9E9E"));
|
||||
tvName.setTextSize(12);
|
||||
|
||||
switch (position) {
|
||||
case 0:
|
||||
rankImage.setImageResource(R.mipmap.day_list_no_1);
|
||||
|
||||
@@ -55,7 +55,6 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter
|
||||
ImageView ivLoading = view.findViewById(R.id.iv_loading);
|
||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||
frameAnimation.start();
|
||||
// ImgLoader.displayGif(mContext, R.drawable.live_loading, ivLoading);
|
||||
view.setId(position);
|
||||
container.addView(view);
|
||||
return view;
|
||||
@@ -63,6 +62,7 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
container.removeView(container.findViewById(position));
|
||||
|
||||
// container.removeView(container.findViewById(position));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.live.bean;
|
||||
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/12.
|
||||
*/
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.yunbao.live.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/27.
|
||||
* 直播间用户列表实体类
|
||||
*/
|
||||
|
||||
public class LiveUserGiftBean extends UserBean {
|
||||
|
||||
private String contribution;
|
||||
private int guardType;
|
||||
private int nub;
|
||||
|
||||
|
||||
|
||||
public int getNub() {
|
||||
return nub;
|
||||
}
|
||||
|
||||
public void setNub(int nub) {
|
||||
this.nub = nub;
|
||||
}
|
||||
|
||||
public String getContribution() {
|
||||
return contribution;
|
||||
}
|
||||
|
||||
public void setContribution(String contribution) {
|
||||
this.contribution = contribution;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否送过礼物
|
||||
*/
|
||||
public boolean hasContribution() {
|
||||
return !TextUtils.isEmpty(this.contribution) && !"0".equals(this.contribution);
|
||||
}
|
||||
|
||||
@JSONField(name = "guard_type")
|
||||
public int getGuardType() {
|
||||
return guardType;
|
||||
}
|
||||
|
||||
@JSONField(name = "guard_type")
|
||||
public void setGuardType(int guardType) {
|
||||
this.guardType = guardType;
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.yunbao.live.bean;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class MicUserBean {
|
||||
protected String id;
|
||||
protected String userNiceName;
|
||||
protected String avatar;
|
||||
protected int level;
|
||||
protected int sex;
|
||||
protected String dress_avatar;
|
||||
|
||||
@JSONField(name = "dress_avatar")
|
||||
public String getDress_avatar() {
|
||||
return dress_avatar;
|
||||
}
|
||||
@JSONField(name = "dress_avatar")
|
||||
public void setDress_avatar(String dress_avatar) {
|
||||
this.dress_avatar = dress_avatar;
|
||||
}
|
||||
|
||||
@JSONField(name = "level")
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
@JSONField(name = "level")
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
@JSONField(name = "sex")
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
@JSONField(name = "sex")
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
@JSONField(name = "user_nicename")
|
||||
public String getUserNiceName() {
|
||||
return userNiceName;
|
||||
}
|
||||
|
||||
@JSONField(name = "user_nicename")
|
||||
public void setUserNiceName(String userNiceName) {
|
||||
this.userNiceName = userNiceName;
|
||||
}
|
||||
|
||||
@JSONField(name = "id")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JSONField(name = "id")
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JSONField(name = "avatar")
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
@JSONField(name = "avatar")
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
@@ -22,8 +20,6 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
@@ -47,11 +43,9 @@ 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.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -293,8 +287,6 @@ public class LiveGameDialogFragment extends AbsDialogFragment {
|
||||
}
|
||||
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
if (!TextUtils.equals(roomId, live_id)) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -302,20 +294,17 @@ public class LiveGameDialogFragment extends AbsDialogFragment {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
@@ -368,11 +357,6 @@ public class LiveGameDialogFragment extends AbsDialogFragment {
|
||||
if (event.getData() != null && !event.getData().isEmpty()) {
|
||||
onTrickerySendGiftInto(new JsWishBean(event.getData()));
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "AndroidAdjustPrank")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("v1nekv");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_prank_interaction", null);
|
||||
logger.logEvent("FB_prank_interaction", null);
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodClickUser")) {
|
||||
if (!(mContext instanceof LiveRyAnchorActivity)) {
|
||||
//点击用户头像
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.bean1;
|
||||
|
||||
@@ -32,8 +30,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -148,7 +145,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = DpUtil.dp2px(350);
|
||||
params.height = DpUtil.dp2px(355);
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
@@ -251,7 +248,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
mVipGoldTitle = mRootView.findViewById(R.id.vipGoldTitle);
|
||||
mVipGoldDesc = mRootView.findViewById(R.id.vipGoldDesc);
|
||||
mVipGold.setOnClickListener(this);
|
||||
mGiftPackage= mRootView.findViewById(R.id.btn_gift_package);
|
||||
mGiftPackage = mRootView.findViewById(R.id.btn_gift_package);
|
||||
mGiftPackage.setOnClickListener(this);
|
||||
mRootView.findViewById(R.id.live_gift_download_all).setOnClickListener(this);
|
||||
mHandler = new Handler() {
|
||||
@@ -295,7 +292,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
JSONObject user = JSONObject.parseObject(info[0]);
|
||||
int nobleId = user.getIntValue("noble_id");
|
||||
int resId = NobleUtil.nobleIdToImageResId(nobleId);
|
||||
if(resId!=-1){
|
||||
if (resId != -1) {
|
||||
mVipGoldIcon.setImageResource(resId);
|
||||
mVipGoldTitle.setText(user.getString("noble_name"));
|
||||
mVipGoldDesc.setText(R.string.live_gift_buy_gold_desc_to);
|
||||
@@ -385,7 +382,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
String giftJson = obj.getString("giftlist");
|
||||
List<LiveGiftBean> list = JSON.parseArray(giftJson, LiveGiftBean.class);
|
||||
GiftCacheUtil.getInstance().addDownloadList(list);
|
||||
if(!GiftCacheUtil.getInstance().isDownloading()){
|
||||
if (!GiftCacheUtil.getInstance().isDownloading()) {
|
||||
GiftCacheUtil.getInstance().downloadAllGift();
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
@@ -405,7 +402,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
|
||||
private void showGiftList(List<LiveGiftBean> list) {
|
||||
if (bean1!=null&&IMLoginManager.get(mContext).isNewUserGif() && (type_name.equals("熱門") || type_name.equals("Hot"))) {
|
||||
if (bean1 != null && IMLoginManager.get(mContext).isNewUserGif() && (type_name.equals("熱門") || type_name.equals("Hot"))) {
|
||||
list.add(0, bean1);
|
||||
if (mWishGiftId == null) {
|
||||
mWishGiftId = "" + bean1.getId();
|
||||
@@ -503,11 +500,11 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
} else if (i == R.id.btn_choose) {
|
||||
showGiftCount();
|
||||
} else if (i == R.id.coin) {
|
||||
forwardMyCoin();
|
||||
forwardMyCoin(0);
|
||||
} else if (i == R.id.goldCoin) {
|
||||
forwardMyCoin();
|
||||
forwardMyCoin(2);
|
||||
} else if (i == R.id.go_charge) {
|
||||
forwardMyCoin();
|
||||
forwardMyCoin(0);
|
||||
} else if (i == R.id.btn_luck_gift_tip) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openLuckGiftTip();
|
||||
@@ -556,10 +553,10 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
/**
|
||||
* 跳转到我的钻石
|
||||
*/
|
||||
private void forwardMyCoin() {
|
||||
private void forwardMyCoin(int page) {
|
||||
dismiss();
|
||||
//我们的
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", page).navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -709,6 +706,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
/**
|
||||
* 收到礼物下载完成的通知
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -727,10 +725,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_present_interaction", null);
|
||||
logger.logEvent("FB_present_interaction");
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("22x4u2");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
if (mLiveGiftBean.getSwf().contains("svga")) {
|
||||
LiveGiftDialogFragment.this.dismiss();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
@@ -28,8 +26,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.Constants;
|
||||
@@ -41,6 +37,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
@@ -63,6 +60,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
private String roomId;
|
||||
private DialogInterface.OnShowListener listener;
|
||||
private TextView htmlError;
|
||||
private boolean isSetHeight =false;
|
||||
|
||||
public LiveHDDialogFragment() {
|
||||
|
||||
@@ -176,6 +174,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (bundle.getInt("height", -1) != -1) {
|
||||
isSetHeight =true;
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
|
||||
mWebView.setLayoutParams(params);
|
||||
}
|
||||
@@ -196,7 +195,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth)");
|
||||
if(!isSetHeight) {
|
||||
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onShow(LiveHDDialogFragment.this.getDialog());
|
||||
listener = null;
|
||||
@@ -209,9 +210,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
// 这个方法在6.0才出现
|
||||
int statusCode = errorResponse.getStatusCode();
|
||||
if (404 == statusCode || 500 == statusCode) {
|
||||
if ( !request.getUrl().toString().contains("favicon")){
|
||||
if (!request.getUrl().toString().contains("favicon")) {
|
||||
htmlError.setVisibility(View.VISIBLE);
|
||||
htmlError.setText("errorCode:" + statusCode +"\n failingUrl:" + request.getUrl());
|
||||
htmlError.setText("errorCode:" + statusCode + "\n failingUrl:" + request.getUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,7 +230,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
}
|
||||
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
if (!TextUtils.equals(roomId, live_id)) {
|
||||
@@ -238,20 +238,25 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id, 0);
|
||||
}
|
||||
@@ -313,11 +318,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
||||
if (event.getData() != null && !event.getData().isEmpty()) {
|
||||
onTrickerySendGiftInto(new JsWishBean(event.getData()));
|
||||
}
|
||||
} else if (TextUtils.equals(event.getMethod(), "AndroidAdjustPrank")) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("v1nekv");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_prank_interaction", null);
|
||||
logger.logEvent("FB_prank_interaction", null);
|
||||
} else if (TextUtils.equals(event.getMethod(), "androidMethodClickUser")) {
|
||||
//点击用户头像
|
||||
if (!(mContext instanceof LiveRyAnchorActivity)) {
|
||||
|
||||
@@ -238,6 +238,9 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
case GENERALMESSAGE:
|
||||
((LiveActivity) mContext).sendChatMessage(content, atTextWatcher.getAtUserID(), atTextWatcher.getAtUserName());
|
||||
atTextWatcher.clearMsg();
|
||||
if (imm != null) {
|
||||
imm.hideSoftInputFromWindow(mInput.getWindowToken(), 0);
|
||||
}
|
||||
dismiss();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,383 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Dialog;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.adapter.AnchorUserMicInfoAdapter;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 连麦列表
|
||||
* 主播端
|
||||
*/
|
||||
public class LiveMicAnchorDialogFragment extends AbsDialogFragment implements View.OnClickListener {
|
||||
|
||||
private CommonRefreshView mRefreshView;
|
||||
private View view_no;
|
||||
private AnchorUserMicInfoAdapter userMicInfoAdapter;
|
||||
private String mLiveUid;
|
||||
private String stream;
|
||||
private LiveGuardInfo mLiveGuardInfo;
|
||||
public static LiveActivity activity = null;
|
||||
public eightbitlab.com.blurview.BlurView blurView;
|
||||
|
||||
public TextView listMicbtn, requestMicBtn, inviteMicBtn, mDisconnectMic;
|
||||
private TextView mNoMoreDesc;
|
||||
private String Tips = "1";
|
||||
private String type = "guanzhong";
|
||||
View mOpenMicLayout, no_more;
|
||||
View mOpenMicBtn;
|
||||
private TreeMap<String, LinkMicUserBean> mMicQueueList = new TreeMap<>();
|
||||
private List<LiveUserGiftBean> mAudienceList = new ArrayList<>();
|
||||
private LiveImDeletUtil liveImDeletUtil;
|
||||
private OnMicListener micListener;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_anchor_mic_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = ActionBar.LayoutParams.MATCH_PARENT;
|
||||
params.height = DpUtil.dp2px(460);
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
public void setLiveGuardInfo(LiveGuardInfo info) {
|
||||
mLiveGuardInfo = info;
|
||||
}
|
||||
|
||||
public void setMicQueueList(TreeMap<String, LinkMicUserBean> mMicQueueList) {
|
||||
this.mMicQueueList = mMicQueueList;
|
||||
}
|
||||
|
||||
public void setAudienceList(List<LiveUserGiftBean> mAudienceList) {
|
||||
this.mAudienceList = mAudienceList;
|
||||
}
|
||||
|
||||
public OnMicListener getMicListener() {
|
||||
if (micListener == null) {
|
||||
micListener = new OnMicListener() {
|
||||
@Override
|
||||
public void updateMicList(TreeMap<String, LinkMicUserBean> list) {
|
||||
mMicQueueList = list;
|
||||
if ("2".equals(Tips)) {
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAudienceList(List<LiveUserGiftBean> list) {
|
||||
mAudienceList = list;
|
||||
if ("3".equals(Tips)) {
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return micListener;
|
||||
}
|
||||
|
||||
int nums = 0;
|
||||
int pg = 1;
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
liveImDeletUtil = new LiveImDeletUtil();
|
||||
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
stream = bundle.getString(Constants.STREAM);
|
||||
listMicbtn = mRootView.findViewById(R.id.audience_btn);
|
||||
mOpenMicLayout = mRootView.findViewById(R.id.anchor_open_mic);
|
||||
no_more = mRootView.findViewById(R.id.no_more);
|
||||
mOpenMicBtn = mRootView.findViewById(R.id.open_mic);
|
||||
mNoMoreDesc = mRootView.findViewById(R.id.no_more_desc);
|
||||
Tips = bundle.getString("By");
|
||||
|
||||
listMicbtn.setOnClickListener(view -> {
|
||||
if (!MicStatusManager.getInstance().isAnchorOpenRoom()) {
|
||||
return;
|
||||
}
|
||||
Tips = "1";
|
||||
Up();
|
||||
type = "guanzhong";
|
||||
mRefreshView.initData();
|
||||
});
|
||||
requestMicBtn = mRootView.findViewById(R.id.guard_btn);
|
||||
requestMicBtn.setOnClickListener(view -> {
|
||||
if (!MicStatusManager.getInstance().isAnchorOpenRoom()) {
|
||||
return;
|
||||
}
|
||||
Tips = "2";
|
||||
Up();
|
||||
type = "guard";
|
||||
mRefreshView.initData();
|
||||
});
|
||||
inviteMicBtn = mRootView.findViewById(R.id.fans_btn);
|
||||
inviteMicBtn.setVisibility(View.VISIBLE);
|
||||
inviteMicBtn.setOnClickListener(view -> {
|
||||
if (!MicStatusManager.getInstance().isAnchorOpenRoom()) {
|
||||
return;
|
||||
}
|
||||
Tips = "3";
|
||||
Up();
|
||||
type = "fans";
|
||||
mRefreshView.initData();
|
||||
});
|
||||
mOpenMicBtn.setOnClickListener(v -> {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.createDrLm()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<BaseModel>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<BaseModel> stringResponseModel) throws Exception {
|
||||
mOpenMicLayout.setVisibility(View.GONE);
|
||||
mRefreshView.setVisibility(View.VISIBLE);
|
||||
mDisconnectMic.setVisibility(View.VISIBLE);
|
||||
MicStatusManager.getInstance().setAnchorOpenRoom(true);
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}, Throwable::printStackTrace)
|
||||
.isDisposed();
|
||||
});
|
||||
|
||||
mRefreshView = mRootView.findViewById(R.id.refreshView);
|
||||
view_no = mRootView.findViewById(R.id.view_no);
|
||||
mDisconnectMic = mRootView.findViewById(R.id.apply_btn);
|
||||
mDisconnectMic.setBackgroundResource(R.drawable.background_eb6877);
|
||||
mDisconnectMic.setText(R.string.close_mic);
|
||||
mDisconnectMic.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DialogUitl.showSimpleDialog(mContext, "是否確認關閉語音連麥", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
MicStatusManager.getInstance().closeMic(mContext);
|
||||
LiveMicAnchorDialogFragment.this.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
userMicInfoAdapter = new AnchorUserMicInfoAdapter(mContext, LiveMicAnchorDialogFragment.this);
|
||||
userMicInfoAdapter.setLiveUid(mLiveUid);
|
||||
userMicInfoAdapter.setRefreshView(mRefreshView);
|
||||
Up();
|
||||
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<MicUserBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<MicUserBean> getAdapter() {
|
||||
userMicInfoAdapter.notifyDataSetChanged();
|
||||
return userMicInfoAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, HttpCallback callback) {
|
||||
Log.e("tag111", p + "ssss");
|
||||
LiveHttpUtil.getMicList(mLiveUid, p, callback);
|
||||
pg = p;
|
||||
if (p == 1) {
|
||||
no_more.setVisibility(View.VISIBLE);
|
||||
mRefreshView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MicUserBean> processData(String[] info) {
|
||||
Log.e("tag222", Tips + "ssss" + MicStatusManager.getInstance().toString());
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
List<MicUserBean> data = new ArrayList<>();
|
||||
|
||||
if (Tips.equals("2")) {
|
||||
for (String uid : mMicQueueList.keySet()) {
|
||||
LinkMicUserBean userBean = mMicQueueList.get(uid);
|
||||
MicUserBean bean = new MicUserBean();
|
||||
bean.setAvatar(userBean.getAvatar());
|
||||
bean.setId(uid);
|
||||
bean.setUserNiceName(userBean.getUname());
|
||||
bean.setSex(userBean.getSex());
|
||||
bean.setDress_avatar(userBean.getDress_avatar());
|
||||
bean.setLevel(userBean.getLevel());
|
||||
bean.setType(AnchorUserMicInfoAdapter.TYPE_MIC_REQUEST);
|
||||
data.add(bean);
|
||||
}
|
||||
} else if ("3".equals(Tips)) {
|
||||
for (LiveUserGiftBean userBean : mAudienceList) {
|
||||
MicUserBean bean = new MicUserBean();
|
||||
bean.setAvatar(userBean.getAvatar());
|
||||
bean.setId(userBean.getId());
|
||||
bean.setUserNiceName(userBean.getUserNiceName());
|
||||
bean.setSex(userBean.getSex());
|
||||
bean.setDress_avatar(userBean.getDress().getAvatar_frame());
|
||||
bean.setLevel(userBean.getLevel());
|
||||
bean.setType(AnchorUserMicInfoAdapter.TYPE_MIC_INVITE);
|
||||
data.add(bean);
|
||||
}
|
||||
mRefreshView.setNotLoadMore();
|
||||
} else {
|
||||
data = JSON.parseArray(obj.getString("userlist"), MicUserBean.class);
|
||||
for (MicUserBean bean : data) {
|
||||
bean.setType(AnchorUserMicInfoAdapter.TYPE_MIC_LIST);
|
||||
}
|
||||
if (data.size() != 0) {
|
||||
data.remove(0);
|
||||
}
|
||||
}
|
||||
if (data.size() > 0 && pg == 1) {
|
||||
nums = 0;
|
||||
view_no.setVisibility(View.GONE);
|
||||
if (nums == 0) {
|
||||
view_no.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mRefreshView.mRecyclerView.getRecycledViewPool().setMaxRecycledViews(0, data.size());
|
||||
mRefreshView.setVisibility(View.VISIBLE);
|
||||
no_more.setVisibility(View.GONE);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<MicUserBean> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<MicUserBean> loadItemList, int loadItemCount) {
|
||||
Log.e("tag333", "是" + nums);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
}
|
||||
});
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mLiveGuardInfo = null;
|
||||
LiveHttpUtil.cancel("getUserLists");
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
void Up() {
|
||||
if (Tips.equals("1")) {
|
||||
listMicbtn.setTextColor(Color.parseColor("#fff6f7fb"));
|
||||
requestMicBtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
inviteMicBtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
mNoMoreDesc.setText(R.string.no_more_mic);
|
||||
type = "guanzhong";
|
||||
} else if (Tips.equals("2")) {
|
||||
listMicbtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
requestMicBtn.setTextColor(Color.parseColor("#fff6f7fb"));
|
||||
inviteMicBtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
mNoMoreDesc.setText("當前沒有人申請");
|
||||
type = "guard";
|
||||
} else if (Tips.equals("3")) {
|
||||
listMicbtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
requestMicBtn.setTextColor(Color.parseColor("#ff646464"));
|
||||
inviteMicBtn.setTextColor(Color.parseColor("#fff6f7fb"));
|
||||
mNoMoreDesc.setText("當前沒有觀眾");
|
||||
type = "fans";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initData() {
|
||||
LiveHttpUtil.getMicList(mLiveUid, 0, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info));
|
||||
//非0认为未开通连麦权限
|
||||
if (code != 0) {
|
||||
mOpenMicLayout.setVisibility(View.VISIBLE);
|
||||
mRefreshView.setVisibility(View.GONE);
|
||||
no_more.setVisibility(View.GONE);
|
||||
mDisconnectMic.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
MicStatusManager.getInstance().setAnchorOpenRoom(true);
|
||||
mRefreshView.initData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于更新连麦对话框数据
|
||||
*/
|
||||
public interface OnMicListener {
|
||||
void updateMicList(TreeMap<String, LinkMicUserBean> list);
|
||||
|
||||
void updateAudienceList(List<LiveUserGiftBean> list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Dialog;
|
||||
@@ -34,17 +32,17 @@ import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.adapter.UserMicInfoAdapter;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.MicUserBean;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.socket.SocketSendBean;
|
||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
@@ -149,20 +147,20 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
mRefreshView = mRootView.findViewById(R.id.refreshView);
|
||||
view_no = mRootView.findViewById(R.id.view_no);
|
||||
apply_btn = mRootView.findViewById(R.id.apply_btn);
|
||||
if (Micing == 0) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_DEFAULT) {
|
||||
apply_btn.setBackgroundResource(R.drawable.background_0fdab8);
|
||||
apply_btn.setText(R.string.apply_for_lianmai);
|
||||
} else if (Micing == 1) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
apply_btn.setBackgroundResource(R.drawable.background_00a0e9);
|
||||
apply_btn.setText(R.string.cancel_application);
|
||||
} else if (Micing == 2) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
apply_btn.setBackgroundResource(R.drawable.background_eb6877);
|
||||
apply_btn.setText(R.string.quit_mic);
|
||||
}
|
||||
apply_btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (Micing == 0) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_DEFAULT) {
|
||||
LiveAudienceActivity.mProcessResultUtil.requestPermissions(new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
@@ -183,7 +181,10 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
.param("_method_", Constants.LIAN_MAI)
|
||||
.param("action", 3)
|
||||
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||
.param("sex", CommonAppConfig.getInstance().getUserBean().getSex())
|
||||
.param("level", CommonAppConfig.getInstance().getUserBean().getLevel())
|
||||
.param("avatar", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("dress_avatar", CommonAppConfig.getInstance().getUserBean().getDress().getAvatar_frame())
|
||||
.param("uid", CommonAppConfig.getInstance().getUid());
|
||||
msg1.create();
|
||||
|
||||
@@ -204,7 +205,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
ToastUtil.show("");
|
||||
apply_btn.setBackgroundResource(R.drawable.background_00a0e9);
|
||||
apply_btn.setText(R.string.cancel_application);
|
||||
Micing = 1;
|
||||
MicStatusManager.getInstance().setMicData(MicStatusManager.MIC_TYPE_REQUEST,mLiveUid);
|
||||
dismiss();
|
||||
io.rong.imlib.model.Message ids[] = {message};
|
||||
RongIMClient.getInstance().deleteRemoteMessages(conversationType,message.getTargetId(),ids, null);
|
||||
@@ -224,7 +225,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (Micing == 1) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
//取消申請
|
||||
dismiss();
|
||||
//用户申请联麦
|
||||
@@ -250,7 +251,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
@Override
|
||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||
Log.e("ry", "发送成功");
|
||||
Micing = 0;
|
||||
MicStatusManager.getInstance().clear();
|
||||
dismiss();
|
||||
io.rong.imlib.model.Message ids[] = {message};
|
||||
RongIMClient.getInstance().deleteRemoteMessages(conversationType,message.getTargetId(),ids, null);
|
||||
@@ -265,7 +266,7 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
}
|
||||
});
|
||||
|
||||
} else if (Micing == 2) {
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
//退出连麦
|
||||
DialogUitl.showSimpleDialog(mContext, "連麥中,退出將斷開語音連麥!", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
@@ -316,11 +317,11 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
|
||||
@Override
|
||||
public List<MicUserBean> processData(String[] info) {
|
||||
Log.e("tag222", Tips + "ssss" + Micing);
|
||||
Log.e("tag222", Tips + "ssss" + MicStatusManager.getInstance().toString());
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
List<MicUserBean> data = new ArrayList<>();
|
||||
if (Tips.equals("2")) {
|
||||
if (Micing == 1) {
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
MicUserBean micuser = new MicUserBean();
|
||||
micuser.setAvatar(CommonAppConfig.getInstance().getUserBean().getAvatar());
|
||||
micuser.setUserNiceName(CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||
@@ -332,7 +333,9 @@ public class LiveMicUserDialogFragment extends AbsDialogFragment implements View
|
||||
}
|
||||
} else {
|
||||
data = JSON.parseArray(obj.getString("userlist"), MicUserBean.class);
|
||||
data.remove(0);
|
||||
if(data.size()!=0) {
|
||||
data.remove(0);
|
||||
}
|
||||
}
|
||||
if (data.size() > 0 && pg == 1) {
|
||||
nums = 0;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.live.activity.LiveActivity.mLiveUid;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -13,11 +15,8 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.activity.LiveReportActivity;
|
||||
import com.yunbao.live.views.LivePlayRyViewHolder;
|
||||
import com.yunbao.live.views.LiveRoomViewHolder;
|
||||
|
||||
import static com.yunbao.live.activity.LiveActivity.mLiveUid;
|
||||
|
||||
/**
|
||||
* 全屏 分享 弹出框
|
||||
*/
|
||||
@@ -61,12 +60,13 @@ public class LiveMoreDialogFragment extends AbsDialogFragment {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
if (LivePlayRyViewHolder.landscape != 1) {
|
||||
|
||||
} else if (((LiveAudienceActivity) mContext).pkInfo != null && ((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 && ((LiveAudienceActivity) mContext).anyway.equals("1") && LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE) {
|
||||
if (mContext instanceof LiveAudienceActivity && (((LiveAudienceActivity) mContext).pkInfo != null &&
|
||||
((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 &&
|
||||
((LiveAudienceActivity) mContext).anyway.equals("1") &&
|
||||
LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE)) {
|
||||
((LiveAudienceActivity) mContext).btnSmallScreen.setVisibility(View.VISIBLE);
|
||||
LiveAudienceActivity.setCurrentItem(0);
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().fullScreen();
|
||||
((LiveAudienceActivity) mContext).setCurrentItem(0);
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().fullScreen();
|
||||
} else {
|
||||
Toast.makeText(mContext, "当前模式不能全屏", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
|
||||
return true;
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(String live_id) {
|
||||
DialogUitl.showSimpleDialog(mContext, "是否確認前往對方直播間?", new DialogUitl.SimpleCallback() {
|
||||
@@ -185,26 +184,17 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
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));
|
||||
}
|
||||
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
// if (mFromLiveRoom) {
|
||||
// ((UserHomeActivity) mContext).onBackPressed();
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
// } else {
|
||||
// LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,8 +37,10 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.NobleUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
@@ -53,6 +55,7 @@ import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.bean.ImpressBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.custom.MyTextView;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -153,11 +156,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
return true;
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
@@ -252,6 +254,25 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
mSetting.setOnClickListener(this);
|
||||
mHonorLayout.setOnClickListener(v -> forwardHomePage());
|
||||
|
||||
//用户名片连点三次粉丝弹出视频debug窗
|
||||
mFansVal.setOnClickListener(new View.OnClickListener() {
|
||||
long time=0;
|
||||
int index=0;
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(time==0){
|
||||
time=System.currentTimeMillis();
|
||||
}
|
||||
index++;
|
||||
if(System.currentTimeMillis()-time<1000&&index==3){
|
||||
EventBus.getDefault().post("Debug");
|
||||
}else if(System.currentTimeMillis()-time>1000){
|
||||
index=0;
|
||||
time=0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
@@ -304,7 +325,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
private void showData(String data) {
|
||||
Log.i(TAG, "showData: " + data);
|
||||
JSONObject obj = JSON.parseObject(data);
|
||||
isAnchor = obj.getInteger("is_anchor")==1;
|
||||
isAnchor = obj.getInteger("is_anchor") == 1;
|
||||
mUserBean = JSON.toJavaObject(obj, UserBean.class);
|
||||
|
||||
mToName = obj.getString("user_nicename");
|
||||
@@ -314,7 +335,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
} else {
|
||||
btn_live.setVisibility(View.GONE);
|
||||
}
|
||||
switch (mType){
|
||||
switch (mType) {
|
||||
case TYPE_ANC_AUD:
|
||||
case SETTING_ACTION_ADM:
|
||||
case SETTING_ACTION_SUP:
|
||||
@@ -322,7 +343,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
case SETTING_ACTION_ANC_ADM:
|
||||
mSetting.setVisibility(View.VISIBLE);
|
||||
}
|
||||
switch (mAction){
|
||||
switch (mAction) {
|
||||
case TYPE_ANC_AUD:
|
||||
case SETTING_ACTION_ADM:
|
||||
case SETTING_ACTION_SUP:
|
||||
@@ -345,8 +366,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
mName.setText(obj.getString("user_nicename"));
|
||||
if (mUserBean.getGoodnum() != null && !mUserBean.getGoodnum().equals("")) {
|
||||
if(!isAnchor) {
|
||||
if (!isAnchor) {
|
||||
good_nub_ico.setImageResource(R.mipmap.good_nub);
|
||||
} else {
|
||||
good_nub_ico.setImageResource(R.mipmap.usercard_good_nub);
|
||||
}
|
||||
good_nub_ico.setVisibility(View.VISIBLE);
|
||||
mID.setText(mUserBean.getGoodnum());
|
||||
@@ -365,10 +388,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
userLv.setText("Lv." + mUserBean.getLevel());
|
||||
mLvDesc.setText(R.string.live_user_card_level);
|
||||
}
|
||||
if(isAnchor){
|
||||
ImgLoader.display2(mContext,obj.getJSONObject("level_thumb").getString("thumb"),mLiveIcon);
|
||||
mLvVal.setText(obj.getInteger("level_anchor")+"");
|
||||
}else {
|
||||
if (isAnchor) {
|
||||
ImgLoader.display2(mContext, obj.getJSONObject("level_thumb").getString("thumb"), mLiveIcon);
|
||||
mLvVal.setText(obj.getInteger("level_anchor") + "");
|
||||
} else {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -569,6 +592,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
DialogUitl.showSimpleDialog(mContext, "是否確認前往對方直播間?", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveUserDialogFragment.this.dismiss();
|
||||
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveUid, new IRongCoreCallback.OperationCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
@@ -611,21 +635,24 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
dismiss();
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -648,13 +675,16 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
} else if (i == R.id.avatar) {
|
||||
forwardHomePage();
|
||||
} else if (i == R.id.btn_guard) {
|
||||
((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity,mToUid);
|
||||
((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity, mToUid);
|
||||
} else if (i == R.id.btn_live) {
|
||||
gotoLive(mToUid);
|
||||
} else if (i == R.id.noble_icon_layout) {
|
||||
if (isAnchor) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openFansWindow(mToUid);
|
||||
}else{
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.NOBLE));
|
||||
}
|
||||
} else if (i == R.id.btn_setting) {
|
||||
setting();
|
||||
|
||||
@@ -38,7 +38,7 @@ import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.live.adapter.UserMoreInfoAdapter;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -59,7 +59,6 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
private String mLiveUid;
|
||||
private String stream;
|
||||
private LiveGuardInfo mLiveGuardInfo;
|
||||
public static LiveActivity activity = null;
|
||||
public eightbitlab.com.blurview.BlurView blurView;
|
||||
|
||||
public TextView audience_btn, guard_btn, fans_btn, tags, btn, gz_view, dayRank, weekRank, title;
|
||||
@@ -90,6 +89,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = ActionBar.LayoutParams.MATCH_PARENT;
|
||||
params.height = DpUtil.dp2px(460);
|
||||
@@ -167,10 +167,10 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Tips = "2";
|
||||
no_more.setImageResource(R.mipmap.grayicon);
|
||||
Up();
|
||||
type = "guard";
|
||||
mRefreshView.initData();
|
||||
no_more.setImageResource(R.mipmap.grayicon);
|
||||
}
|
||||
});
|
||||
fans_btn = mRootView.findViewById(R.id.fans_btn);
|
||||
@@ -178,25 +178,25 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Tips = "3";
|
||||
no_more.setImageResource(R.mipmap.bixin);
|
||||
Up();
|
||||
type = "fans";
|
||||
mRefreshView.initData();
|
||||
no_more.setImageResource(R.mipmap.bixin);
|
||||
}
|
||||
});
|
||||
dayRank.setOnClickListener(View -> {
|
||||
Tips = "4";
|
||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||
Up();
|
||||
type = "dayRank";
|
||||
mRefreshView.initData();
|
||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||
});
|
||||
weekRank.setOnClickListener(View -> {
|
||||
Tips = "5";
|
||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||
Up();
|
||||
type = "weekRank";
|
||||
mRefreshView.initData();
|
||||
no_more.setImageResource(R.drawable.img_rank_empty);
|
||||
});
|
||||
|
||||
mRefreshView = mRootView.findViewById(R.id.refreshView);
|
||||
@@ -387,7 +387,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
|
||||
setTextColor(guard_btn, audience_btn, fans_btn, dayRank, weekRank);
|
||||
gz_view.setVisibility(View.GONE);
|
||||
userMoreInfoAdapter.type = "2";
|
||||
no_more.setImageResource(R.mipmap.grayicon);
|
||||
no_more.setImageResource(R.mipmap.ic_guard_not);
|
||||
noMoreText.setText("主播正在等待您成為TA的守護,\n為TA保駕護航!");
|
||||
noMoreText.setVisibility(View.VISIBLE);
|
||||
type = "guard";
|
||||
} else if (Tips.equals("3")) {
|
||||
tags.setText("快加入您喜歡的主播粉絲團吧");
|
||||
|
||||
@@ -11,15 +11,9 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.live.R;
|
||||
@@ -110,17 +104,6 @@ public class NewUserDialog extends AbsDialogFragment {
|
||||
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("a50ofs");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("a50ofs", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_newbie_reward", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_newbie_reward");
|
||||
}
|
||||
}
|
||||
});
|
||||
EventBus.getDefault().post("showBanner");
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
|
||||
@@ -18,18 +18,12 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.activity.SelectImageActivity;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.bean.NoviceInstructorModel;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.live.R;
|
||||
@@ -58,6 +52,7 @@ public class PDLIiveChatConversationFragment extends AbsDialogFragment implement
|
||||
private final int SELECT_IMAGE_REQUEST = 0x0001;
|
||||
private ArrayList<ImageEntity> mSelectImages = new ArrayList<>();
|
||||
private boolean isAdmin = false;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_chat_conversation;
|
||||
@@ -139,18 +134,6 @@ public class PDLIiveChatConversationFragment extends AbsDialogFragment implement
|
||||
if (!TextUtils.isEmpty(userBean.getIs_admin()) && TextUtils.equals(userBean.getIs_admin(), "1")) {
|
||||
isAdmin = true;
|
||||
imgMore.setVisibility(View.GONE);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("exlgn3");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("exlgn3", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_director_read", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_director_read");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {//非指导员
|
||||
isAdmin = false;
|
||||
imgMore.setVisibility(View.VISIBLE);
|
||||
@@ -202,6 +185,7 @@ public class PDLIiveChatConversationFragment extends AbsDialogFragment implement
|
||||
startActivityForResult(intent, SELECT_IMAGE_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取草稿箱信息系
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.live.views.LivePlayRyViewHolder;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -74,42 +74,7 @@ public class SidebarLiveAudience extends AbsDialogFragment {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 前往直播间
|
||||
*/
|
||||
private void gotoLive(final String liveId) {
|
||||
LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(getActivity(), (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
if (liveBean1 == null) {
|
||||
return;
|
||||
}
|
||||
if (LivePlayRyViewHolder.Micing == 1) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(1)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||
} else if (LivePlayRyViewHolder.Micing == 2) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(2)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||
} else {
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
}
|
||||
|
||||
});
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(getActivity(), liveId, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
|
||||
@@ -189,6 +189,13 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
PK_TWO_START(36, "双人PK开始"),
|
||||
PK_TWO_UPDATE_HEAD_DATA(37, "更新PK头像信息"),
|
||||
PK_TWO_END(38, "双人PK开始"),
|
||||
LINK_MIC(39, "连麦"),
|
||||
LINK_MIC_CANCEL(40, "取消连麦"),
|
||||
LINK_MIC_UPDATE_MIC_LIST(41, "更新连麦列表"),
|
||||
LINK_MIC_UPDATE_AUDIENCE_LIST(42, "更新观众/可邀请列表"),
|
||||
LINK_MIC_CLOSE(43, "主播关闭连麦房"),
|
||||
SOCKET_LIVE_DRPK_SET_PK_VIEW(44, "setPkview"),
|
||||
SOCKET_LIVE_DRPK_SET_PK_END_VIEW(45, "setPkEndview"),
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
||||
@@ -36,6 +36,7 @@ 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.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -46,11 +47,10 @@ import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.HtmlTagHandler;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
@@ -195,10 +195,12 @@ public class LiveGiftAnimPresenter {
|
||||
private WindowManager mWindowManager;
|
||||
private static FrameImageView mFrameImageView;
|
||||
private static ValueAnimator mAnimator;
|
||||
private AllMsgTextRender textRender;
|
||||
|
||||
public LiveGiftAnimPresenter(Context context, View v, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
|
||||
mContext = context;
|
||||
this.mWindowManager = windowManager;
|
||||
textRender = new AllMsgTextRender(this);
|
||||
mParent2 = (ViewGroup) v.findViewById(R.id.gift_group_1);
|
||||
mTopLuckContainer = v.findViewById(R.id.luck_container);
|
||||
mGifImageView = gifImageView;
|
||||
@@ -231,13 +233,6 @@ public class LiveGiftAnimPresenter {
|
||||
|
||||
mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img);
|
||||
|
||||
// mGifGiftTipAllServer.setSelected(true);
|
||||
// mGifGiftTipBuyGuard.setSelected(true);
|
||||
// mGifGiftTipBuyZuoji.setSelected(true);
|
||||
// mGifGiftTipBuyLiangName.setSelected(true);
|
||||
// mGifGiftTipBuyVip.setSelected(true);
|
||||
|
||||
|
||||
mIvLookClick();
|
||||
mIvLookBuyGuardClick();
|
||||
mIvLookBuyZuojiClick();
|
||||
@@ -285,11 +280,6 @@ public class LiveGiftAnimPresenter {
|
||||
mAnimator.setDuration(800);
|
||||
mAnimator.setRepeatCount(3);
|
||||
mAnimator.setInterpolator(new LinearInterpolator());
|
||||
|
||||
|
||||
// mGifGiftTipAllServer.init(windowManager);
|
||||
// mGifGiftTipBuyGuard.init(windowManager);
|
||||
// mGifGiftTipBuyVip.init(windowManager);
|
||||
}
|
||||
|
||||
|
||||
@@ -361,10 +351,6 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipGroupBuyVip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// 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();
|
||||
// startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url",url));
|
||||
// WebViewActivity.forward(mContext, HtmlConfig.SHOP);
|
||||
changeLiveRoom();
|
||||
}
|
||||
});
|
||||
@@ -389,20 +375,17 @@ public class LiveGiftAnimPresenter {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
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));
|
||||
}
|
||||
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
((LiveAudienceActivity) mContext).onBackPressed();
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -558,7 +541,6 @@ public class LiveGiftAnimPresenter {
|
||||
});
|
||||
mDp10 = DpUtil.dp2px(10);
|
||||
mGifGiftTipHideAnimatorBuyVip = ObjectAnimator.ofFloat(mGifGiftTipGroupBuyVip, "translationX", 0);//平移
|
||||
// mGifGiftTipHideAnimatorBuyVip = ObjectAnimator.ofFloat(mGifGiftTipGroupBuyVip, "alpha", 1f, 0f);//渐变
|
||||
mGifGiftTipHideAnimatorBuyVip.setDuration(3000);
|
||||
mGifGiftTipHideAnimatorBuyVip.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mGifGiftTipHideAnimatorBuyVip.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@@ -616,9 +598,6 @@ public class LiveGiftAnimPresenter {
|
||||
diffTime = 0;
|
||||
}
|
||||
mSVGAImageViewFront.clear();
|
||||
// if (mHandler != null) {
|
||||
// mHandler.sendEmptyMessageDelayed(WHAT_GIF_All_SERVER, diffTime);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -673,7 +652,6 @@ public class LiveGiftAnimPresenter {
|
||||
if (!mIsSameRoom) {
|
||||
mGifGiftTipHideAnimatorAllServer.setFloatValues(0, -mDp10 - mGifGiftTipGroupAllServer.getWidth());
|
||||
mGifGiftTipHideAnimatorAllServer.start();
|
||||
// mHandler.sendEmptyMessageDelayed(WHAT_GIF_All_SERVER, 800);
|
||||
}
|
||||
} else if (msg.what == WHAT_ALL_SERVER_1) {
|
||||
mGifGiftTipHideAnimatorAllServer.setFloatValues(0, -mDp10 - mGifGiftTipGroupAllServer.getWidth());
|
||||
@@ -804,7 +782,6 @@ public class LiveGiftAnimPresenter {
|
||||
//同一直播间,其他玩家也能看到全服通知
|
||||
String userId = CommonAppConfig.getInstance().getUid();
|
||||
String uid = bean.getUid();
|
||||
// if (userId.equals(uid))
|
||||
if (mIsAllServerNotify) {
|
||||
if (!isAncher) {
|
||||
if (!bean.getDrpk_status().equals("1")) {
|
||||
@@ -860,7 +837,7 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipShowAnimatorAllServer.start();
|
||||
|
||||
AllMsgTextRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, "");
|
||||
textRender.render(mContext, mGifGiftTipAllServer, mTempGifGiftBean.getGiftIcon(), mTempGifGiftBean.getUserNiceName(), mAncherName, mTempGifGiftBean.getGiftName(), 1, mWindowManager, "");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -916,7 +893,7 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipGroupBuyGuard.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipShowAnimatorBuyGuard.start();
|
||||
|
||||
AllMsgTextRender.render(mContext, mGifGiftTipBuyGuard, "", mTempGifGiftBean.getUserNiceName(), mAncherName, "", 2, mWindowManager, mTempGifGiftBean.getGuardType());
|
||||
textRender.render(mContext, mGifGiftTipBuyGuard, "", mTempGifGiftBean.getUserNiceName(), mAncherName, "", 2, mWindowManager, mTempGifGiftBean.getGuardType());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1045,7 +1022,7 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipGroupBuyVip.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipShowAnimatorBuyVip.start();
|
||||
|
||||
AllMsgTextRender.render(mContext, mGifGiftTipBuyVip, "", mTempGifGiftBean.getUserNiceName(), mAncherName, bean.getNobilityname(), 3, mWindowManager, bean.getOpentype());
|
||||
textRender.render(mContext, mGifGiftTipBuyVip, "", mTempGifGiftBean.getUserNiceName(), mAncherName, bean.getNobilityname(), 3, mWindowManager, bean.getOpentype());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1076,7 +1053,7 @@ public class LiveGiftAnimPresenter {
|
||||
mGifGiftTipGroupAllServer.setVisibility(View.VISIBLE);
|
||||
mGifGiftTipShowAnimatorAllServer.start();
|
||||
|
||||
AllMsgTextRender.render(mContext, mGifGiftTipAllServer, "", bean.getVipName(), "", "", 4, mWindowManager, "");
|
||||
textRender.render(mContext, mGifGiftTipAllServer, "", bean.getVipName(), "", "", 4, mWindowManager, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1516,9 +1493,11 @@ public class LiveGiftAnimPresenter {
|
||||
public void release() {
|
||||
clearAnim();
|
||||
if (mLiveGiftViewHolders[0] != null) {
|
||||
mLiveGiftViewHolders[0].hideNormal();
|
||||
mLiveGiftViewHolders[0].release();
|
||||
}
|
||||
if (mLiveGiftViewHolders[1] != null) {
|
||||
mLiveGiftViewHolders[1].hideNormal();
|
||||
mLiveGiftViewHolders[1].release();
|
||||
}
|
||||
if (mSVGAImageView != null) {
|
||||
@@ -1651,7 +1630,7 @@ public class LiveGiftAnimPresenter {
|
||||
public static CountDownTimer countDownTimer, countDownTimerStart;
|
||||
|
||||
//intoIndex 横幅类型
|
||||
public static void setCountDownTimerEnd(int intoIndex) {
|
||||
public void setCountDownTimerEnd(int intoIndex) {
|
||||
countDownTimer = new CountDownTimer(500, 250) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
@@ -1709,7 +1688,7 @@ public class LiveGiftAnimPresenter {
|
||||
countDownTimer.start();
|
||||
}
|
||||
|
||||
public static void setCountDownTimerStart(int intoIndex) {
|
||||
public void setCountDownTimerStart(int intoIndex) {
|
||||
countDownTimerStart = new CountDownTimer(2000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
@@ -1743,7 +1722,7 @@ public class LiveGiftAnimPresenter {
|
||||
countDownTimerStart.start();
|
||||
}
|
||||
|
||||
public static void setCountDownTimerStartAll() {
|
||||
public void setCountDownTimerStartAll() {
|
||||
mFrameImageView.setVisibility(View.VISIBLE);
|
||||
mAnimator.start();
|
||||
mFrameImageView.setImageList(LiveIconUtil.getSAllMSG());//PK开始动画
|
||||
|
||||
@@ -1002,8 +1002,8 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
||||
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
|
||||
mLiveLinkMicPkViewHolder.addToParent();
|
||||
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
|
||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkview();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1081,8 +1081,8 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(4000);
|
||||
if ( LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkEndview();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.yunbao.live.presenter;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@@ -20,19 +19,15 @@ import android.widget.PopupWindow;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.bean.BannerBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.ClickUtil;
|
||||
@@ -117,82 +112,10 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
if ("stop_svga_new_user_double1".equals(str)) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("80lzdi");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("80lzdi", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_3", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_3");
|
||||
}
|
||||
}
|
||||
});
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("6va52i");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("6va52i", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_either", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_either");
|
||||
}
|
||||
}
|
||||
});
|
||||
publicToast(mContext);
|
||||
} else if ("stop_svga_new_user_follow1".equals(str)) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("f084wh");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("f084wh", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_2", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_2");
|
||||
}
|
||||
}
|
||||
});
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("6va52i");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("6va52i", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_either", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_either");
|
||||
}
|
||||
}
|
||||
});
|
||||
publicToast(mContext);
|
||||
} else if ("stop_new_user_gif1".equals(str)) {
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("aqqz70");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("aqqz70", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_1", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_1");
|
||||
}
|
||||
}
|
||||
});
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("6va52i");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("6va52i", new HttpCallback() {
|
||||
@SuppressLint("MissingPermission")
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(mContext).logEvent("FS_mission_either", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_mission_either");
|
||||
}
|
||||
}
|
||||
});
|
||||
publicToast(mContext);
|
||||
}
|
||||
}
|
||||
@@ -857,6 +780,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
}
|
||||
|
||||
public void setLiveSdk(int mLiveSDK) {
|
||||
this.mLiveSdk=mLiveSDK;
|
||||
this.mLiveSdk = mLiveSDK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,17 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.base.CheckLiveCallBack;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -37,6 +40,83 @@ public class LiveRoomCheckLivePresenter {
|
||||
//搜索页面不提示密码
|
||||
public static boolean isRoom = false;
|
||||
|
||||
/**
|
||||
* 新的检查直播间状态方法
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param liveUid 直播间ID
|
||||
* @param stream
|
||||
*/
|
||||
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) {
|
||||
LiveNetManager.get(context)
|
||||
.checkLive(liveUid, stream, new CheckLiveCallBack() {
|
||||
@Override
|
||||
public void forwardNormalRoom(CheckLiveModel model) {
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forwardPwdRoom(CheckLiveModel model) {
|
||||
DialogUitl.showSimpleInputDialog(context, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
if (mContext instanceof Activity) {
|
||||
((Activity) mContext).finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_input_password));
|
||||
return;
|
||||
}
|
||||
String password = MD5Util.getMD5(content);
|
||||
if (model.getTypeMsg().equalsIgnoreCase(password)) {
|
||||
dialog.dismiss();
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.getString(R.string.live_password_error));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forwardPayRoom(CheckLiveModel model) {
|
||||
DialogUitl.showSimpleDialog(context, mLiveTypeMsg, new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveHttpUtil.roomCharge(liveUid, stream, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
if (actionListener != null) {
|
||||
actionListener.onLiveRoomChanged(liveUid, stream, model.getType(), model.getTypeVal(), model.getLiveSdk());
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_ROOM_EXCEPTION));
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) {
|
||||
mContext = context;
|
||||
mActionListener = actionListener;
|
||||
@@ -110,7 +190,7 @@ public class LiveRoomCheckLivePresenter {
|
||||
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
if(mContext instanceof Activity) {
|
||||
if (mContext instanceof Activity) {
|
||||
((Activity) mContext).finish();
|
||||
}
|
||||
}
|
||||
@@ -194,4 +274,10 @@ public class LiveRoomCheckLivePresenter {
|
||||
public interface ActionListener {
|
||||
void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk);
|
||||
}
|
||||
|
||||
public interface NewActionListener {
|
||||
void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk);
|
||||
|
||||
void onCheckError(String contextError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1197,14 +1197,17 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
Log.i(TAG, "code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info));
|
||||
JSONObject datas = JSONObject.parseObject(info[0]);
|
||||
boolean agree=true;
|
||||
if (code != 0) {
|
||||
if (datas.getIntValue("pk_num_day") <= 0) {
|
||||
ToastUtil.show("多人PK次数已用完");
|
||||
agree=false;
|
||||
}
|
||||
boolean finalAgree = agree;
|
||||
rtcRoom.getLocalUser().responseJoinOtherRoom(mApplyUid, mApplyUid, agree, true, SOCKET_LIVE_DRPK, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if(finalAgree == true){
|
||||
HttpClient.getInstance().get("live.joinDRPKroom", "live.joinDRPKroom")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("roomid", u.getId())
|
||||
@@ -1286,7 +1289,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1835,8 +1838,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
|
||||
mLiveLinkMicPkViewHolder.addToParent();
|
||||
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
|
||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkview();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1954,8 +1957,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
public void run() {
|
||||
// try {
|
||||
// Thread.sleep(4000);
|
||||
if (mContext instanceof LiveAudienceActivity && LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkEndview();
|
||||
}
|
||||
// } catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -32,7 +33,8 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
|
||||
import com.yunbao.live.views.LivePlayKsyViewHolder;
|
||||
import com.yunbao.live.views.LivePushTxViewHolder;
|
||||
@@ -171,7 +173,10 @@ public class SocketClient {
|
||||
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
|
||||
//創建了多人房間
|
||||
} else if (action3 == 9) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
}
|
||||
break;
|
||||
case Constants.SOCKET_ALL_SERVER_NOTIFY://全服通知
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.yunbao.live.socket;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -130,24 +125,6 @@ public class SocketRyChatUtil {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
Log.i("tx", "ssss" + "发送成功" + mLiveUid);
|
||||
//首发言成功
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("j7isvr");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("j7isvr", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_liveinteraction", null);
|
||||
logger.logEvent("FB_liveinteraction ");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mFirebaseAnalytics.logEvent("FS_type_interaction", null);
|
||||
logger.logEvent("FB_type_interaction");
|
||||
AdjustEvent adjustEvent = new AdjustEvent("cs6j0s");
|
||||
Adjust.trackEvent(adjustEvent);
|
||||
if (SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
|
||||
}
|
||||
|
||||
@@ -16,13 +16,17 @@ import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.SocketModel;
|
||||
@@ -45,7 +49,6 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.views.LiveEndViewHolder;
|
||||
import com.yunbao.live.views.LivePlayKsyViewHolder;
|
||||
@@ -127,17 +130,22 @@ public class SocketRyClient {
|
||||
if (mListener == null) {
|
||||
return;
|
||||
}
|
||||
switch (msg.what) {
|
||||
case Constants.SOCKET_WHAT_CONN:
|
||||
mListener.onConnect((Boolean) msg.obj);
|
||||
break;
|
||||
case Constants.SOCKET_WHAT_BROADCAST:
|
||||
processBroadcast((String) msg.obj);
|
||||
break;
|
||||
case Constants.SOCKET_WHAT_DISCONN:
|
||||
mListener.onDisConnect();
|
||||
break;
|
||||
try {
|
||||
switch (msg.what) {
|
||||
case Constants.SOCKET_WHAT_CONN:
|
||||
mListener.onConnect((Boolean) msg.obj);
|
||||
break;
|
||||
case Constants.SOCKET_WHAT_BROADCAST:
|
||||
processBroadcast((String) msg.obj);
|
||||
break;
|
||||
case Constants.SOCKET_WHAT_DISCONN:
|
||||
mListener.onDisConnect();
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -169,18 +177,36 @@ public class SocketRyClient {
|
||||
EventBus.getDefault().post("UsertoRY");
|
||||
} else if (actions == 5) {
|
||||
JSONObject mic_data = map.getJSONObject("ct");
|
||||
LiveRoomViewHolder.updataMicList(mic_data.getJSONArray("userlist"));
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_MIC_LIST)
|
||||
.setObject(JSONArray.parseArray(mic_data.getJSONArray("userlist").toString(), LinkMicUserBean.class))
|
||||
);
|
||||
} else if (actions == 6) {
|
||||
ToastUtil.show("主播已關閉當前語音連麥功能");
|
||||
LiveRoomViewHolder.updataCleanMic();
|
||||
EventBus.getDefault().post("endMic");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CLOSE)
|
||||
.setObject(map.toJavaObject(LinkMicUserBean.class)));
|
||||
} else if (actions == 8) {
|
||||
ToastUtil.show("您已被移出多人語音連麥");
|
||||
EventBus.getDefault().post("endMic");
|
||||
} else if (actions == 3) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC)
|
||||
.setObject(map.toJavaObject(LinkMicUserBean.class))
|
||||
);
|
||||
} else if (actions == 7) {//取消连麦
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CANCEL)
|
||||
);
|
||||
}
|
||||
break;
|
||||
case Constants.UP_USER_LIST:
|
||||
mListener.onUpUserList(map.getJSONObject("ct"));
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_UPDATE_AUDIENCE_LIST)
|
||||
.setObject(JSON.parseArray(map.getJSONObject("ct").getString("userlist"), LiveUserGiftBean.class))
|
||||
);
|
||||
break;
|
||||
case Constants.CARD:
|
||||
// LiveLinkMicPresenter.setHD(map.getString("ct"));
|
||||
@@ -190,12 +216,16 @@ public class SocketRyClient {
|
||||
break;
|
||||
}
|
||||
UserBean us = CommonAppConfig.getInstance().getUserBean();
|
||||
if (map.getString("uid") != null && map.getString("uid").equals(us.getId())) {
|
||||
if (map.getString("uid") != null && us != null && map.getString("uid").equals(us.getId())) {
|
||||
int num = LiveAudienceActivity.fansNum + 1;
|
||||
LiveRoomViewHolder.setFansNum(num);
|
||||
}
|
||||
if (map.getString("ct").contains("堅決維護青少年群體精神文明健康") || map.getString("ct").contains("click to register if you like. pdlive conducts")) {
|
||||
systemChatMessage(map.getString("ct"));
|
||||
} else {
|
||||
systemChatMessage2(map.getString("ct"));
|
||||
}
|
||||
|
||||
systemChatMessage(map.getString("ct"));
|
||||
int action21 = map.getIntValue("action");
|
||||
//主播離開
|
||||
if (action21 == 13 && map.getString("ct").contains("離開")) {
|
||||
@@ -258,7 +288,10 @@ public class SocketRyClient {
|
||||
}
|
||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
||||
if (livePushRyViewHolder == null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
}
|
||||
|
||||
} else if (action3 == 5) {
|
||||
@@ -272,17 +305,27 @@ public class SocketRyClient {
|
||||
leaveDRRoom();
|
||||
isDRPK = 0;
|
||||
} else {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_END_VIEW)
|
||||
);
|
||||
|
||||
}
|
||||
//創建了多人房間
|
||||
} else if (action3 == 3) {
|
||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
/* if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
}
|
||||
}*/
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
isDRPK = 1;
|
||||
} else if (action3 == 10) {
|
||||
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
|
||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,9 +560,9 @@ public class SocketRyClient {
|
||||
.setMsgModel(GsonUtils.fromJson(map.getJSONObject("ct").toString(), MsgModel.class)));
|
||||
break;
|
||||
case Constants.PK_RANK_UPDATE:
|
||||
Log.i("PK排位",map.toString());
|
||||
JSONObject item=map.getJSONObject("ct");
|
||||
PkRankBean pkRankBean=new PkRankBean();
|
||||
Log.i("PK排位", map.toString());
|
||||
JSONObject item = map.getJSONObject("ct");
|
||||
PkRankBean pkRankBean = new PkRankBean();
|
||||
pkRankBean.setId(Integer.parseInt(item.getString("new_rank_id")));
|
||||
pkRankBean.setName(item.getString("new_rank_name"));
|
||||
pkRankBean.setImg(item.getString("new_rank_img"));
|
||||
@@ -688,7 +731,7 @@ public class SocketRyClient {
|
||||
mListener.onChat(chatBean, 1);
|
||||
} else if ("0".equals(msgtype)) {//用户进入房间
|
||||
JSONObject obj = JSON.parseObject(map.getString("ct"));
|
||||
LiveUserGiftBean u = JSON.toJavaObject(obj, LiveUserGiftBean.class);
|
||||
LiveUserGiftBean u = GsonUtils.fromJson(obj.toJSONString(), LiveUserGiftBean.class);
|
||||
UserBean.Vip vip = new UserBean.Vip();
|
||||
int vipType = obj.getIntValue("vip_type");
|
||||
vip.setType(vipType);
|
||||
@@ -731,6 +774,7 @@ public class SocketRyClient {
|
||||
chatBean.setBubbleSrc(obj.getString("bubbleSrc"));//氣泡
|
||||
//增加粉丝徽章信息
|
||||
chatBean.setMedalNmae(obj.getString("medal_name"));
|
||||
chatBean.setUserNiceName(obj.getString("user_nicename"));//名字
|
||||
FansMedalBean fansMedalBean = CommonAppConfig.getInstance().getAnchorFansMedal(obj.getIntValue("medal_level"));
|
||||
if (fansMedalBean != null)
|
||||
chatBean.setMedalLevelImageUrl(fansMedalBean.getThumb());
|
||||
@@ -1004,13 +1048,13 @@ public class SocketRyClient {
|
||||
break;
|
||||
case 2://收到对方主播PK回调
|
||||
mListener.onLinkMicToPk(map.getString("uid"), map.getString("pkhead"), map.getString("pkname"));
|
||||
mListener.onLinkMicPkStart(map.getString("uid"), map.getString("pkhead"), map.getString("pkname"),map.getString("is_ladders"));// mListener.onLinkMicPkStart(map.getString("uid"));
|
||||
mListener.onLinkMicPkStart(map.getString("uid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders"));// mListener.onLinkMicPkStart(map.getString("uid"));
|
||||
break;
|
||||
case 3://对方主播拒绝PK的回调
|
||||
mListener.onLinkMicPkRefuse();
|
||||
break;
|
||||
case 4://所有人收到PK开始址的回调
|
||||
mListener.onLinkMicPkStart(map.getString("pkuid"), map.getString("pkhead"), map.getString("pkname"),map.getString("is_ladders"));
|
||||
mListener.onLinkMicPkStart(map.getString("pkuid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders"));
|
||||
break;
|
||||
case 5://PK时候断开连麦的回调
|
||||
if (rtcRoom != null) {
|
||||
@@ -1051,7 +1095,7 @@ public class SocketRyClient {
|
||||
msg1.put("pkuid", CommonAppConfig.getInstance().getUid());
|
||||
msg1.put("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||
msg1.put("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar());
|
||||
if(rtcRoom==null){
|
||||
if (rtcRoom == null) {
|
||||
return;
|
||||
}
|
||||
rtcRoom.getLocalUser().requestJoinOtherRoom(map.getString("uid"), map.getString("uid"), true, msg1.toString(), new IRCRTCResultCallback() {
|
||||
|
||||
@@ -16,12 +16,17 @@ import com.yunbao.live.presenter.LiveGiftAnimPresenter;
|
||||
|
||||
public class AllMsgTextRender {
|
||||
|
||||
public static SpannableStringBuilder builder;
|
||||
public SpannableStringBuilder builder;
|
||||
private LiveGiftAnimPresenter giftAnimPresenter;
|
||||
|
||||
public static void render(final Context context, final TextView textView, final String url, String name, String nameAncher, final String text, int intoIndex, WindowManager windowManager, String type) {
|
||||
public AllMsgTextRender(LiveGiftAnimPresenter giftAnimPresenter) {
|
||||
this.giftAnimPresenter = giftAnimPresenter;
|
||||
}
|
||||
|
||||
public void render(final Context context, final TextView textView, final String url, String name, String nameAncher, final String text, int intoIndex, WindowManager windowManager, String type) {
|
||||
if (intoIndex == 4) {
|
||||
textView.setText(name);
|
||||
LiveGiftAnimPresenter.setCountDownTimerEnd(1);
|
||||
giftAnimPresenter.setCountDownTimerEnd(1);
|
||||
return;
|
||||
}
|
||||
builder = new SpannableStringBuilder();
|
||||
@@ -66,7 +71,7 @@ public class AllMsgTextRender {
|
||||
builder = createPrefix(drawable, builder);
|
||||
builder = renderMsg(color2, builder, text);
|
||||
textView.setText(builder);
|
||||
LiveGiftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
giftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,7 +79,7 @@ public class AllMsgTextRender {
|
||||
builder = createPrefix(null, builder);
|
||||
builder = renderMsg(color2, builder, text);
|
||||
textView.setText(builder);
|
||||
LiveGiftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
giftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -112,14 +117,14 @@ public class AllMsgTextRender {
|
||||
builder = renderMsg(color2, builder, text2);
|
||||
textView.setText(builder);
|
||||
// textView.init(windowManager);
|
||||
LiveGiftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
giftAnimPresenter.setCountDownTimerEnd(intoIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染消息
|
||||
*/
|
||||
private static SpannableStringBuilder renderMsg(int color, SpannableStringBuilder builder, String str) {
|
||||
private SpannableStringBuilder renderMsg(int color, SpannableStringBuilder builder, String str) {
|
||||
int length = builder.length();
|
||||
builder.append(str);
|
||||
builder.setSpan(new ForegroundColorSpan(color), length, length + str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
@@ -130,7 +135,7 @@ public class AllMsgTextRender {
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
private static SpannableStringBuilder createPrefix(Drawable levelDrawable, SpannableStringBuilder builder) {
|
||||
private SpannableStringBuilder createPrefix(Drawable levelDrawable, SpannableStringBuilder builder) {
|
||||
int index = builder.length();
|
||||
|
||||
if (levelDrawable != null) {
|
||||
|
||||
@@ -230,28 +230,28 @@ public class LiveTextRender {
|
||||
int index = 0;
|
||||
|
||||
if (levelDrawable != null) {
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14));
|
||||
builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
}
|
||||
|
||||
if (gzDrawablesMap.containsKey(bean)) {//贵族
|
||||
builder.append(" ");
|
||||
gzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(18));
|
||||
builder.append(" ");
|
||||
gzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(35), DpUtil.dp2px(20));
|
||||
builder.setSpan(new VerticalImageSpan(gzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
}
|
||||
|
||||
if (ryxzDrawablesMap.containsKey(bean)) {//荣誉勋章
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
ryxzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(18));
|
||||
builder.setSpan(new VerticalImageSpan(ryxzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
}
|
||||
|
||||
if (nhDrawablesMap.containsKey(bean)) {//靓号
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
nhDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(17));
|
||||
builder.setSpan(new VerticalImageSpan(nhDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
@@ -268,7 +268,7 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
if (drawable != null) {
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(16));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
@@ -280,7 +280,7 @@ public class LiveTextRender {
|
||||
&& !bean.getMedalNmae().equals("null") && !bean.getMedalNmae().equals("(null)") && !bean.getMedalNmae().equals("<null>")) {//粉丝徽章图标
|
||||
Drawable drawable = getMedalImage(bean);
|
||||
if (drawable != null) {
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(44), DpUtil.dp2px(17));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
@@ -291,7 +291,7 @@ public class LiveTextRender {
|
||||
if (bean.isManager()) {//直播间管理员图标
|
||||
Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m);
|
||||
if (drawable != null) {
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index = builder.length();
|
||||
@@ -301,7 +301,7 @@ public class LiveTextRender {
|
||||
if (!TextUtils.isEmpty(bean.getLiangName())) {//靓号图标
|
||||
Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_liang);
|
||||
if (drawable != null) {
|
||||
builder.append(" ");
|
||||
builder.append(" ");
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// new add
|
||||
@@ -528,9 +528,9 @@ public class LiveTextRender {
|
||||
int indexX = 80;
|
||||
//水印的位置坐标
|
||||
if (level.length() > 2) {
|
||||
indexX = 75;
|
||||
indexX = 87;
|
||||
} else {
|
||||
indexX = 84;
|
||||
indexX = 95;
|
||||
}
|
||||
mCanvas.drawText(level, indexX, 53, mPaint);
|
||||
mCanvas.save();
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.TextView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.ms.banner.holder.BannerViewHolder;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.weight.ProgressView;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
@@ -63,9 +64,11 @@ public class CustomViewHolder implements BannerViewHolder<BannerBean> {
|
||||
currentAssist.setText(String.valueOf(currentAssistNum));
|
||||
title.setText(String.format(context.getString(R.string.star_change),data.getModel().getTaskNum()));
|
||||
} else {
|
||||
String imagerUrl = data.getImageUrl().replace("qny", "downs");
|
||||
Glide.with(context).load(imagerUrl).into(bannerBack);
|
||||
startContext.setVisibility(View.GONE);
|
||||
if(data!=null&&!StringUtil.isEmpty(data.getImageUrl())) {
|
||||
String imagerUrl = data.getImageUrl().replace("qny", "downs");
|
||||
Glide.with(context).load(imagerUrl).into(bannerBack);
|
||||
startContext.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
return contextView;
|
||||
|
||||
@@ -16,12 +16,8 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.utils.FileUtil;
|
||||
import com.yunbao.common.utils.TimeUtils;
|
||||
@@ -175,20 +171,7 @@ public class InputPanelViewHolder extends LinearLayout implements View.OnClickLi
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
if(isAdmin){
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("2kjbwx");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
CommonHttpUtil.setAdvertisingChannels("2kjbwx", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
FirebaseAnalytics.getInstance(getContext()).logEvent("FS_director_first_chat", null);
|
||||
AppEventsLogger.newLogger(getContext()).logEvent("FB_director_first_chat");
|
||||
}
|
||||
}
|
||||
});
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("g9lzss");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
if (isAdmin) {
|
||||
FirebaseAnalytics.getInstance(getContext()).logEvent("FS_director_chat", null);
|
||||
AppEventsLogger.newLogger(getContext()).logEvent("FB_director_chat");
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.http.main.MainNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
@@ -200,12 +201,22 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
|
||||
public static void upData(String votes, String length, int nums, String uname) {
|
||||
Log.e("收", votes + "votes" + length + "length" + nums + "nums");
|
||||
if (type == LiveOfType.USER) {
|
||||
liveDurationUser.setText(length);
|
||||
liveNameUser.setText(uname);
|
||||
if (liveDurationUser != null) {
|
||||
liveDurationUser.setText(length);
|
||||
}
|
||||
if (liveNameUser != null) {
|
||||
liveNameUser.setText(uname);
|
||||
}
|
||||
} else {
|
||||
liveDurationAnchor.setText(length);
|
||||
liveVotes.setText(votes);
|
||||
liveWatchNum.setText(StringUtil.toWan(nums));
|
||||
if (liveDurationAnchor != null) {
|
||||
liveDurationAnchor.setText(length);
|
||||
}
|
||||
if (liveVotes != null) {
|
||||
liveVotes.setText(votes);
|
||||
}
|
||||
if (liveWatchNum != null) {
|
||||
liveWatchNum.setText(StringUtil.toWan(nums));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,18 +324,26 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal).setLiveEnd(true));
|
||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
Bus.get().post(new CloseEvent());
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
Bus.get().post(new CloseEvent());
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(event.getModel().getId()), 0);
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
||||
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -16,8 +22,10 @@ import android.view.ViewParent;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzy.okserver.OkDownload;
|
||||
import com.lzy.okserver.download.DownloadTask;
|
||||
import com.tencent.live2.V2TXLiveDef;
|
||||
@@ -25,25 +33,31 @@ import com.tencent.live2.V2TXLivePlayer;
|
||||
import com.tencent.live2.V2TXLivePlayerObserver;
|
||||
import com.tencent.live2.impl.V2TXLivePlayerImpl;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
@@ -55,6 +69,7 @@ import cn.rongcloud.rtc.api.callback.IRCRTCResultDataCallback;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCRoomEventsListener;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleDataCallback;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCVideoInputFrameListener;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCLiveInfo;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCOutputStream;
|
||||
@@ -64,12 +79,10 @@ import cn.rongcloud.rtc.api.stream.RCRTCVideoView;
|
||||
import cn.rongcloud.rtc.base.RCRTCLiveRole;
|
||||
import cn.rongcloud.rtc.base.RCRTCMediaType;
|
||||
import cn.rongcloud.rtc.base.RCRTCParamsType;
|
||||
import cn.rongcloud.rtc.base.RCRTCRemoteVideoFrame;
|
||||
import cn.rongcloud.rtc.base.RCRTCRoomType;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
|
||||
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
|
||||
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
||||
|
||||
public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
|
||||
private static final String TAG = "LivePlayViewHolder";
|
||||
@@ -80,7 +93,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
private RelativeLayout mPkContainer;
|
||||
public static TXCloudVideoView mVideoView;
|
||||
|
||||
private View mLoading;
|
||||
private View mLoading, mLoading2;
|
||||
private ImageView mCover;
|
||||
private boolean mPaused;//是否切后台了
|
||||
private boolean mStarted;//是否开始了播放
|
||||
@@ -88,23 +101,27 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
public static ImageView leave;
|
||||
|
||||
private boolean mPausedPlay;//是否被动暂停了播放
|
||||
public static int landscape; //1h 2s
|
||||
public int landscape; //1h 2s
|
||||
public static Context contexts;
|
||||
public V2TXLivePlayer mPlayer;
|
||||
public static FrameLayout ry_view;
|
||||
|
||||
|
||||
int screenWidth; // 屏幕宽(像素,如:480px)
|
||||
int screenHeight; // 屏幕高(像素,如:800p)
|
||||
private static final int VIDEO_VERTICAL = 1;
|
||||
private static final int VIDEO_HORIZONTAL = 2;
|
||||
int videoLandscape; // 视频方向,1=竖屏,2=横屏
|
||||
|
||||
static int vHeight;//视频高
|
||||
private TextView debugView;
|
||||
|
||||
|
||||
//0未申请1申请中2连麦中
|
||||
public static int Micing = 0;
|
||||
RCRTCRoom rcrtcRoom;
|
||||
String purl;
|
||||
|
||||
public int getLandscape() {
|
||||
return landscape;
|
||||
}
|
||||
|
||||
public LivePlayRyViewHolder(Context context, ViewGroup parentView, int landscapes) {
|
||||
super(context, parentView);
|
||||
contexts = context;
|
||||
@@ -112,14 +129,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
Log.i("收收收", landscape + "");
|
||||
}
|
||||
|
||||
public LivePlayRyViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
}
|
||||
|
||||
public static void setLandscape(int landscape) {
|
||||
Log.i("收", "是的" + landscape);
|
||||
LivePlayKsyViewHolder.landscape = landscape;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -138,6 +147,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
ry_view = (FrameLayout) findViewById(R.id.ry_view);
|
||||
leave = (ImageView) findViewById(R.id.leave);
|
||||
mLoading = findViewById(R.id.loading);
|
||||
mLoading2 = findViewById(R.id.loading2);
|
||||
mCover = (ImageView) findViewById(R.id.cover);
|
||||
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
||||
int mScreenWdith = util.getScreenWdith();
|
||||
@@ -148,25 +158,82 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
mPkContainer.requestLayout();
|
||||
mPlayer = new V2TXLivePlayerImpl(mContext);
|
||||
mPlayer.setRenderView(mVideoView);
|
||||
|
||||
debugView = new TextView(mContext);
|
||||
debugView.setBackgroundColor(Color.WHITE);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideCover() {
|
||||
if (mCover != null) {
|
||||
mCover.animate().alpha(0).setDuration(500).start();
|
||||
}
|
||||
// if (mCover != null) {
|
||||
// if (mCover.getVisibility()==View.VISIBLE){
|
||||
//// new Handler().postDelayed(new Runnable() {
|
||||
//// @Override
|
||||
//// public void run() {
|
||||
////
|
||||
//// }
|
||||
//// },200);
|
||||
// mCover.setVisibility(View.GONE);
|
||||
// mLoading2.setVisibility(View.GONE);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCover(String coverUrl) {
|
||||
if (mCover != null) {
|
||||
ImgLoader.displayBlur(mContext, coverUrl, mCover);
|
||||
}
|
||||
// if (mCover != null) {
|
||||
// mCover.setVisibility(View.VISIBLE);
|
||||
// mLoading2.setVisibility(View.VISIBLE);
|
||||
// ImgLoader.displayBlurLive(mContext, coverUrl, mCover, 400, 600);
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLiveBeanLandscape(int landscape) {
|
||||
LivePlayRyViewHolder.landscape =landscape;
|
||||
public synchronized void setLiveBeanLandscape(int landscape) {
|
||||
this.landscape = landscape;
|
||||
if (landscape == 2) {
|
||||
Log.i("收到socket--->", "还原9:16");
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
params.topMargin = 0;
|
||||
mVideoView.setLayoutParams(params);
|
||||
mVideoView.requestLayout();
|
||||
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
|
||||
params1.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
params1.topMargin = 0;
|
||||
ry_view.setLayoutParams(params1);
|
||||
ry_view.requestLayout();
|
||||
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) mCover.getLayoutParams();
|
||||
params2.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
params2.topMargin = 0;
|
||||
mCover.setLayoutParams(params2);
|
||||
mCover.requestLayout();
|
||||
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = vHeight;
|
||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||
mVideoView.setLayoutParams(params);
|
||||
mVideoView.requestLayout();
|
||||
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
|
||||
params1.height = vHeight;
|
||||
params1.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
params1.addRule(RelativeLayout.ALIGN_TOP);
|
||||
ry_view.setLayoutParams(params1);
|
||||
ry_view.requestLayout();
|
||||
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) mCover.getLayoutParams();
|
||||
params2.height = DpUtil.dp2px(270);
|
||||
params2.topMargin = DpUtil.dp2px(120);
|
||||
mCover.setLayoutParams(params2);
|
||||
mCover.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,7 +249,15 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
*/
|
||||
@Override
|
||||
public void resumePlay() {
|
||||
|
||||
if (mPlayer.isPlaying() != 1) {
|
||||
new Handler(Looper.getMainLooper())
|
||||
.postDelayed(() -> {
|
||||
mPlayer.stopPlay();
|
||||
int val = mPlayer.startPlay(purl);
|
||||
// ToastUtil.show("强制播放" + val);
|
||||
Log.i(TAG, "强制播放: " + val);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,7 +277,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
if (TextUtils.isEmpty(url) || mVideoView == null) {
|
||||
return;
|
||||
}
|
||||
//mPlayer.setCacheParams(1.0f, 5.0f);
|
||||
mVideoView.clearLastFrame(true);
|
||||
mPlayer.setObserver(new V2TXLivePlayerObserver() {
|
||||
String TAG = "播放流";
|
||||
@@ -211,6 +285,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
public void onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
|
||||
super.onError(player, code, msg, extraInfo);
|
||||
Log.i(TAG, "onError: player = " + player + ", code = " + code + ", msg = " + msg + ", extraInfo = " + extraInfo);
|
||||
debugView.setText("播放出错code=" + code + " msg=" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -223,6 +298,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
mPlayer.stopPlay();
|
||||
mPlayer.startPlay(purl);
|
||||
}
|
||||
debugView.setText("播放警告code=" + code + " msg=" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,11 +347,28 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
break;
|
||||
case 5:
|
||||
buffer.append("完成");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
buffer.append("|");
|
||||
}
|
||||
//Log.i(TAG, "onStatisticsUpdate: " + JSON.toJSONString(statistics) + " |当前下载数 : " + OkDownload.getInstance().getTaskMap().size() + buffer);
|
||||
hideCover();
|
||||
String debugText = "视频码率:" + statistics.videoBitrate + "\n" +
|
||||
"音频码率:" + statistics.audioBitrate + "\n" +
|
||||
"FPS:" + statistics.fps + "\n" +
|
||||
"CPU:" + statistics.appCpu + "\n" +
|
||||
"剩余内存:" + DeviceUtils.getMemory(mContext) + "\n" +
|
||||
"分辨率:" + statistics.height + "x" + statistics.width + "\n" +
|
||||
"播放状态:" + mPlayer.isPlaying() + "\n" +
|
||||
"运行时间:" + (System.currentTimeMillis()- CrashSaveBean.getInstance().getStartTime())/1000 + "\n";
|
||||
debugView.setText(debugText);
|
||||
Log.i(TAG, "onStatisticsUpdate: " + JSON.toJSONString(statistics) + " |当前下载数 : " + OkDownload.getInstance().getTaskMap().size() + buffer);
|
||||
if (statistics.height > statistics.width) {
|
||||
videoLandscape = VIDEO_VERTICAL;
|
||||
} else {
|
||||
videoLandscape = VIDEO_HORIZONTAL;
|
||||
}
|
||||
if (statistics.fps == 0) {
|
||||
OkDownload.getInstance().pauseAll();
|
||||
} else {
|
||||
@@ -300,7 +393,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
});
|
||||
|
||||
purl = url;
|
||||
mPlayer.startPlay(url);
|
||||
int V2TXLiveCode = mPlayer.startPlay(url);
|
||||
onPrepared();
|
||||
|
||||
}
|
||||
@@ -337,7 +430,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
|
||||
public static void setViewUP(int i) {
|
||||
if (mVideoView == null) return;
|
||||
Log.i("收", "整理" + i);
|
||||
Log.e("收", "整理" + i);
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = vHeight;
|
||||
params.topMargin = contexts.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
@@ -359,32 +452,57 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
release();
|
||||
return;
|
||||
}
|
||||
int height;
|
||||
if (videoLandscape == VIDEO_VERTICAL) {
|
||||
height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
} else {
|
||||
height = DpUtil.dp2px(285);
|
||||
}
|
||||
if (landscape == 2) {
|
||||
Log.i("收到socket--->", "还原9:16");
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
params.height = height;
|
||||
params.topMargin = 0;
|
||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||
mVideoView.setLayoutParams(params);
|
||||
mVideoView.requestLayout();
|
||||
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
|
||||
params1.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||
params1.height = height;
|
||||
params1.topMargin = 0;
|
||||
ry_view.setLayoutParams(params1);
|
||||
ry_view.requestLayout();
|
||||
|
||||
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) mCover.getLayoutParams();
|
||||
params2.height = height;
|
||||
params2.topMargin = 0;
|
||||
mCover.setLayoutParams(params2);
|
||||
mCover.requestLayout();
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = vHeight;
|
||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
params.height = height;
|
||||
params.topMargin = 0;
|
||||
if (videoLandscape == VIDEO_HORIZONTAL) {
|
||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
}
|
||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||
mVideoView.setLayoutParams(params);
|
||||
mVideoView.requestLayout();
|
||||
|
||||
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
|
||||
params1.height = vHeight;
|
||||
params1.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
params1.height = height;
|
||||
params1.topMargin = 0;
|
||||
params1.addRule(RelativeLayout.ALIGN_TOP);
|
||||
if (videoLandscape == VIDEO_HORIZONTAL) {
|
||||
params1.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
}
|
||||
ry_view.setLayoutParams(params1);
|
||||
ry_view.requestLayout();
|
||||
RelativeLayout.LayoutParams params2 = (RelativeLayout.LayoutParams) mCover.getLayoutParams();
|
||||
params2.height = height;
|
||||
params2.topMargin = DpUtil.dp2px(120);
|
||||
mCover.setLayoutParams(params2);
|
||||
mCover.requestLayout();
|
||||
}
|
||||
hideCover();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -398,7 +516,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPkEndview() {
|
||||
public synchronized void setPkEndview() {
|
||||
|
||||
Log.i("收收收", landscape + "");
|
||||
|
||||
@@ -412,7 +530,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
} else {
|
||||
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
|
||||
params.height = vHeight;
|
||||
// params.height = mContext.getResources().getDimensionPixelOffset(R.dimen.live_view);
|
||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||
mVideoView.requestLayout();
|
||||
@@ -539,12 +656,29 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
}
|
||||
});
|
||||
} else if ("inviteMic".equals(str)) {
|
||||
DialogUitl.showSimpleDialog(mContext, "主播邀請您進行語音連麥", new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
UsertoRY();
|
||||
}
|
||||
});
|
||||
DialogUitl.Builder builder = new DialogUitl.Builder(mContext)
|
||||
.setContent("邀請您進行語音連麥")
|
||||
.setTitle(mLiveBean.getUserNiceName())
|
||||
.setConfrimString("接受")
|
||||
.setCancelString("拒絕")
|
||||
.setView(R.layout.dialog_live_mic_invite)
|
||||
.setClickCallback(new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
LiveAudienceActivity.mProcessResultUtil.requestPermissions(new String[]{
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
UsertoRY();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
builder.build().show();
|
||||
|
||||
} else if ("endMic".equals(str)) {
|
||||
if (rcrtcRoom != null) {
|
||||
@@ -577,10 +711,15 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
mPlayer.startPlay(purl);
|
||||
}
|
||||
ry_view.removeAllViews();
|
||||
ry_view.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
onPrepared();
|
||||
rcrtcRoom = null;
|
||||
Micing = 0;
|
||||
MicStatusManager.getInstance().clear();
|
||||
ToastUtil.show("已成功退出語音連麥");
|
||||
resumePlay();
|
||||
if (onMicCallback != null) {
|
||||
onMicCallback.onMikUpdate();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -605,6 +744,16 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if ("Debug".equals(str)) {
|
||||
if (EasyFloat.isShow("Debug")) {
|
||||
EasyFloat.dismiss("Debug");
|
||||
return;
|
||||
}
|
||||
EasyFloat.with(mContext)
|
||||
.setDragEnable(true)
|
||||
.setTag("Debug")
|
||||
.setLayout(debugView)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -792,6 +941,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
Log.e("ry", "切换成功");
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
if (onMicCallback != null) {
|
||||
onMicCallback.onMikUpdate();
|
||||
}
|
||||
//遍历远端用户列表
|
||||
for (int i = 0; i < rcrtcRoom.getRemoteUsers().size(); i++) {
|
||||
Log.e("ry", rcrtcRoom.getRemoteUsers().get(i).getUserId() + "收到rcrtcOtherRoom" + rcrtcRoom.getRemoteUsers().size());
|
||||
@@ -803,6 +955,20 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||
((RCRTCVideoInputStream) stream).setVideoFrameListener(new IRCRTCVideoInputFrameListener() {
|
||||
@Override
|
||||
public void onFrame(RCRTCRemoteVideoFrame videoFrame) {
|
||||
String debugText = "视频类型:" + videoFrame.getFrameType().name() + "\n" +
|
||||
"rotation:" + videoFrame.getRotation() + "\n" +
|
||||
"timestampNs:" + videoFrame.getTimestampNs() + "\n" +
|
||||
"分辨率:" + videoFrame.getBuffer().getHeight() + "x" + videoFrame.getBuffer().getWidth() + "\n" +
|
||||
"当前时间:" + new SimpleDateFormat("HH:mm:ss", Locale.CHINA).format(new Date()) + "\n";
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
debugView.setText(debugText);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
//todo 本demo只演示添加1个远端用户的视图
|
||||
ry_view.removeAllViews();
|
||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||
@@ -818,7 +984,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.e("ry", "订阅资源成功");
|
||||
Micing = 2;
|
||||
MicStatusManager.getInstance().setMicData(MicStatusManager.MIC_TYPE_OPEN, LiveActivity.mLiveUid);
|
||||
AudioManager audioManager = (AudioManager) contexts.getSystemService(Context.AUDIO_SERVICE);
|
||||
RCRTCEngine.getInstance().enableSpeaker(true);
|
||||
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yunbao.live.views;
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
|
||||
@@ -11,6 +12,9 @@ import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
*/
|
||||
|
||||
public abstract class LiveRoomPlayViewHolder extends AbsViewHolder implements ILiveLinkMicViewHolder {
|
||||
protected LiveBean mLiveBean;
|
||||
|
||||
OnMicCallback onMicCallback;//连麦回调
|
||||
|
||||
public LiveRoomPlayViewHolder(Context context, ViewGroup parentView) {
|
||||
super(context, parentView);
|
||||
@@ -41,4 +45,22 @@ public abstract class LiveRoomPlayViewHolder extends AbsViewHolder implements IL
|
||||
public abstract void setPkEndview();
|
||||
|
||||
public abstract void setLiveBeanLandscape(int landscape);
|
||||
|
||||
public void setLiveBean(LiveBean data) {
|
||||
this.mLiveBean = data;
|
||||
}
|
||||
|
||||
public OnMicCallback getOnMicCallback() {
|
||||
return onMicCallback;
|
||||
}
|
||||
|
||||
public void setOnMicCallback(OnMicCallback onMicCallback) {
|
||||
this.onMicCallback = onMicCallback;
|
||||
}
|
||||
|
||||
|
||||
public interface OnMicCallback{
|
||||
void onMikUpdate();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY;
|
||||
|
||||
import android.app.Activity;
|
||||
@@ -38,8 +36,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -63,15 +59,23 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.bean.GiftModel;
|
||||
import com.yunbao.common.bean.GuardUserModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewPeopleTaskModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.RankHourModel;
|
||||
import com.yunbao.common.bean.RewardAllModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.TaskModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.API;
|
||||
@@ -86,12 +90,12 @@ 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.MicStatusManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.utils.formatBigNum;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
@@ -117,7 +121,6 @@ import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.bean.LiveWishlistBean;
|
||||
import com.yunbao.live.bean.WishlistItemModel;
|
||||
import com.yunbao.live.custom.LiveLightView;
|
||||
@@ -258,9 +261,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
static ImageView pk5Ico;
|
||||
static RelativeLayout pk5;
|
||||
|
||||
static RelativeLayout mic_view;
|
||||
static RelativeLayout mic_view1;
|
||||
static RelativeLayout mic_view2;
|
||||
RelativeLayout mic_view;
|
||||
RelativeLayout mic_view1;
|
||||
RelativeLayout mic_view2;
|
||||
|
||||
static ImageView mic_ico;
|
||||
static RoundedImageView mic_ico1;
|
||||
@@ -317,6 +320,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
private TextView mRedVal, mBlueVal;
|
||||
private String pkUid = "";
|
||||
|
||||
//接口整合新加参数
|
||||
private GuardUserModel guardUserModel;
|
||||
private ViewFlipper flipper;
|
||||
|
||||
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
|
||||
super(context, parentView);
|
||||
Contexts = context;
|
||||
@@ -334,26 +341,26 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
//更新连麦人
|
||||
public static List<String> mic_ids = new ArrayList<>();
|
||||
public List<String> mic_ids = new ArrayList<>();
|
||||
|
||||
public static void updataMicList(JSONArray obj) {
|
||||
public void updataMicList(List<LinkMicUserBean> list) {
|
||||
mic_ids.clear();
|
||||
updataCleanMic();
|
||||
//拿到原始数据
|
||||
for (int j = 0; j < obj.size(); j++) {
|
||||
JSONObject mic = obj.getJSONObject(j);
|
||||
if (j == 1) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
LinkMicUserBean bean = list.get(i);
|
||||
if (i == 1) {
|
||||
mic_view.setVisibility(View.VISIBLE);
|
||||
mic_ids.add(mic.getString("id"));
|
||||
ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico);
|
||||
} else if (j == 2) {
|
||||
mic_ids.add(bean.getId());
|
||||
ImgLoader.display2(Contexts, bean.getAvatar(), mic_ico);
|
||||
} else if (i == 2) {
|
||||
mic_view1.setVisibility(View.VISIBLE);
|
||||
mic_ids.add(mic.getString("id"));
|
||||
ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico1);
|
||||
} else if (j == 3) {
|
||||
mic_ids.add(bean.getId());
|
||||
ImgLoader.display2(Contexts, bean.getAvatar(), mic_ico1);
|
||||
} else if (i == 3) {
|
||||
mic_view2.setVisibility(View.VISIBLE);
|
||||
mic_ids.add(mic.getString("id"));
|
||||
ImgLoader.display2(Contexts, mic.getString("avatar"), mic_ico2);
|
||||
mic_ids.add(bean.getId());
|
||||
ImgLoader.display2(Contexts, bean.getAvatar(), mic_ico2);
|
||||
}
|
||||
}
|
||||
mic_view.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -376,7 +383,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
public static void updataCleanMic() {
|
||||
public void updataCleanMic() {
|
||||
mic_view.setVisibility(View.GONE);
|
||||
mic_view1.setVisibility(View.GONE);
|
||||
mic_view2.setVisibility(View.GONE);
|
||||
@@ -691,7 +698,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mic_view = (RelativeLayout) findViewById(R.id.mic_view);
|
||||
mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1);
|
||||
mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2);
|
||||
|
||||
flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
|
||||
mic_ico = (ImageView) findViewById(R.id.mic_ico);
|
||||
newMessage = (ImageView) findViewById(R.id.new_message);
|
||||
atMessage = (ImageView) findViewById(R.id.at_message);
|
||||
@@ -846,7 +853,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
layoutManager.setStackFromEnd(true);
|
||||
mChatRecyclerView.setLayoutManager(layoutManager);
|
||||
mChatRecyclerView.addItemDecoration(new TopGradual());
|
||||
mChatRecyclerView.setItemViewCacheSize(10);
|
||||
mLiveChatAdapter = new LiveChatAdapter(mContext);
|
||||
mChatRecyclerView.setAdapter(mLiveChatAdapter);
|
||||
mLiveChatAdapter.setOnItemClickListener(new OnItemClickListener<LiveChatBean>() {
|
||||
@Override
|
||||
public void onItemClick(LiveChatBean bean, int position) {
|
||||
@@ -875,7 +884,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
});
|
||||
mChatRecyclerView.setAdapter(mLiveChatAdapter);
|
||||
|
||||
mChatRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
@@ -1048,8 +1057,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
findViewById(R.id.open_sidebar).setVisibility(View.GONE);
|
||||
findViewById(R.id.btn_follow).setVisibility(View.GONE);
|
||||
findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
|
||||
} else {
|
||||
configBanner3();
|
||||
}
|
||||
reloadIM();
|
||||
initStarChallengeStatus();
|
||||
@@ -1075,20 +1082,33 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
public void resetView() {
|
||||
/**
|
||||
* 重置该隐藏的view
|
||||
*/
|
||||
public void resetViewGone() {
|
||||
goto_room_view.setVisibility(View.GONE);
|
||||
mPkRankTopIcon.setVisibility(View.GONE);
|
||||
lt_pk_line.setVisibility(View.GONE);
|
||||
time.setVisibility(View.GONE);
|
||||
if (!SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) {
|
||||
msgLayout.setVisibility(View.GONE);
|
||||
}
|
||||
if (!IMLoginManager.get(mContext).hintChat()) {
|
||||
msgLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (d_pk_view != null) {
|
||||
d_pk_view.setVisibility(View.GONE);
|
||||
}
|
||||
if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) {
|
||||
fans_btn.setVisibility(View.GONE);
|
||||
}
|
||||
mPkRankTopIcon.setVisibility(View.GONE);
|
||||
lt_pk_line.setVisibility(View.GONE);
|
||||
time.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据
|
||||
*/
|
||||
public void resetView() {
|
||||
resetViewGone();
|
||||
mBannerList1.clear();
|
||||
mBannerList2.clear();
|
||||
mBannerList3.clear();
|
||||
@@ -1149,8 +1169,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
msgLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void addWishList(BannerBean bannerModel) {
|
||||
mBannerList2.add(bannerModel);
|
||||
/**
|
||||
* 添加心愿单轮播he活动
|
||||
*/
|
||||
public void addWishListActivity(List<BannerBean> bannerModels) {
|
||||
mBannerList2.addAll(bannerModels);
|
||||
if (mBanner2.isStart()) {
|
||||
mBanner2.update(mBannerList2);
|
||||
} else {
|
||||
@@ -1480,11 +1503,58 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
public void initHourRank(RankHourModel model) {
|
||||
if (flipper.getChildCount() > 0) {
|
||||
flipper.removeAllViews();
|
||||
}
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
textParams.leftMargin = DpUtil.dp2px(5);
|
||||
View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
ImageView hotPic = hotView.findViewById(R.id.wish_pic);
|
||||
ImageView hourPic = hourView.findViewById(R.id.wish_pic);
|
||||
mHotText = hotView.findViewById(R.id.wish_index);
|
||||
mHourRank = hourView.findViewById(R.id.wish_index);
|
||||
mHotText.setText("0");
|
||||
mHotText.setLayoutParams(textParams);
|
||||
mHourRank.setLayoutParams(textParams);
|
||||
mHotText.setGravity(Gravity.CENTER);
|
||||
mHourRank.setGravity(Gravity.CENTER);
|
||||
setHourRankData(Long.parseLong(model.getRank()));
|
||||
hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en);
|
||||
hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en);
|
||||
hotPic.setLayoutParams(params);
|
||||
hourPic.setLayoutParams(params);
|
||||
flipper.addView(hotView);
|
||||
flipper.addView(hourView);
|
||||
flipper.startFlipping();
|
||||
flipper.setOnClickListener(view -> {
|
||||
Bundle bundle = new Bundle();
|
||||
String path = model.getHourchartH5Url();
|
||||
if (!path.startsWith("/")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
String url = CommonAppConfig.HOST + path;
|
||||
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||
bundle.putString("url", url);
|
||||
bundle.putInt("height", DpUtil.dp2px(500));
|
||||
bundle.putInt("show_type", 0);
|
||||
bundle.putString("roomId", mLiveUid);
|
||||
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
|
||||
liveHDDialogFragment.setArguments(bundle);
|
||||
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化小时榜
|
||||
*/
|
||||
public void initHourRankList() {
|
||||
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
|
||||
if (flipper.getChildCount() > 0) {
|
||||
flipper.removeAllViews();
|
||||
}
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
textParams.leftMargin = DpUtil.dp2px(5);
|
||||
@@ -1534,7 +1604,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}, Throwable::printStackTrace)
|
||||
.isDisposed();
|
||||
initPkRank();
|
||||
}
|
||||
|
||||
private void initPkRankView(PkRankBean bean) {
|
||||
@@ -1570,66 +1639,68 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
public void initPkRank(String isLadders) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getPkRanksList(mLiveUid, pkUid)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(listResponseModel -> {
|
||||
PkRankBean bean = listResponseModel.getData().getInfo();
|
||||
if (bean != null) {
|
||||
Log.i("PK", bean.toString() + " | " + isLadders);
|
||||
initPkRankView(bean);
|
||||
if (!StringUtil.isEmpty(bean.getClickUrl())) {
|
||||
pkRankVf.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
String path = bean.getClickUrl();
|
||||
if (!path.startsWith("/")&&!path.startsWith("http")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
String url = null;
|
||||
if (path.startsWith("http") || path.startsWith("/http")) {
|
||||
url = path;
|
||||
} else {
|
||||
url = CommonAppConfig.HOST + path;
|
||||
}
|
||||
if (!url.contains("?")) {
|
||||
url += "?";
|
||||
} else {
|
||||
url += "&";
|
||||
}
|
||||
url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||
bundle.putString("url", url);
|
||||
//bundle.putInt("height", DpUtil.dp2px(600));
|
||||
bundle.putInt("show_type", 0);
|
||||
bundle.putString("roomId", mLiveUid);
|
||||
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
|
||||
liveHDDialogFragment.setArguments(bundle);
|
||||
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
});
|
||||
LiveNetManager.get(mContext)
|
||||
.getRandomPk(mLiveUid, pkUid, new com.yunbao.common.http.base.HttpCallback<PkRankBean>() {
|
||||
@Override
|
||||
public void onSuccess(PkRankBean bean) {
|
||||
if (bean != null) {
|
||||
initPkRankView(bean);
|
||||
if (!StringUtil.isEmpty(bean.getClickUrl())) {
|
||||
pkRankVf.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
String path = bean.getClickUrl();
|
||||
if (!path.startsWith("/") && !path.startsWith("http")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
String url = null;
|
||||
if (path.startsWith("http") || path.startsWith("/http")) {
|
||||
url = path;
|
||||
} else {
|
||||
url = CommonAppConfig.HOST + path;
|
||||
}
|
||||
if (!url.contains("?")) {
|
||||
url += "?";
|
||||
} else {
|
||||
url += "&";
|
||||
}
|
||||
url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token="
|
||||
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||
bundle.putString("url", url);
|
||||
bundle.putInt("height", DpUtil.dp2px(500));
|
||||
bundle.putInt("show_type", 0);
|
||||
bundle.putString("roomId", mLiveUid);
|
||||
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
|
||||
liveHDDialogFragment.setArguments(bundle);
|
||||
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
});
|
||||
}
|
||||
pkRankLayout.setVisibility(View.VISIBLE);
|
||||
mPkRankText.setText(bean.getName());
|
||||
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
|
||||
if (StringUtil.isEmpty(bean.getPkTopImgUrl())) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtil.isEmpty(isLadders)) {
|
||||
bean.setPkTopImgUrl(isLadders);
|
||||
}
|
||||
if (Integer.parseInt(bean.getRedVal()) > 2) {
|
||||
mRedVal.setVisibility(View.VISIBLE);
|
||||
mRedVal.setText(bean.getRedVal() + "連勝");
|
||||
}
|
||||
if (Integer.parseInt(bean.getBlueVal()) > 2) {
|
||||
mBlueVal.setVisibility(View.VISIBLE);
|
||||
mBlueVal.setText(bean.getBlueVal() + "連勝");
|
||||
}
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
}
|
||||
|
||||
mPkRankText.setText(bean.getName());
|
||||
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
|
||||
if (StringUtil.isEmpty(bean.getPkTopImgUrl()) || StringUtil.isEmpty(isLadders)) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtil.isEmpty(isLadders)) {
|
||||
bean.setPkTopImgUrl(isLadders);
|
||||
}
|
||||
if (Integer.parseInt(bean.getRedVal()) > 2) {
|
||||
mRedVal.setVisibility(View.VISIBLE);
|
||||
mRedVal.setText(bean.getRedVal() + "連勝");
|
||||
}
|
||||
if (Integer.parseInt(bean.getBlueVal()) > 2) {
|
||||
mBlueVal.setVisibility(View.VISIBLE);
|
||||
mBlueVal.setText(bean.getBlueVal() + "連勝");
|
||||
}
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
}
|
||||
}, Throwable::printStackTrace)
|
||||
.isDisposed();
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -1666,7 +1737,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
private void updatePkRank(PkRankBean bean) {
|
||||
mPkRankText.setText(bean.getName());
|
||||
ImgLoader.display(mContext, bean.getImg(), mPkRankIcon);
|
||||
initPkRank();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1942,14 +2012,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
public boolean pkHandler = true;
|
||||
|
||||
//左上角显示对方主播头像及昵称
|
||||
public void setOtherInfo(String touids, String url, String name) {
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!pkHandler) {
|
||||
return;
|
||||
}
|
||||
goto_room_view.setVisibility(View.VISIBLE);
|
||||
touid = touids;
|
||||
pkUid = touids;
|
||||
ImgLoader.displayAvatar(mContext, url, avatarOther);
|
||||
tv_avatarOther_name.setText(name);
|
||||
goto_room_view.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -1958,6 +2034,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
showUserDialog(touids);
|
||||
}
|
||||
});
|
||||
initPkRank();
|
||||
}
|
||||
}, 4000);//3秒后执行Runnable中的run方法
|
||||
|
||||
@@ -2042,9 +2119,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
} else {
|
||||
setHideMedalIcon(false);
|
||||
}
|
||||
|
||||
getIsHot();
|
||||
getGuardInfo();
|
||||
if (IMLoginManager.get(mContext).getUserInfo().anchorUserType()) {
|
||||
getIsHot();
|
||||
getGuardInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void getGuardInfo() {
|
||||
@@ -2060,6 +2138,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旧接口,主播端还在用这个,暂时保留,用户端用{@link #setGuardIcon(GuardUserModel)}
|
||||
*/
|
||||
@Deprecated
|
||||
private void setGuardIcon(LiveUserGiftBean guard) {
|
||||
if (guard != null) {
|
||||
nowGuardUser = guard;
|
||||
@@ -2072,6 +2154,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口整合守护展示,用户端使用
|
||||
*/
|
||||
public void setGuardIcon(GuardUserModel model) {
|
||||
if (model != null && !TextUtils.isEmpty(model.getGuardUserAvatar())) {
|
||||
guardUserModel = model;
|
||||
ViewGroup.LayoutParams params = userGuard.getLayoutParams();
|
||||
params.height = DpUtil.dp2px(30);
|
||||
params.width = DpUtil.dp2px(30);
|
||||
userGuard.setLayoutParams(params);
|
||||
ImgLoader.displayAvatar(mContext, model.getGuardUserAvatar(), userGuard);
|
||||
gift_svga.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 守护信息发生变化
|
||||
@@ -2310,11 +2407,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
@Override
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
mFirebaseAnalytics.logEvent("FS_Follow", null);
|
||||
logger.logEvent("FB_Follow", null);
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("oess6a");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
// SocketChatUtil.sendSystemMessage(mLiveUid, CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
||||
LiveActivity.sendSystemMessage(
|
||||
CommonAppConfig.getInstance().getUserBean().getUserNiceName() + WordUtil.getString(R.string.live_follow_anchor));
|
||||
}
|
||||
@@ -2532,6 +2624,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
tmp = chatBean;
|
||||
}
|
||||
setGuardIcon(tmp);
|
||||
if (mContext instanceof LiveAudienceActivity) {
|
||||
int type = 0;
|
||||
GuardUserModel model = new GuardUserModel();
|
||||
if (TextUtils.isEmpty(guardUserModel.getGuardType())) {
|
||||
type = Integer.parseInt(guardUserModel.getGuardType());
|
||||
}
|
||||
if (chatBean.getGuardType() != 0 && chatBean.getGuardType() > type) {
|
||||
model.setGuardType(String.valueOf(chatBean.getGuardType()));
|
||||
model.setGuardUserAvatar(chatBean.getAvatar());
|
||||
}
|
||||
setGuardIcon(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2643,6 +2747,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
((LiveAudienceActivity) mContext).openFansMedalOkWindow();
|
||||
|
||||
}
|
||||
if (!isAncher && bean.getGiftName().equals("粉絲牌")) {
|
||||
LiveAudienceActivity.is_fans = "1";
|
||||
}
|
||||
Log.i("tvss", bean.getDrpk_status() + "是" + mLiveUid + "vsss" + bean.getRoomnum());
|
||||
if (mLiveGiftAnimPresenter == null) {
|
||||
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
|
||||
@@ -2681,12 +2788,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* @param bean
|
||||
*/
|
||||
public void showBuyVipMessage(LiveReceiveGiftBean bean) {
|
||||
// if (mLiveGiftAnimPresenter == null) {
|
||||
// mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
|
||||
// }
|
||||
// mLiveGiftAnimPresenter.showBuyVipGiftAnim(bean);
|
||||
|
||||
noble.setVisibility(View.VISIBLE);
|
||||
switch (bean.getNobilityid()) {
|
||||
|
||||
case "1":
|
||||
noble.setRootView(bean.getUhead(),
|
||||
bean.getUname(),
|
||||
@@ -2923,12 +3027,31 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否有热度卡加成
|
||||
*/
|
||||
public static void getIsHot(String isUseHotCard) {
|
||||
ImgLoader.display2(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif);
|
||||
if ("1".equals(isUseHotCard)) {
|
||||
ft_hot_add.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
ft_hot_add.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void resetUserListWidth(int width) {
|
||||
ViewGroup.LayoutParams params = mUserRecyclerView.getLayoutParams();
|
||||
params.width = width;
|
||||
mUserRecyclerView.setLayoutParams(params);
|
||||
}
|
||||
|
||||
public void releaseGift() {
|
||||
if (mLiveGiftAnimPresenter != null) {
|
||||
mLiveGiftAnimPresenter.cancelAllAnim();
|
||||
}
|
||||
}
|
||||
|
||||
public void release() {
|
||||
EventBus.getDefault().unregister(this);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
|
||||
@@ -2949,6 +3072,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
mRefreshUserListCallback = null;
|
||||
mTimeChargeCallback = null;
|
||||
Contexts = null;
|
||||
}
|
||||
|
||||
public void clearData() {
|
||||
@@ -3093,59 +3217,56 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
/**
|
||||
* 初始化新人任务
|
||||
*/
|
||||
private void configBanner3() {
|
||||
LiveHttpUtil.getFrontTask(IMLoginManager.get(mContext).getUserInfo().getToken(), "" + IMLoginManager.get(mContext).getUserInfo().getId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
JSONObject old_obj = JSON.parseObject(info[0]);
|
||||
public void configBanner3(NewPeopleTaskModel newPeopleTask) {
|
||||
TaskModel taskModel = newPeopleTask.getTask();
|
||||
|
||||
JSONObject obj = old_obj.getJSONObject("task");
|
||||
if (obj != null) {
|
||||
JSONObject obj1 = old_obj.getJSONObject("gift");
|
||||
JSONObject reward_one = old_obj.getJSONObject("reward_one");
|
||||
if (taskModel != null) {
|
||||
GiftModel giftModel = newPeopleTask.getGift();
|
||||
if (giftModel != null) {
|
||||
RewardAllModel rewardOne = newPeopleTask.getRewardOne();
|
||||
String gold = rewardOne.getGold();
|
||||
String experience = rewardOne.getExperience();
|
||||
bean1 = new LiveGiftBean();
|
||||
bean1.setSwf(giftModel.getSwf());
|
||||
bean1.setChecked(false);
|
||||
bean1.setIcon(giftModel.getGifticon());
|
||||
bean1.setId(Integer.parseInt(giftModel.getId()));
|
||||
bean1.setName(giftModel.getGiftname());
|
||||
bean1.setTag("1");
|
||||
|
||||
String gold = reward_one.getString("gold");
|
||||
String experience = reward_one.getString("experience");
|
||||
bean1 = new LiveGiftBean();
|
||||
bean1.setSwf(obj1.getString("swf"));
|
||||
bean1.setChecked(false);
|
||||
bean1.setIcon(obj1.getString("gifticon"));
|
||||
bean1.setId(obj1.getIntValue("id"));
|
||||
bean1.setName(obj1.getString("giftname"));
|
||||
bean1.setTag("1");
|
||||
|
||||
if (IMLoginManager.get(mContext).isisNewUserOne() == false) {
|
||||
if (obj.getString("sendgift").equals("0")) {
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
}
|
||||
}
|
||||
BannerBean banner3Bean = new BannerBean();
|
||||
banner3Bean.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean.setLink(obj.getString("sendgift"));
|
||||
mBannerList3.add(banner3Bean);
|
||||
|
||||
|
||||
BannerBean banner3Bean1 = new BannerBean();
|
||||
banner3Bean1.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean1.setLink(obj.getString("attent"));
|
||||
mBannerList3.add(banner3Bean1);
|
||||
|
||||
BannerBean banner3Bean2 = new BannerBean();
|
||||
banner3Bean2.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean2.setLink(obj.getString("illumine"));
|
||||
mBannerList3.add(banner3Bean2);
|
||||
|
||||
if (obj.getString("sendgift").equals("0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
} else if (obj.getString("attent").equals("0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
} else if (obj.getString("illumine").equals("0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
if (!IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
if (TextUtils.equals(taskModel.getSendgift(), "0")) {
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
EventBus.getDefault().post("svga_new_user_gif");
|
||||
}
|
||||
}
|
||||
BannerBean banner3Bean = new BannerBean();
|
||||
banner3Bean.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean.setLink(taskModel.getSendgift());
|
||||
mBannerList3.add(banner3Bean);
|
||||
|
||||
|
||||
BannerBean banner3Bean1 = new BannerBean();
|
||||
banner3Bean1.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean1.setLink(taskModel.getAttent());
|
||||
mBannerList3.add(banner3Bean1);
|
||||
|
||||
BannerBean banner3Bean2 = new BannerBean();
|
||||
banner3Bean2.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
|
||||
banner3Bean2.setLink(taskModel.getIllumine());
|
||||
mBannerList3.add(banner3Bean2);
|
||||
|
||||
if (TextUtils.equals(taskModel.getSendgift(), "0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
} else if (TextUtils.equals(taskModel.getAttent(), "0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
} else if (TextUtils.equals(taskModel.getIllumine(), "0") && !IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
showBanner3(bean1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3489,32 +3610,42 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 前往直播间
|
||||
*/
|
||||
private void gotoLive(final String liveId) {
|
||||
noble.setVisibility(View.GONE);
|
||||
LiveHttpUtil.getLiveInfo(liveId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
if (liveBean1 == null) {
|
||||
return;
|
||||
}
|
||||
if (LivePlayRyViewHolder.Micing == 1) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(1)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||
} else if (LivePlayRyViewHolder.Micing == 2) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(2)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(liveTypeVal));
|
||||
} else {
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal));
|
||||
new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(1)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(Integer.parseInt(liveTypeVal)));
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIAN_MAI)
|
||||
.setMicIng(2)
|
||||
.setBean(liveBean).setLiveType(liveType).setLiveTypeVal(Integer.parseInt(liveTypeVal)));
|
||||
} else {
|
||||
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||
return;
|
||||
}
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, liveId, 0);
|
||||
}
|
||||
|
||||
@@ -79,12 +79,14 @@ public class OlineListActivity extends AbsActivity {
|
||||
List<OlineUserlistModel> audiencelistModels = new ArrayList<>();
|
||||
List<Map<Integer, List<OlineUserlistModel>>> mapList = new ArrayList<>();
|
||||
//讲贵族前置顺序
|
||||
for (OlineUserlistModel model : userlistModels) {
|
||||
int nobleId = Integer.parseInt(model.getNobleId());
|
||||
if (nobleId > 0) {
|
||||
noblelistModels.add(model);
|
||||
} else {
|
||||
audiencelistModels.add(model);
|
||||
if (userlistModels != null) {
|
||||
for (OlineUserlistModel model : userlistModels) {
|
||||
int nobleId = Integer.parseInt(model.getNobleId());
|
||||
if (nobleId > 0) {
|
||||
noblelistModels.add(model);
|
||||
} else {
|
||||
audiencelistModels.add(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<Integer, List<OlineUserlistModel>> noblerMap = new HashMap<>();
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import static com.yunbao.common.CommonAppContext.logger;
|
||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||
import static com.yunbao.live.views.LivePlayRyViewHolder.Micing;
|
||||
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
@@ -23,24 +21,21 @@ import androidx.annotation.NonNull;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.adjust.sdk.AdjustEvent;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.facebook.appevents.AppEventsLogger;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzf.easyfloat.permission.PermissionUtils;
|
||||
import com.lzf.easyfloat.utils.LifecycleUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.LiveRoomActivityModel;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@@ -52,9 +47,11 @@ import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.RandomUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@@ -73,9 +70,7 @@ import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.bean.OpenParametersModel;
|
||||
import com.yunbao.live.bean.WishlistModel;
|
||||
import com.yunbao.live.dialog.BlowkissDialog;
|
||||
import com.yunbao.live.dialog.NewUserDialog;
|
||||
import com.yunbao.live.event.LinkMicTxAccEvent;
|
||||
@@ -128,7 +123,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
private ImageView btnSmallScreen;
|
||||
private Intent mIntent;
|
||||
//直播间背景
|
||||
private ImageView liveBack;
|
||||
private ImageView liveBack, ivBg, ivLoading;
|
||||
|
||||
private View mask;
|
||||
//侧滑布局
|
||||
@@ -136,12 +131,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
//直播间拆分布局
|
||||
private LiveRoomPlayViewHolder mLivePlayViewHolder;
|
||||
//头部布局
|
||||
private LiveRoomViewHolder mLiveRoomViewHolder;
|
||||
public LiveRoomViewHolder mLiveRoomViewHolder;
|
||||
//底部布局
|
||||
public LiveAudienceViewHolder mLiveAudienceViewHolder;
|
||||
//观众与主播连麦逻辑
|
||||
private LiveLinkMicPresenter mLiveLinkMicPresenter;
|
||||
private LiveBean mLiveBean;
|
||||
|
||||
//sdk类型 0金山 1腾讯
|
||||
private int mLiveSDK;
|
||||
//主播与主播连麦逻辑
|
||||
@@ -186,6 +182,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
private boolean isEnterRoom = false;
|
||||
private boolean kick = false;
|
||||
|
||||
private View loading;
|
||||
|
||||
private int landscape;
|
||||
private String leaveStream = "", leaveGroupId = "";
|
||||
|
||||
public PortraitLiveManager setQuitF(boolean quitF) {
|
||||
isQuitF = quitF;
|
||||
return this;
|
||||
@@ -207,6 +208,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
playContainer = mRootContainer.findViewById(R.id.play_container);
|
||||
mViewPager = mRootContainer.findViewById(R.id.viewPager);
|
||||
btnSmallScreen = mRootContainer.findViewById(R.id.btn_small_screen);
|
||||
loading = mRootContainer.findViewById(R.id.loading);
|
||||
ivBg = mRootContainer.findViewById(R.id.iv_bg);
|
||||
ivLoading = mRootContainer.findViewById(R.id.iv_loading);
|
||||
mSecondPage = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.view_audience_page, mViewPager, false);
|
||||
mContainerWrap = mSecondPage.findViewById(R.id.container_wrap);
|
||||
mContainer = mSecondPage.findViewById(R.id.container);
|
||||
@@ -223,8 +227,21 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
//直播页面背景
|
||||
liveBack = mRootContainer.findViewById(R.id.live_back);
|
||||
mask = mRootContainer.findViewById(R.id.mask);
|
||||
MicStatusManager.getInstance().addOnMicListener(micStatusListener);
|
||||
}
|
||||
|
||||
private final MicStatusManager.OnMicStatusListener micStatusListener = new MicStatusManager.OnMicStatusListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
mViewPager.setCanScroll(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
mViewPager.setCanScroll(true);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) {
|
||||
isEnterRoom = false;
|
||||
@@ -243,8 +260,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
.setParametersModel(openParametersModel
|
||||
.setmLiveType(mLiveType)
|
||||
.setmLiveTypeVal(mLiveTypeVal)));
|
||||
loading.setVisibility(View.VISIBLE);
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg);
|
||||
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
|
||||
frameAnimation.start();
|
||||
if (mLivePlayViewHolder == null) {
|
||||
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mLiveBean.getLandscape());
|
||||
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1);
|
||||
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
|
||||
mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer);
|
||||
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
|
||||
@@ -257,19 +278,34 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.addToParent();
|
||||
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
|
||||
} else {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(1);
|
||||
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
|
||||
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
|
||||
|
||||
}
|
||||
//去除主播离开画面
|
||||
if (LivePlayKsyViewHolder.leave != null) {
|
||||
LivePlayKsyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
|
||||
}
|
||||
//直播间背景
|
||||
|
||||
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
|
||||
//ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack);
|
||||
|
||||
mask.setVisibility(View.VISIBLE);
|
||||
mLivePlayViewHolder.setCover(data.getThumb());
|
||||
mLivePlayViewHolder.play(data.getPull());
|
||||
mLivePlayViewHolder.setLiveBean(mLiveBean);
|
||||
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
|
||||
mLivePlayViewHolder.play(mLiveBean.getPull());
|
||||
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
|
||||
@Override
|
||||
public void onMikUpdate() {
|
||||
if (mContext instanceof LiveActivity) {
|
||||
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
|
||||
}
|
||||
}
|
||||
});
|
||||
mLiveRoomViewHolder.resetView();
|
||||
mLiveRoomViewHolder.clearChat();
|
||||
mLiveRoomViewHolder.setAvatar(data.getAvatar());
|
||||
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
|
||||
mLiveRoomViewHolder.setName(data.getUserNiceName());
|
||||
@@ -277,50 +313,273 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.setTitle(data.getTitle());
|
||||
mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
|
||||
mLiveRoomViewHolder.clearGuardIcon();
|
||||
|
||||
mLiveRoomViewHolder.clearChat();
|
||||
mLiveRoomViewHolder.releaseGift();
|
||||
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
|
||||
|
||||
mLiveRoomViewHolder.setLiveUid(data.getUid());
|
||||
|
||||
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this);
|
||||
if (mLiveLinkMicPresenter != null) {
|
||||
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
|
||||
}
|
||||
//心愿单
|
||||
LiveHttpUtil.getWishList(mLiveBean.getUid(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (info.length > 0) {
|
||||
String json = info[0];
|
||||
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class);
|
||||
if (mLiveRoomViewHolder != null && model != null && model.getWishlist().size() > 0) {
|
||||
BannerBean bannerModel = new BannerBean();
|
||||
bannerModel.setShow_type("2");
|
||||
bannerModel.setLink(CommonAppConfig.HOST + "/index.php");
|
||||
bannerModel.setImageUrl(model.getImg());
|
||||
mLiveRoomViewHolder.addWishList(bannerModel);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
enterRoom();
|
||||
mLiveRoomViewHolder.initHourRankList();
|
||||
mLiveRoomViewHolder.showLiveRoomActivityBanner();
|
||||
enterRoomNew();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private Runnable sendFIm = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//加入房间发送Im消息
|
||||
LiveNetManager.get(mContext).userJoinRoomNew(mLiveBean.getStream(), mLiveBean.getUid());
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 新进入房间接口
|
||||
*/
|
||||
private void enterRoomNew() {
|
||||
timeIndex = 0;
|
||||
LiveNetManager.get(mContext)
|
||||
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
|
||||
@Override
|
||||
public void onSuccess(EnterRoomNewModel data) {
|
||||
|
||||
isEnterRoom = true;
|
||||
if (TextUtils.isEmpty(leaveStream)) {
|
||||
leaveStream = mLiveBean.getStream();
|
||||
leaveGroupId = mLiveBean.getUid();
|
||||
}
|
||||
landscape = data.getLiveInfo().getLandscape();
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
//是否热度卡加成
|
||||
liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);
|
||||
|
||||
//延时1秒发送
|
||||
liveHandler.postDelayed(sendFIm, 700);
|
||||
|
||||
//新人任務
|
||||
mLiveRoomViewHolder.configBanner3(data.getNewPeopleTask());
|
||||
//小时榜
|
||||
mLiveRoomViewHolder.initHourRank(data.getRankHour());
|
||||
//守护
|
||||
mLiveRoomViewHolder.setGuardIcon(data.getGuardUserAvatar());
|
||||
//在线列表
|
||||
mLiveRoomViewHolder.setUserList(data.getEnterRoomInfo().getUserlists());
|
||||
List<BannerBean> bannerBeans = new ArrayList<>();
|
||||
//心愿单
|
||||
if (data.getWishList().getWishList().size() > 0) {
|
||||
BannerBean bannerModel = new BannerBean();
|
||||
bannerModel.setShow_type("2");
|
||||
bannerModel.setLink(CommonAppConfig.HOST + "/index.php");
|
||||
bannerModel.setImageUrl(data.getWishList().getImg());
|
||||
bannerBeans.add(bannerModel);
|
||||
}
|
||||
//活动列表
|
||||
if (data.getLiveRoomActivityModels().size() > 0) {
|
||||
|
||||
for (LiveRoomActivityModel model : data.getLiveRoomActivityModels()) {
|
||||
BannerBean bannerModel = new BannerBean();
|
||||
bannerModel.setShow_type(model.getShowType());
|
||||
bannerModel.setStart(false);
|
||||
bannerModel.setLink(model.getLink());
|
||||
bannerModel.setImageUrl(model.getImg());
|
||||
if (TextUtils.equals(model.getIsHidden(), "0")) {
|
||||
bannerBeans.add(bannerModel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//底部轮播
|
||||
mLiveRoomViewHolder.addWishListActivity(bannerBeans);
|
||||
//直播间上部轮播【新人特惠】【趣味游戏】【幸运天使】 轮播接口
|
||||
mLiveRoomViewHolder.showLiveRoomActivityBanner();
|
||||
//兼容老接口数据
|
||||
mDanmuPrice = data.getEnterRoomInfo().getBarrageFee();
|
||||
mSocketUserType = Integer.parseInt(data.getEnterRoomInfo().getUsertype());
|
||||
mChatLevel = Integer.parseInt(data.getEnterRoomInfo().getSpeakLimit());
|
||||
mDanMuLevel = Integer.parseInt(data.getEnterRoomInfo().getBarrageLimit());
|
||||
|
||||
leave = Integer.parseInt(data.getEnterRoomInfo().getIsleave());
|
||||
if (!data.getEnterRoomInfo().getGreetings().isEmpty()) {
|
||||
greetings = data.getEnterRoomInfo().getGreetings();
|
||||
}
|
||||
if (!TextUtils.isEmpty(data.getEnterRoomInfo().getLiveBg())) {
|
||||
if (liveBg == 0) {
|
||||
|
||||
//直播间背景
|
||||
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
|
||||
mask.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
liveBg = -1;
|
||||
}
|
||||
//回传参数
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel.setmDanmuPrice(mDanmuPrice)
|
||||
.setmSocketUserType(mSocketUserType)
|
||||
.setmChatLevel(mChatLevel)
|
||||
.setmDanMuLevel(mDanMuLevel)
|
||||
.setLiveBg(liveBg)));
|
||||
//数据设置
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), Integer.parseInt(data.getEnterRoomInfo().getUserlistTime()) * 4000);
|
||||
mLiveRoomViewHolder.setFastMessage(greetings);
|
||||
mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal());
|
||||
//真爱排行 数量
|
||||
mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum());
|
||||
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
|
||||
if (isattention == 0) {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
timeIndex = 0;
|
||||
countDownTimer = null;
|
||||
setTime();
|
||||
} else {
|
||||
setTime();
|
||||
}
|
||||
} else {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
}
|
||||
mLiveAudienceViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), mLiveBean.getAvatar(), isattention);
|
||||
mLiveRoomViewHolder.setAttention(isattention);
|
||||
List<LiveUserGiftBean> list = data.getEnterRoomInfo().getUserlists();
|
||||
mLiveRoomViewHolder.setUserList(list);
|
||||
mLiveRoomViewHolder.startRefreshUserList();
|
||||
if (mLiveType == Constants.LIVE_TYPE_TIME) {//计时收费
|
||||
mLiveRoomViewHolder.startRequestTimeCharge();
|
||||
}
|
||||
}
|
||||
|
||||
if (leave == 1) {
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
//判断是否有连麦,要显示连麦窗口
|
||||
String linkMicUid = data.getEnterRoomInfo().getLinkmicUid();
|
||||
String linkMicPull = data.getEnterRoomInfo().getLinkmicPull();
|
||||
if (!TextUtils.isEmpty(linkMicUid) && !"0".equals(linkMicUid) && !TextUtils.isEmpty(linkMicPull)) {
|
||||
if (mLiveSDK != Constants.LIVE_SDK_TX && mLiveLinkMicPresenter != null) {
|
||||
mLiveLinkMicPresenter.onLinkMicPlay(linkMicUid, linkMicPull);
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否有主播连麦
|
||||
pkInfo = JSON.parseObject(GsonUtils.toJson(data.getEnterRoomInfo().getPkinfo()));
|
||||
if (pkInfo != null && pkInfo.getIntValue("drpk_status") != 1) {
|
||||
String pkUid = pkInfo.getString("pkuid");
|
||||
anyway = "1";
|
||||
if (!TextUtils.isEmpty(pkUid) && !"0".equals(pkUid) && anyway.equals("0")) {
|
||||
if (mLiveSDK != Constants.LIVE_SDK_TX) {
|
||||
String pkPull = pkInfo.getString("pkpull");
|
||||
if (!TextUtils.isEmpty(pkPull) && mLiveLinkMicAnchorPresenter != null) {
|
||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, pkPull);
|
||||
}
|
||||
} else {
|
||||
if (mLivePlayViewHolder instanceof LivePlayTxViewHolder) {
|
||||
((LivePlayTxViewHolder) mLivePlayViewHolder).setAnchorLinkMic(true, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.getEnterRoomInfo().getIsconnection() != null && data.getEnterRoomInfo().getIsconnection().equals("1")) {
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(1);
|
||||
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.pkHandler = false;
|
||||
}
|
||||
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(2);
|
||||
|
||||
//pk排名数据
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.pkHandler = true;
|
||||
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
|
||||
}
|
||||
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
|
||||
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.pkHandler = true;
|
||||
mLiveRoomViewHolder.initPkRank(null);
|
||||
}
|
||||
LivePlayRyViewHolder.setViewUP(3);
|
||||
|
||||
//pk排名数据
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
|
||||
} else {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.initPkRank(null);
|
||||
}
|
||||
}
|
||||
//多人PK
|
||||
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.initPkRank(null);
|
||||
}
|
||||
LivePlayRyViewHolder.setViewUP(4);
|
||||
|
||||
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
|
||||
}
|
||||
//守护相关
|
||||
mLiveGuardInfo = new LiveGuardInfo();
|
||||
int guardNum = Integer.parseInt(data.getEnterRoomInfo().getGuardNums());
|
||||
fansNum = Integer.parseInt(data.getEnterRoomInfo().getCountFans());
|
||||
is_fans = data.getEnterRoomInfo().getIsFans();
|
||||
mLiveGuardInfo.setGuardNum(guardNum);
|
||||
JSONObject guardObj = JSONObject.parseObject(GsonUtils.toJson(data.getEnterRoomInfo().getGuard()));
|
||||
if (guardObj != null) {
|
||||
mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type"));
|
||||
mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime"));
|
||||
}
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel.setmLiveGuardInfo(mLiveGuardInfo)
|
||||
.setFansNum(fansNum)
|
||||
.setIs_fans(is_fans)));
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setGuardNum(guardNum);
|
||||
mLiveRoomViewHolder.setFansNum(fansNum);
|
||||
//红包相关
|
||||
mLiveRoomViewHolder.setRedPackBtnVisible(Integer.parseInt(data.getEnterRoomInfo().getIsred()) == 1);
|
||||
}
|
||||
|
||||
//奖池等级
|
||||
int giftPrizePoolLevel = Integer.parseInt(data.getEnterRoomInfo().getJackpotLevel());
|
||||
if (giftPrizePoolLevel >= 0) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
|
||||
}
|
||||
}
|
||||
liveHandler.postDelayed(() -> loading.setVisibility(View.GONE), 700);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
//直播间上部轮播【新人特惠】【趣味游戏】【幸运天使】 轮播接口
|
||||
mLiveRoomViewHolder.showLiveRoomActivityBanner();
|
||||
}
|
||||
});
|
||||
if (mContext instanceof LiveActivity) {
|
||||
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeLiveEnd() {
|
||||
if (mLiveAudienceViewHolder != null) {
|
||||
|
||||
mLiveAudienceViewHolder.removeFromParent();
|
||||
mLiveAudienceViewHolder.removeCallbacks();
|
||||
mLiveAudienceViewHolder.release();
|
||||
@@ -351,6 +610,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onRemove(boolean isQuit) {
|
||||
LiveNetManager.get(mContext).cancelLive();
|
||||
liveHandler.removeCallbacks(sendFIm);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
||||
@@ -358,8 +619,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
CommonHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST);
|
||||
IMLoginManager.get(mContext).setisNewUserOne(false);
|
||||
//子线程执行退出操作
|
||||
exitLiveRoom(false);
|
||||
|
||||
exitLiveRoom(isEnterRoom);
|
||||
if (mLiveAudienceViewHolder != null) {
|
||||
mLiveAudienceViewHolder.removeCallbacks();
|
||||
}
|
||||
|
||||
//断开socket
|
||||
|
||||
@@ -446,8 +709,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
// if (mLivePlayViewHolder != null)
|
||||
// mLivePlayViewHolder.onResume();
|
||||
//判断是否有直播悬浮窗,有直接关闭
|
||||
if (EasyFloat.isShow("LiveFloatView")) {
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
@@ -474,7 +735,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
MicStatusManager.getInstance().removeOnMicListener(micStatusListener);
|
||||
mContext = null;//上下文置空防止内存泄漏
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -504,7 +766,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
DialogUitl.showSimpleDialog(mContext, null, "您已申請,退出將取消語音連麥申請!", false, new DialogUitl.SimpleCallback3() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog) {
|
||||
Micing = 0;
|
||||
MicStatusManager.getInstance().clear();
|
||||
//用户申请联麦
|
||||
final SocketSendBean msg = new SocketSendBean()
|
||||
.param("_method_", Constants.LIAN_MAI)
|
||||
@@ -597,7 +859,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
Log.e("ry", "退出多人房间成功");
|
||||
|
||||
if (isBackPressed) {
|
||||
Micing = 0;
|
||||
MicStatusManager.getInstance().clear();
|
||||
((LiveAudienceActivity) mContext).closeRoom();
|
||||
} else {
|
||||
EventBus.getDefault().post(new LiveRoomChangeEvent(bean, liveType, liveTypeVal));
|
||||
@@ -627,7 +889,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
((LiveAudienceActivity) mContext).setEnableScroll(true);
|
||||
// ((LiveAudienceActivity) mContext).setEnableScroll(true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -975,6 +1237,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}, 4000);//3秒后执行Runnable中的run方法
|
||||
|
||||
}
|
||||
if (mLivePlayViewHolder != null) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -982,6 +1247,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
if (mLiveRyLinkMicPkPresenter != null) {
|
||||
mLiveRyLinkMicPkPresenter.onLinkMicPkClose(i);
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.resetViewGone();
|
||||
}
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,6 +1277,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRyLinkMicPkPresenter.onLinkMicPkEnd(winUid);
|
||||
mLiveRoomViewHolder.setDelOtherInfo();
|
||||
}
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLivePlayViewHolder.setLiveBeanLandscape(landscape);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1104,246 +1378,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
};
|
||||
|
||||
|
||||
private void enterRoom() {
|
||||
//进入直播间IM
|
||||
|
||||
|
||||
timeIndex = 0;
|
||||
LiveHttpUtil.enterRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
isEnterRoom = true;
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
mDanmuPrice = obj.getString("barrage_fee");
|
||||
mSocketUserType = obj.getIntValue("usertype");
|
||||
mChatLevel = obj.getIntValue("speak_limit");
|
||||
mDanMuLevel = obj.getIntValue("barrage_limit");
|
||||
liveBg = obj.getIntValue("live_bg");
|
||||
leave = obj.getInteger("isleave");
|
||||
if (obj.containsKey("greetings")) {
|
||||
greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class);
|
||||
}
|
||||
if (obj.containsKey("live_bg")) {
|
||||
if (liveBg == 0) {
|
||||
|
||||
//直播间背景
|
||||
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
|
||||
mask.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
//回传参数
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel.setmDanmuPrice(mDanmuPrice)
|
||||
.setmSocketUserType(mSocketUserType)
|
||||
.setmChatLevel(mChatLevel)
|
||||
.setmDanMuLevel(mDanMuLevel)
|
||||
.setLiveBg(liveBg)));
|
||||
|
||||
|
||||
//进入直播间
|
||||
AdjustEvent adjustEvent1 = new AdjustEvent("hiepcu");
|
||||
Adjust.trackEvent(adjustEvent1);
|
||||
mFirebaseAnalytics.logEvent("FS_enterroom", null);
|
||||
logger.logEvent("FB_enterroom");
|
||||
|
||||
AdjustEvent adjustEvent2 = new AdjustEvent("unutgg");
|
||||
Adjust.trackEvent(adjustEvent2);
|
||||
CommonHttpUtil.setAdvertisingChannels("unutgg", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_first_Enterroom", null);
|
||||
AppEventsLogger.newLogger(mContext).logEvent("FB_first_Enterroom");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//观看1分钟
|
||||
if (obj.getLongValue("see_time") >= 60) {
|
||||
AdjustEvent good_user = new AdjustEvent("7zxuxz");
|
||||
Adjust.trackEvent(good_user);
|
||||
CommonHttpUtil.setAdvertisingChannels("7zxuxz", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_enter_app_1min", null);
|
||||
logger.logEvent("FB_enter_app_1min", null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (obj.getLongValue("see_time") >= 600 && obj.getIntValue("un_charge") == 1) {
|
||||
AdjustEvent good_user = new AdjustEvent("val8lv");
|
||||
Adjust.trackEvent(good_user);
|
||||
CommonHttpUtil.setAdvertisingChannels("val8lv", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_good_user", null);
|
||||
logger.logEvent("FB_good_user", null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//有效用户
|
||||
} else if (obj.getLongValue("see_time") >= 600) {
|
||||
AdjustEvent valid_user = new AdjustEvent("xuf8ep");
|
||||
Adjust.trackEvent(valid_user);
|
||||
CommonHttpUtil.setAdvertisingChannels("xuf8ep", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
mFirebaseAnalytics.logEvent("FS_Valid_user", null);
|
||||
logger.logEvent("FB_Valid_user", null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//连接socket
|
||||
LiveHttpUtil.enterBackRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
//链接上socket以后隐藏Loading加载直播间内容
|
||||
}
|
||||
});
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
LivePlayKsyViewHolder.setLandscape(obj.getIntValue("landscape"));
|
||||
|
||||
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), obj.getIntValue("userlist_time") * 4000);
|
||||
mLiveRoomViewHolder.setFastMessage(greetings);
|
||||
mLiveRoomViewHolder.setVotes(obj.getString("votestotal"));
|
||||
//真爱排行 数量
|
||||
mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum"));
|
||||
isattention = obj.getIntValue("isattention");
|
||||
if (isattention == 0) {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
timeIndex = 0;
|
||||
countDownTimer = null;
|
||||
setTime();
|
||||
} else {
|
||||
setTime();
|
||||
}
|
||||
} else {
|
||||
if (countDownTimer != null) {
|
||||
countDownTimer.cancel();
|
||||
countDownTimer = null;
|
||||
}
|
||||
}
|
||||
mLiveAudienceViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), mLiveBean.getAvatar(), isattention);
|
||||
mLiveRoomViewHolder.setAttention(isattention);
|
||||
if (obj.containsKey("lminfo")) {
|
||||
JSONObject mic_data = obj.getJSONObject("lminfo");
|
||||
if (mic_data.containsKey("userlist")) {
|
||||
mLiveRoomViewHolder.updataMicList(mic_data.getJSONArray("userlist"));
|
||||
}
|
||||
}
|
||||
List<LiveUserGiftBean> list = JSON.parseArray(obj.getString("userlists"), LiveUserGiftBean.class);
|
||||
mLiveRoomViewHolder.setUserList(list);
|
||||
// resetUserListWidth(list);
|
||||
mLiveRoomViewHolder.startRefreshUserList();
|
||||
if (mLiveType == Constants.LIVE_TYPE_TIME) {//计时收费
|
||||
mLiveRoomViewHolder.startRequestTimeCharge();
|
||||
}
|
||||
}
|
||||
if (leave == 1) {
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
//判断是否有连麦,要显示连麦窗口
|
||||
String linkMicUid = obj.getString("linkmic_uid");
|
||||
String linkMicPull = obj.getString("linkmic_pull");
|
||||
if (!TextUtils.isEmpty(linkMicUid) && !"0".equals(linkMicUid) && !TextUtils.isEmpty(linkMicPull)) {
|
||||
if (mLiveSDK != Constants.LIVE_SDK_TX && mLiveLinkMicPresenter != null) {
|
||||
mLiveLinkMicPresenter.onLinkMicPlay(linkMicUid, linkMicPull);
|
||||
}
|
||||
}
|
||||
//判断是否有主播连麦
|
||||
pkInfo = JSON.parseObject(obj.getString("pkinfo"));
|
||||
if (pkInfo != null && pkInfo.getIntValue("drpk_status") != 1) {
|
||||
String pkUid = pkInfo.getString("pkuid");
|
||||
anyway = "1";
|
||||
if (!TextUtils.isEmpty(pkUid) && !"0".equals(pkUid) && anyway.equals("0")) {
|
||||
if (mLiveSDK != Constants.LIVE_SDK_TX) {
|
||||
String pkPull = pkInfo.getString("pkpull");
|
||||
if (!TextUtils.isEmpty(pkPull) && mLiveLinkMicAnchorPresenter != null) {
|
||||
mLiveLinkMicAnchorPresenter.onLinkMicAnchorPlayUrl(pkUid, pkPull);
|
||||
}
|
||||
} else {
|
||||
if (mLivePlayViewHolder instanceof LivePlayTxViewHolder) {
|
||||
((LivePlayTxViewHolder) mLivePlayViewHolder).setAnchorLinkMic(true, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.getString("isconnection") != null && obj.getString("isconnection").equals("1")) {
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(1);
|
||||
|
||||
}
|
||||
if (pkInfo.getIntValue("ifpk") == 1 && pkInfo.getString("end_pk_time").equals("0")) {//pk开始了
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(2);
|
||||
|
||||
//pk排名数据
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname"));
|
||||
}
|
||||
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
|
||||
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(3);
|
||||
|
||||
//pk排名数据
|
||||
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
|
||||
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
|
||||
}
|
||||
//多人PK
|
||||
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
|
||||
|
||||
LivePlayRyViewHolder.setViewUP(4);
|
||||
|
||||
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
|
||||
}
|
||||
|
||||
//守护相关
|
||||
mLiveGuardInfo = new LiveGuardInfo();
|
||||
int guardNum = obj.getIntValue("guard_nums");
|
||||
fansNum = obj.getIntValue("count_fans");
|
||||
is_fans = obj.getString("is_fans") + "";
|
||||
mLiveGuardInfo.setGuardNum(guardNum);
|
||||
JSONObject guardObj = obj.getJSONObject("guard");
|
||||
if (guardObj != null) {
|
||||
mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type"));
|
||||
mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime"));
|
||||
}
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
|
||||
.setParametersModel(openParametersModel.setmLiveGuardInfo(mLiveGuardInfo)
|
||||
.setFansNum(fansNum)
|
||||
.setIs_fans(is_fans)));
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setGuardNum(guardNum);
|
||||
mLiveRoomViewHolder.setFansNum(fansNum);
|
||||
//红包相关
|
||||
mLiveRoomViewHolder.setRedPackBtnVisible(obj.getIntValue("isred") == 1);
|
||||
}
|
||||
//奖池等级
|
||||
int giftPrizePoolLevel = obj.getIntValue("jackpot_level");
|
||||
if (giftPrizePoolLevel >= 0) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//定时器
|
||||
public CountDownTimer countDownTimer = null;
|
||||
private int timeIndex = 1;
|
||||
@@ -1468,55 +1502,63 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
* 退出直播间
|
||||
*/
|
||||
public void exitLiveRoom(boolean isQuitF) {
|
||||
if (mLiveBean == null && !isEnterRoom) {
|
||||
if (!isEnterRoom) {
|
||||
return;
|
||||
}
|
||||
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Log.i("tx", "退出成功");
|
||||
//连接socket
|
||||
LiveHttpUtil.qBackRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (isQuitF) {
|
||||
onRemove(true);
|
||||
}
|
||||
if (mLiveBean != null) {
|
||||
isEnterRoom = false;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
V2TIMManager.getInstance().quitGroup("g" + mLiveBean.getUid(), new V2TIMCallback() {
|
||||
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
try {
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
//连接socket
|
||||
LiveHttpUtil.qBackRoom(mLiveBean.getUid(), mLiveBean.getStream(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
}
|
||||
});
|
||||
leaveStream = "";
|
||||
leaveGroupId = "";
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
Log.i("tx", "退出失败");
|
||||
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||
try {
|
||||
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
}
|
||||
});
|
||||
leaveStream = "";
|
||||
leaveGroupId = "";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1699,4 +1741,5 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
public void setSecondPageEnableScroll(boolean enableScroll) {
|
||||
mViewPager.setCanScroll(enableScroll);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,13 +19,10 @@ import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.views.SlideInBannerViewHolder;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SidebarViewHoler extends RecyclerView.ViewHolder {
|
||||
//侧边栏轮播
|
||||
@@ -98,24 +95,25 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder {
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(itemView.getContext(), (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||
if (liveBean1 == null) {
|
||||
if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing())
|
||||
mShowLoadingDialog.dismiss();
|
||||
return;
|
||||
}
|
||||
Map<String, String> map = null;
|
||||
if (type == 2) {
|
||||
map = new HashMap<>();
|
||||
map.put("OPEN", "NEWUSER");
|
||||
}
|
||||
LiveAudienceActivity.forward(itemView.getContext(), liveBean1, liveType, liveTypeVal, "", map, 0, liveSdk);
|
||||
if (liveBean == null) {
|
||||
if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing())
|
||||
mShowLoadingDialog.dismiss();
|
||||
((Activity) itemView.getContext()).finish();
|
||||
});
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
return;
|
||||
}
|
||||
new LiveRoomCheckLivePresenter(itemView.getContext(), 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));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckError(String contextError) {
|
||||
|
||||
}
|
||||
});
|
||||
if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing())
|
||||
mShowLoadingDialog.dismiss();
|
||||
((Activity) itemView.getContext()).finish();
|
||||
} else {
|
||||
if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing())
|
||||
mShowLoadingDialog.dismiss();
|
||||
|
||||
9
live/src/main/res/drawable/bg_live_anchor_open_mic.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="233dp" android:height="40dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ff0fdab8" />
|
||||
<corners android:topLeftRadius="20dp" android:topRightRadius="20dp" android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
25
live/src/main/res/drawable/bg_live_mic_av.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="40dp" android:height="40dp">
|
||||
<shape android:shape="oval">
|
||||
<corners
|
||||
android:radius="1dp"
|
||||
android:topLeftRadius="12dp"
|
||||
android:topRightRadius="2dp"
|
||||
android:bottomLeftRadius="2dp"
|
||||
android:bottomRightRadius="2dp"/><!-- 设置圆角半径 -->
|
||||
|
||||
<gradient
|
||||
android:startColor="#fffe9afc"
|
||||
|
||||
android:endColor="#ff8ab3ff"
|
||||
android:useLevel="true"
|
||||
android:angle="45"
|
||||
android:type="linear"
|
||||
android:centerX="0"
|
||||
android:centerY="0"
|
||||
android:gradientRadius="90"/>
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 30 KiB |
@@ -1,19 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/live_bg"
|
||||
>
|
||||
android:background="@mipmap/live_bg">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/preview_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container_wrap"
|
||||
@@ -23,21 +20,18 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
|
||||
<pl.droidsonroids.gif.GifImageView
|
||||
android:id="@+id/gift_gif"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="centerCrop"/>
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/gift_svga"
|
||||
@@ -46,11 +40,11 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="centerCrop"
|
||||
app:autoPlay="true"
|
||||
app:loopCount="1"/>
|
||||
app:loopCount="1" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/page_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.yunbao.common.views.weight.MyDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -53,6 +52,9 @@
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/loading"
|
||||
layout="@layout/layout_portrait_live_item" />
|
||||
|
||||
|
||||
</com.yunbao.common.views.weight.MyDrawerLayout>
|
||||
50
live/src/main/res/layout/anchor_open_mic_view.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/anchor_open_mic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="93dp"
|
||||
android:src="@mipmap/icon_big_mic" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="27dp"
|
||||
android:text="@string/live_anchor_open_mic"
|
||||
android:textColor="#ffb1b1b1"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/open_mic"
|
||||
android:layout_width="233dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@drawable/bg_live_anchor_open_mic"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="打開語音連麥權限"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="粉絲等級5以上的用戶可向您發起申請"
|
||||
android:textColor="#259484"
|
||||
android:textSize="8sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
94
live/src/main/res/layout/dialog_anchor_mic_list.xml
Normal file
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/bg_black"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/audience_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="當前連麥"
|
||||
android:textColor="#fff6f7fb"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/guard_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="連麥申請"
|
||||
android:textColor="#ff646464"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fans_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="邀請連麥"
|
||||
android:visibility="gone"
|
||||
android:textColor="#EB6877"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/apply_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/apply_for_lianmai"
|
||||
android:textColor="#FFFFFF"
|
||||
android:background="@drawable/background_0fdab8"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/view_no"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
layout="@layout/anchor_open_mic_view"
|
||||
android:layout_width="233dp"
|
||||
android:layout_height="233dp"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
<include
|
||||
layout="@layout/no_more_mic_view"
|
||||
android:layout_width="233dp"
|
||||
android:layout_height="233dp"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone" />
|
||||
<com.yunbao.common.custom.CommonRefreshView
|
||||
android:id="@+id/refreshView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="65dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -2,181 +2,196 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="350dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_gift_download_all"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="@drawable/bg_live_gift_download_all"
|
||||
android:gravity="center"
|
||||
android:visibility="invisible"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@mipmap/icon_small_download" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="visible"
|
||||
android:text="一鍵下載所有禮物動畫"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_luck_gift_tip"
|
||||
android:layout_width="105.27dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/bg_live_vip_blue"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/vipGoldIcon"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_vip_gold" />
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="start"
|
||||
android:layout_height="wrap_content">
|
||||
android:id="@+id/live_gift_download_all"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="@drawable/bg_live_gift_download_all"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="invisible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@mipmap/icon_small_download" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vipGoldTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="@string/live_gift_buy_gold"
|
||||
android:textSize="11.52sp" />
|
||||
<TextView
|
||||
android:id="@+id/vipGoldDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#999999"
|
||||
android:text="@string/live_gift_buy_gold_desc"
|
||||
android:textSize="7.68sp" />
|
||||
android:gravity="center"
|
||||
android:text="一鍵下載所有禮物動畫"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_luck_gift_tip"
|
||||
android:layout_width="105.27dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/bg_live_vip_blue"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/vipGoldIcon"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_vip_gold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vipGoldTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:text="@string/live_gift_buy_gold"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="11.52sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vipGoldDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/live_gift_buy_gold_desc"
|
||||
android:textColor="#999999"
|
||||
android:textSize="7.68sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_live_gift">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_tab_layout"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="50dp">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/items"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="5dp" />
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/bg_live_gift_package_line"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="23dp"/>
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/btn_gift_package"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/live_wrap"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
app:dt_left_height="23dp"
|
||||
app:dt_left_width="1.3dp" />
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/bg_live_gift_package_line" />
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/btn_gift_package"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/live_wrap"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
app:dt_left_height="23dp"
|
||||
app:dt_left_width="1.3dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_below="@id/gift_tab_layout"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="1dp"/>
|
||||
android:layout_weight="1" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vpWrapList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_gravity="end"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_weight="0"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
android:layout_height="66dp"
|
||||
android:layout_weight="0">
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="3.5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="3.5dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/btn_send_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_live_gift_send_2"
|
||||
android:enabled="false"
|
||||
android:gravity="center"
|
||||
@@ -188,7 +203,8 @@
|
||||
android:id="@+id/btn_choose"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_toLeftOf="@id/btn_send"
|
||||
android:background="@drawable/bg_live_gift_choose"
|
||||
android:gravity="center"
|
||||
@@ -202,31 +218,35 @@
|
||||
android:id="@+id/arrow"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:layout_toLeftOf="@id/btn_send"
|
||||
android:src="@mipmap/icon_live_gift_2"
|
||||
app:tint="@color/global"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="invisible"
|
||||
app:tint="@color/global" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginStart="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/goldCoin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
@@ -253,16 +273,17 @@
|
||||
app:dt_right_width="14dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/go_charge"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:background="@drawable/bg_live_gift_buy"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge"
|
||||
android:background="@drawable/bg_live_gift_buy"
|
||||
android:textColor="@color/yellow5"
|
||||
android:textSize="12sp"
|
||||
app:dt_left_height="20dp"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_live_role"
|
||||
android:background="@drawable/bg_live_tota"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="171dp">
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/live_class_tip_title"
|
||||
android:textColor="#F6F7FB"
|
||||
@@ -37,11 +37,9 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/live_class_tip"
|
||||
android:textColor="#B3F6F7FB"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView2" />
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
@@ -179,7 +180,6 @@
|
||||
android:id="@+id/id_val"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingRight="10dp"
|
||||
android:textColor="#B1B1B1"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -196,7 +196,6 @@
|
||||
android:id="@+id/fans_val"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingRight="10dp"
|
||||
android:textColor="#B1B1B1"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -213,7 +212,6 @@
|
||||
android:id="@+id/praise_val"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingRight="10dp"
|
||||
android:textColor="#B1B1B1"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -221,7 +219,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="17.5dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
@@ -229,13 +227,13 @@
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="27dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="4dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="46.5dp"
|
||||
android:layout_height="17.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="6dp">
|
||||
|
||||
@@ -252,7 +250,7 @@
|
||||
<TextView
|
||||
android:id="@+id/user_card_lv_val"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="center"
|
||||
@@ -267,30 +265,30 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_union"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/bg_user_card_guard"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/union_val"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/user_card_guard"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_card_noble"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@mipmap/emperor_rom" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -114,8 +114,8 @@
|
||||
<ImageView
|
||||
android:id="@+id/no_more"
|
||||
android:layout_width="233dp"
|
||||
android:layout_height="233dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -125,9 +125,10 @@
|
||||
android:id="@+id/no_more_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/no_more" />
|
||||
|
||||
150
live/src/main/res/layout/item_anchor_mic_info.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="69dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:gravity="center">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/gift_svga"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:autoPlay="true" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户名称"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/noble"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="15dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mic_icon"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="27dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/mic_exit"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/beauty_jingbai" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mic_exit"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/btn_icon_quit" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/mic_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:background="@drawable/bg_anchor_mic_info_btn_ok"
|
||||
android:text="同意"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.yunbao.common.custom.MyFrameLayout2
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:mfl_ratio="1"
|
||||
android:layout_height="92dp"
|
||||
android:background="@drawable/bg_live_gift_items"
|
||||
>
|
||||
app:mfl_ratio="1">
|
||||
|
||||
<com.yunbao.common.custom.MyRadioButton
|
||||
android:id="@+id/radioButton"
|
||||
@@ -14,15 +12,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_live_gift_item"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
/>
|
||||
android:checked="true" />
|
||||
|
||||
<com.yunbao.live.custom.GiftMarkView
|
||||
android:id="@+id/mark"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="1dp"
|
||||
android:layout_marginTop="1dp"/>
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginRight="1dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="45dp"
|
||||
@@ -34,20 +31,21 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
<TextView android:id="@+id/expire"
|
||||
<TextView
|
||||
android:id="@+id/expire"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:gravity="center"
|
||||
android:background="#D996cff0"
|
||||
android:visibility="gone"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textSize="8sp"/>
|
||||
android:background="#D996cff0"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="8sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -56,21 +54,22 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView android:id="@+id/pay_ico"
|
||||
<ImageView
|
||||
android:id="@+id/pay_ico"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"/>
|
||||
android:layout_height="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray3"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textSize="11sp"/>
|
||||
android:textColor="@color/gray3"
|
||||
android:textSize="11sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -78,18 +77,17 @@
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="23dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:layout_gravity="bottom"
|
||||
/>
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="right"
|
||||
android:id="@+id/tvRedpoint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/bg_red_point"
|
||||
android:gravity="center"
|
||||
@@ -98,7 +96,8 @@
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_loading_layout"
|
||||
@@ -117,4 +116,4 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</com.yunbao.common.custom.MyFrameLayout2>
|
||||
</FrameLayout>
|
||||
@@ -4,7 +4,7 @@
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_new_live_room_type_uncheck"
|
||||
android:paddingLeft="35dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -126,9 +126,9 @@
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="14dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_marginLeft="5dp" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:scaleType="fitXY" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -142,6 +142,7 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginRight="35dp" />
|
||||
|
||||
@@ -154,34 +155,35 @@
|
||||
android:layout_marginRight="35dp">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:paddingLeft="13dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="26dp"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:paddingLeft="13dp"
|
||||
android:text="主播"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
android:layout_marginEnd="25dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="center"
|
||||
android:paddingLeft="13dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="主播"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/live_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="188dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/loading_animation" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -12,6 +12,7 @@
|
||||
android:src="@mipmap/icon_big_mic"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_more_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_more_mic"
|
||||
|
||||
@@ -166,18 +166,17 @@ PK"
|
||||
android:id="@+id/et_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginLeft="45dp"
|
||||
android:background="@drawable/bg_live_item"
|
||||
android:alpha="0.5"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="45dp"
|
||||
android:layout_toLeftOf="@id/btn_pk"
|
||||
android:alpha="0.5"
|
||||
android:background="@drawable/bg_live_item"
|
||||
android:hint="@string/live_say_something"
|
||||
android:padding="5dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/textColor"
|
||||
android:textColorHint="@color/gray3"
|
||||
android:textSize="14sp"
|
||||
android:layout_toLeftOf="@id/btn_pk"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
<ImageView
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/btn_chat"
|
||||
|
||||
@@ -414,7 +414,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginRight="47dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:autoPlay="true" />
|
||||
|
||||
|
||||
@@ -1,41 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/root"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<com.tencent.rtmp.ui.TXCloudVideoView
|
||||
android:id="@+id/video_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/zslk"
|
||||
android:visibility="gone"
|
||||
android:scaleType="centerCrop"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/pk_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/live_top"
|
||||
>
|
||||
android:layout_marginTop="@dimen/live_top">
|
||||
|
||||
<com.yunbao.live.custom.MyFrameLayout4
|
||||
android:id="@+id/left_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="20dp"
|
||||
/>
|
||||
android:layout_marginBottom="20dp" />
|
||||
|
||||
<com.yunbao.live.custom.MyFrameLayout4
|
||||
android:id="@+id/right_container"
|
||||
@@ -51,34 +48,43 @@
|
||||
android:id="@+id/small_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="120dp"
|
||||
app:mfl3_ratio="0.25"
|
||||
/>
|
||||
app:mfl3_ratio="0.25" />
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="invisible"
|
||||
/>
|
||||
<FrameLayout
|
||||
android:id="@+id/ry_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
/>
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
||||
<FrameLayout android:id="@+id/ry_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<ProgressBar
|
||||
android:id="@+id/loading"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginTop="240dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="invisible" />
|
||||
<ProgressBar
|
||||
android:id="@+id/loading2"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginTop="240dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:indeterminateBehavior="repeat"
|
||||
android:indeterminateDrawable="@drawable/anim_loading"
|
||||
android:indeterminateOnly="true"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
android:paddingTop="15dp">
|
||||
|
||||
<com.yunbao.common.views.weight.NobleNoticeView
|
||||
android:id="@+id/noble"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="60dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin"
|
||||
@@ -2017,10 +2022,20 @@
|
||||
android:layout_height="50dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_live_mic_av" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/mic_ico"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
@@ -2041,10 +2056,20 @@
|
||||
android:layout_marginTop="19dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_live_mic_av" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/mic_ico1"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
@@ -2065,10 +2090,20 @@
|
||||
android:layout_marginTop="19dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_live_mic_av" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/mic_ico2"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
@@ -2089,13 +2124,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/live_video" />
|
||||
|
||||
<com.yunbao.common.views.weight.NobleNoticeView
|
||||
android:id="@+id/noble"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/live_wks_layout"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bannerLayout"
|
||||
@@ -2252,6 +2280,6 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:visibility="visible"></LinearLayout>
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -17,4 +17,5 @@
|
||||
<string name="live_room_public_des">Available for all</string>
|
||||
<string name="live_room_private_des">Only those who have the room code can watch</string>
|
||||
<string name="live_room_type_submit">Submit</string>
|
||||
<string name="live_mic_max">The number of voices has reached 3, and no more can be added.</string>
|
||||
</resources>
|
||||
@@ -27,6 +27,11 @@
|
||||
<string name="more_than" translatable="false">已超过10秒未识别到录音</string>
|
||||
<string name="live_role_title" translatable="false">身份特權</string>
|
||||
<string name="noble_seat" translatable="false">貴族坐席</string>
|
||||
<string name="live_mic_max">當前連麥語音人數已達到3人,無法再添加。</string>
|
||||
<string name="live_mic_user_apply" translatable="false">%s 申請連麥,是否查看</string>
|
||||
<string name="live_mic_user_down" translatable="false">已踢下麥</string>
|
||||
<string name="live_mic_invite" translatable="false">已發出邀請,等待用戶接受</string>
|
||||
<string name="live_mic_request" translatable="false">已同意請求,等待用戶接受</string>
|
||||
<string name="random_pk_info_title" translatable="false">PK主要規則說明:</string>
|
||||
<string name="random_pk_info_desc_1" translatable="false">1、開始匹配後,系統將會自動給您挑選對手進行PK;</string>
|
||||
<string name="random_pk_info_desc_2" translatable="false">2、每場PK總時長10分鍾,懲罰時間為1分鍾;</string>
|
||||
|
||||