Compare commits
24 Commits
6.4.8
...
dev_memory
| Author | SHA1 | Date | |
|---|---|---|---|
| b184d5255f | |||
| 4d9dbadea5 | |||
| 0294296ada | |||
| d36ece4c54 | |||
| 11cf971514 | |||
|
|
3d5ac05d36 | ||
|
|
d3268e57bc | ||
|
|
3549c25cca | ||
|
|
859f54b1e1 | ||
| af00538101 | |||
| a808cd13c0 | |||
|
|
cd0067d77b | ||
|
|
894e264fb3 | ||
| 5dd5b2e0ea | |||
|
|
8f58c485c8 | ||
|
|
11e809a978 | ||
|
|
20aa6002f8 | ||
|
|
ffcb0e8790 | ||
|
|
3de7160538 | ||
|
|
1e595ec526 | ||
| 344bbcdfc8 | |||
| 13c53644a2 | |||
| 0f9bd6aa3c | |||
| 33ee465a43 |
@@ -278,17 +278,17 @@ public class AppContext extends CommonAppContext {
|
|||||||
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "主线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//闪退后finish所有Activity并且杀死进程
|
//闪退后finish所有Activity并且杀死进程
|
||||||
for (WeakReference<Activity> activity : activities) {
|
/* for (WeakReference<Activity> activity : activities) {
|
||||||
if (activity != null && activity.get() != null) {
|
if (activity != null && activity.get() != null) {
|
||||||
activity.get().finish();
|
activity.get().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Process.killProcess(Process.myPid());
|
*//* Process.killProcess(Process.myPid());
|
||||||
System.exit(0);*/
|
System.exit(0);*//*
|
||||||
setFirebaseCrashData();
|
setFirebaseCrashData();
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}, 100);
|
}, 100);*/
|
||||||
})
|
})
|
||||||
.setUncaughtCrashHandler((t, e) -> {
|
.setUncaughtCrashHandler((t, e) -> {
|
||||||
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
Log.e("ApplicationError", "子线程异常");//此处log只是展示,当debug为true时,主类内部log会打印异常信息
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ public class NeverCrashUtils {
|
|||||||
Log.e(TAG, "未捕获的主线程异常行为", e);
|
Log.e(TAG, "未捕获的主线程异常行为", e);
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
|
Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
|
||||||
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import com.yunbao.common.http.CommonHttpUtil;
|
|||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
@@ -33,6 +35,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
|
|
||||||
public static CommonAppContext sInstance;
|
public static CommonAppContext sInstance;
|
||||||
public static WeakReference<Activity> activityWeakReference;
|
public static WeakReference<Activity> activityWeakReference;
|
||||||
|
public static List<WeakReference<Activity>> activityList=new ArrayList<>();
|
||||||
private int mCount;
|
private int mCount;
|
||||||
private boolean mFront;//是否前台
|
private boolean mFront;//是否前台
|
||||||
public static int jpushMsgNum;
|
public static int jpushMsgNum;
|
||||||
@@ -111,6 +114,7 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
jpushMsgNum = 0;
|
jpushMsgNum = 0;
|
||||||
CommonAppConfig.getInstance().setFrontGround(true);
|
CommonAppConfig.getInstance().setFrontGround(true);
|
||||||
}
|
}
|
||||||
|
activityList.add(activityWeakReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -131,6 +135,12 @@ public class CommonAppContext extends MultiDexApplication {
|
|||||||
L.e("AppContext------->处于后台");
|
L.e("AppContext------->处于后台");
|
||||||
CommonAppConfig.getInstance().setFrontGround(false);
|
CommonAppConfig.getInstance().setFrontGround(false);
|
||||||
}
|
}
|
||||||
|
for (WeakReference<Activity> reference : activityList) {
|
||||||
|
if (reference.get() == activity) {
|
||||||
|
activityList.remove(reference);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCurPosition() {
|
||||||
|
return mCurPosition;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
@@ -537,4 +537,9 @@ public interface PDLiveApi {
|
|||||||
Observable<ResponseModel<LiveStetUpStatusModel>> getLiveStetUpStatus(
|
Observable<ResponseModel<LiveStetUpStatusModel>> getLiveStetUpStatus(
|
||||||
@Query("liveuid") String liveUid
|
@Query("liveuid") String liveUid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@GET("/api/public/?service=live.jieshuDRPK")
|
||||||
|
Observable<ResponseModel<BaseModel>> jieshuDRPK(
|
||||||
|
@Query("roomid") String roomId,
|
||||||
|
@Query("uid") String uid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1063,6 +1063,18 @@ public class LiveNetManager {
|
|||||||
}).isDisposed();
|
}).isDisposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void jieshuDRPK(String uID) {
|
||||||
|
API.get().pdLiveApi(mContext)
|
||||||
|
.jieshuDRPK(uID, uID)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(baseModelResponseModel -> {
|
||||||
|
|
||||||
|
}, throwable -> {
|
||||||
|
|
||||||
|
}).isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间取消网络请求
|
* 直播间取消网络请求
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class JavascriptInterfaceUtils {
|
|||||||
private boolean dialogClose = false;
|
private boolean dialogClose = false;
|
||||||
//同名activity跳转问题
|
//同名activity跳转问题
|
||||||
private boolean LiveZhuangBana = true;
|
private boolean LiveZhuangBana = true;
|
||||||
private static JavascriptInterfaceUtils sInstance;
|
//private static JavascriptInterfaceUtils sInstance;
|
||||||
|
|
||||||
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
|
public JavascriptInterfaceUtils setPageClose(boolean pageClose) {
|
||||||
this.pageClose = pageClose;
|
this.pageClose = pageClose;
|
||||||
@@ -67,9 +67,9 @@ public class JavascriptInterfaceUtils {
|
|||||||
|
|
||||||
synchronized (JavascriptInterfaceUtils.class) {
|
synchronized (JavascriptInterfaceUtils.class) {
|
||||||
|
|
||||||
sInstance = new JavascriptInterfaceUtils();
|
// sInstance = new JavascriptInterfaceUtils();
|
||||||
|
|
||||||
return sInstance;
|
return new JavascriptInterfaceUtils();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#Thu Feb 04 00:05:45 CST 2021
|
#Thu Feb 04 00:05:45 CST 2021
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
private static final String TAG = "LiveAudienceActivity";
|
private static final String TAG = "LiveAudienceActivity";
|
||||||
public static String anyway;
|
public static String anyway;
|
||||||
public JSONObject pkInfo;
|
public JSONObject pkInfo;
|
||||||
public static LiveAudienceActivity liveAudienceActivity;
|
|
||||||
|
|
||||||
// 竖直滑动 ViewPager
|
// 竖直滑动 ViewPager
|
||||||
private VerticalViewPager verticalViewPager;
|
private VerticalViewPager verticalViewPager;
|
||||||
@@ -167,7 +166,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
super.main();
|
super.main();
|
||||||
liveAudienceActivity = this;
|
|
||||||
CrashSaveBean.getInstance().addEnterRoom();
|
CrashSaveBean.getInstance().addEnterRoom();
|
||||||
mProcessResultUtil = new ProcessResultUtil(this);
|
mProcessResultUtil = new ProcessResultUtil(this);
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
@@ -690,7 +688,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
|
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
|
||||||
if (verticalViewPager.ismEnableScroll()) {
|
|
||||||
LiveBean liveBean = e.getLiveBean();
|
LiveBean liveBean = e.getLiveBean();
|
||||||
if (e.isLiveEnd()) {
|
if (e.isLiveEnd()) {
|
||||||
manager.removeLiveEnd();
|
manager.removeLiveEnd();
|
||||||
@@ -709,9 +707,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
mAncherIcon = liveBean.getAvatar();
|
mAncherIcon = liveBean.getAvatar();
|
||||||
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
verticalViewPager.setEnableScroll(IMLoginManager.get(mContext).isSlide());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1246,19 +1242,21 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOCKET_LIVE_DRPK_SET_PK_VIEW:
|
case SOCKET_LIVE_DRPK_SET_PK_VIEW:
|
||||||
ToastUtil.show("setPkView");
|
|
||||||
if (manager.getmLivePlayViewHolder() != null) {
|
if (manager.getmLivePlayViewHolder() != null) {
|
||||||
manager.getmLivePlayViewHolder().setPkview();
|
manager.getmLivePlayViewHolder().setPkview();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOCKET_LIVE_DRPK_SET_PK_END_VIEW:
|
case SOCKET_LIVE_DRPK_SET_PK_END_VIEW:
|
||||||
ToastUtil.show("setPkEndview");
|
|
||||||
if (manager.getmLivePlayViewHolder() != null) {
|
if (manager.getmLivePlayViewHolder() != null) {
|
||||||
manager.getmLivePlayViewHolder().setPkEndview();
|
manager.getmLivePlayViewHolder().setPkEndview();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LEAVE_PK_SCORE:
|
||||||
|
if (manager != null) {
|
||||||
|
manager.upDataPkScore(event.getPkScores(), event.getTime());
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PK_TIME_COUNT:
|
case PK_TIME_COUNT:
|
||||||
if (manager != null) {
|
if (manager != null) {
|
||||||
manager.endDRGif();
|
manager.endDRGif();
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE;
|
|||||||
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
|
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
|
||||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
||||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK_RANDOM;
|
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK_RANDOM;
|
||||||
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
|
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_dr_pk_nub;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_dr_pk_nub;
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk;
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
|
||||||
@@ -24,7 +22,6 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -66,11 +63,9 @@ import com.yunbao.common.utils.BitmapUtil;
|
|||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.DateFormatUtil;
|
import com.yunbao.common.utils.DateFormatUtil;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.LogUtil;
|
import com.yunbao.common.utils.LogUtil;
|
||||||
import com.yunbao.common.utils.MicStatusManager;
|
import com.yunbao.common.utils.MicStatusManager;
|
||||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
@@ -168,6 +163,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
public static int backIndex = 0;//0=未判断,1=已判断
|
public static int backIndex = 0;//0=未判断,1=已判断
|
||||||
private FaceManager manager;
|
private FaceManager manager;
|
||||||
private ImageView leave_img;
|
private ImageView leave_img;
|
||||||
|
|
||||||
private final RandomPkManager.OnRandomPkTimer onRandomPkTimer = new RandomPkManager.OnRandomPkTimer() {
|
private final RandomPkManager.OnRandomPkTimer onRandomPkTimer = new RandomPkManager.OnRandomPkTimer() {
|
||||||
@Override
|
@Override
|
||||||
public void onTimer(String time) {
|
public void onTimer(String time) {
|
||||||
@@ -229,7 +225,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
long lossRate = statusBean.packetLostRate;
|
long lossRate = statusBean.packetLostRate;
|
||||||
//带宽
|
//带宽
|
||||||
String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth;
|
String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth;
|
||||||
Log.e("网速和内存", "获取视频:" +resolution+ " 丢包率:" + lossRate+" 带宽:"+googAvailableSendBandwidth);
|
Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -406,7 +402,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
// dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
final SocketSendBean msg1 = new SocketSendBean()
|
final SocketSendBean msg1 = new SocketSendBean()
|
||||||
.param("_method_", SOCKET_LIVE_DRPK)
|
.param("_method_", SOCKET_LIVE_DRPK)
|
||||||
.param("action", 9)
|
.param("action", 9)
|
||||||
@@ -426,18 +422,8 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Message message) {
|
public void onSuccess(Message message) {
|
||||||
isDRPK = 1;
|
isDRPK = 1;
|
||||||
|
|
||||||
btn_start_dr_pk_view.setVisibility(View.VISIBLE);
|
btn_start_dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
mLiveRyLinkMicPkPresenter.setDRInitiator(true);
|
||||||
|
|
||||||
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
|
||||||
int mScreenWdith = util.getScreenWdith();
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
|
||||||
params.weight = 1;
|
|
||||||
params.topMargin = DpUtil.dp2px(123);
|
|
||||||
dr_pk_view.setLayoutParams(params);
|
|
||||||
mPreView.setLayoutParams(params);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1577,7 +1563,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
mLiveRyLinkMicPkPresenter.leaveDRRoom();
|
mLiveRyLinkMicPkPresenter.leaveDRRoom();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case LEAVE_PK_SCORE:
|
||||||
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
|
mLiveRyLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime());
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PK_TIME_COUNT:
|
case PK_TIME_COUNT:
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.endDRGif();
|
mLiveRoomViewHolder.endDRGif();
|
||||||
@@ -1596,6 +1586,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
case UPDATA_ROBOT:
|
case UPDATA_ROBOT:
|
||||||
getAiRobotStatus();
|
getAiRobotStatus();
|
||||||
break;
|
break;
|
||||||
|
//主播强制下播
|
||||||
|
case LIVE_END:
|
||||||
|
endLive();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
private String roomId;
|
private String roomId;
|
||||||
private DialogInterface.OnShowListener listener;
|
private DialogInterface.OnShowListener listener;
|
||||||
private TextView htmlError;
|
private TextView htmlError;
|
||||||
private boolean isSetHeight =false;
|
private boolean isSetHeight = false;
|
||||||
|
|
||||||
public LiveHDDialogFragment() {
|
public LiveHDDialogFragment() {
|
||||||
|
|
||||||
@@ -100,6 +100,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||||
WindowManager.LayoutParams params = window.getAttributes();
|
WindowManager.LayoutParams params = window.getAttributes();
|
||||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
isFullWindow = false;
|
||||||
if (isFullWindow) {
|
if (isFullWindow) {
|
||||||
Display display = null;
|
Display display = null;
|
||||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
|
||||||
@@ -138,10 +139,17 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LinearLayout layout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
mWebView = (WebView) findViewById(R.id.rlWebview);
|
|
||||||
|
layout = (LinearLayout) findViewById(R.id.layout);
|
||||||
|
mWebView = new WebView(mContext);
|
||||||
|
ViewGroup.LayoutParams _params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
mWebView.setLayoutParams(_params);
|
||||||
|
layout.addView(mWebView);
|
||||||
htmlError = (TextView) findViewById(R.id.html_error);
|
htmlError = (TextView) findViewById(R.id.html_error);
|
||||||
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
|
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
|
||||||
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(getActivity(), mWebView)
|
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(getActivity(), mWebView)
|
||||||
@@ -174,7 +182,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
|
findViewById(R.id.title_laout).setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (bundle.getInt("height", -1) != -1) {
|
if (bundle.getInt("height", -1) != -1) {
|
||||||
isSetHeight =true;
|
isSetHeight = true;
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1));
|
||||||
mWebView.setLayoutParams(params);
|
mWebView.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
@@ -195,7 +203,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
if(!isSetHeight) {
|
if (!isSetHeight) {
|
||||||
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
|
view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)");
|
||||||
}
|
}
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
@@ -230,7 +238,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void gotoLive(final String live_id) {
|
private void gotoLive(final String live_id) {
|
||||||
if (!TextUtils.equals(roomId, live_id)) {
|
if (!TextUtils.equals(roomId, live_id)) {
|
||||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||||
@@ -244,7 +251,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
if (liveBean == null) {
|
if (liveBean == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(MicStatusManager.getInstance().isMic(liveUid)){
|
if (MicStatusManager.getInstance().isMic(liveUid)) {
|
||||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -306,7 +313,10 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
//结束webview的加载
|
//结束webview的加载
|
||||||
|
mWebView.loadUrl("about:blank");
|
||||||
|
layout.removeView(mWebView);
|
||||||
mWebView.destroy();
|
mWebView.destroy();
|
||||||
|
mWebView = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
|||||||
@@ -31,6 +31,46 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
private int time;
|
private int time;
|
||||||
private CustomFullServiceNotifyEvent customFullServiceNotifyEvent;
|
private CustomFullServiceNotifyEvent customFullServiceNotifyEvent;
|
||||||
private LivePKUserListBean livePKUserListBean;
|
private LivePKUserListBean livePKUserListBean;
|
||||||
|
private String votes;
|
||||||
|
private String length;
|
||||||
|
private int nums;
|
||||||
|
private String uname;
|
||||||
|
|
||||||
|
public String getVotes() {
|
||||||
|
return votes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setVotes(String votes) {
|
||||||
|
this.votes = votes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLength() {
|
||||||
|
return length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setLength(String length) {
|
||||||
|
this.length = length;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNums() {
|
||||||
|
return nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setNums(int nums) {
|
||||||
|
this.nums = nums;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUname() {
|
||||||
|
return uname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveAudienceEvent setUname(String uname) {
|
||||||
|
this.uname = uname;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public LivePKUserListBean getLivePKUserListBean() {
|
public LivePKUserListBean getLivePKUserListBean() {
|
||||||
return livePKUserListBean;
|
return livePKUserListBean;
|
||||||
@@ -258,7 +298,8 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
CHANGE_VIEW(52, "更改连胜位置"),
|
CHANGE_VIEW(52, "更改连胜位置"),
|
||||||
UPDATA_ROBOT(53, "更新机器人消息"),
|
UPDATA_ROBOT(53, "更新机器人消息"),
|
||||||
LIVE_VIDEO(54, "画质选择"),
|
LIVE_VIDEO(54, "画质选择"),
|
||||||
LUCKY_100_CHECK(55,"幸运百分百");
|
LUCKY_100_CHECK(55, "幸运百分百"),
|
||||||
|
LIVE_END(56, "主播下播");
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
|||||||
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
|
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
|
||||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
||||||
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.contexts;
|
import static com.yunbao.live.views.LivePushRyViewHolder.contexts;
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
|
import static com.yunbao.live.views.LivePushRyViewHolder.rcrtcLiveInfo;
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
||||||
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
|
import static cn.rongcloud.rtc.core.RendererCommon.ScalingType.SCALE_ASPECT_FILL;
|
||||||
@@ -29,20 +27,24 @@ import android.view.Gravity;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.tencent.trtc.TRTCCloud;
|
import com.tencent.trtc.TRTCCloud;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.bean.LiveInfoModel;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.event.AnchorInfoEvent;
|
import com.yunbao.common.event.AnchorInfoEvent;
|
||||||
import com.yunbao.common.event.FollowEvent;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.IMRTCManager;
|
import com.yunbao.common.manager.IMRTCManager;
|
||||||
import com.yunbao.common.manager.RandomPkManager;
|
import com.yunbao.common.manager.RandomPkManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
@@ -108,6 +110,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
private static final int WHAT_PK_WAIT_RECEIVE = 0;//收到pk申请等待 what
|
private static final int WHAT_PK_WAIT_RECEIVE = 0;//收到pk申请等待 what
|
||||||
private static final int WHAT_PK_WAIT_SEND = 1;//发送pk申请等待 what
|
private static final int WHAT_PK_WAIT_SEND = 1;//发送pk申请等待 what
|
||||||
private static final int WHAT_PK_TIME = 2;//pk时间变化 what
|
private static final int WHAT_PK_TIME = 2;//pk时间变化 what
|
||||||
|
private static final int WHAT_PK_TIME2 = 22;//pk时间变化 what
|
||||||
private static final int LINK_MIC_COUNT_MAX = 10;
|
private static final int LINK_MIC_COUNT_MAX = 10;
|
||||||
private static int PK_TIME_MAX = 60 * 15;//pk时间 15分钟
|
private static int PK_TIME_MAX = 60 * 15;//pk时间 15分钟
|
||||||
private static final int PK_TIME_MAX_2 = 60;//惩罚时间 1分钟
|
private static final int PK_TIME_MAX_2 = 60;//惩罚时间 1分钟
|
||||||
@@ -141,10 +144,23 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
private String mSelfStream;
|
private String mSelfStream;
|
||||||
private int mPkTimeFromServer;
|
private int mPkTimeFromServer;
|
||||||
public static TRTCCloud mTRTCCloud1;
|
public static TRTCCloud mTRTCCloud1;
|
||||||
|
private View detailsView1, detailsView2, detailsView3, detailsView4;
|
||||||
|
private LinearLayout detailsLinearLayout1, detailsLinearLayout2, detailsLinearLayout3, detailsLinearLayout4;
|
||||||
|
private LinearLayout linearGrade1, linearGrade2, linearGrade3, linearGrade4;
|
||||||
|
private TextView textPkName1, textPkName2, textPkName3, textPkName4;
|
||||||
|
private TextView textGrade1, textGrade2, textGrade3, textGrade4;
|
||||||
|
private ImageView imageGrade1, imageGrade2, imageGrade3, imageGrade4;
|
||||||
|
|
||||||
|
public LivePushRyViewHolder livePushRyViewHolder;
|
||||||
|
|
||||||
public static List<RCRTCInputStream> inputStreamList = new ArrayList<>();
|
public static List<RCRTCInputStream> inputStreamList = new ArrayList<>();
|
||||||
public static List<RCRTCInputStream> inputStreamList1 = new ArrayList<>();
|
public static List<RCRTCInputStream> inputStreamList1 = new ArrayList<>();
|
||||||
|
private boolean DRInitiator = false;//是否是duorenPK发起人
|
||||||
|
|
||||||
|
public LiveRyLinkMicPkPresenter setDRInitiator(boolean DRInitiator) {
|
||||||
|
this.DRInitiator = DRInitiator;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
private IRCRTCOtherRoomEventsListener otherRoomEventsListener = new IRCRTCOtherRoomEventsListener() {
|
private IRCRTCOtherRoomEventsListener otherRoomEventsListener = new IRCRTCOtherRoomEventsListener() {
|
||||||
|
|
||||||
@@ -224,6 +240,50 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
case WHAT_PK_TIME:
|
case WHAT_PK_TIME:
|
||||||
changePkTime();
|
changePkTime();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveRyLinkMicPkPresenter(Context context, LivePushRyViewHolder linkMicViewHolder, boolean isAnchor, View root) {
|
||||||
|
mContext = context;
|
||||||
|
mIsAnchor = isAnchor;
|
||||||
|
mRoot = root;
|
||||||
|
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||||
|
livePushRyViewHolder = linkMicViewHolder;
|
||||||
|
mPkTimeString1 = "";
|
||||||
|
mPkTimeString2 = WordUtil.getString(R.string.live_pk_time_2);
|
||||||
|
//从本地取数据
|
||||||
|
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
|
||||||
|
if (!pkTime.isEmpty()) {
|
||||||
|
try {
|
||||||
|
int time = Integer.parseInt(pkTime) * 60;
|
||||||
|
if (time > 0) {
|
||||||
|
PK_TIME_MAX = time;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d("PK_TIME_MAX", "" + PK_TIME_MAX);
|
||||||
|
mHandler = new Handler() {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
switch (msg.what) {
|
||||||
|
case WHAT_PK_WAIT_RECEIVE:
|
||||||
|
onApplyPkWait();
|
||||||
|
break;
|
||||||
|
case WHAT_PK_WAIT_SEND:
|
||||||
|
onSendPkWait();
|
||||||
|
break;
|
||||||
|
case WHAT_PK_TIME2:
|
||||||
|
pkCountdownTimer();
|
||||||
|
break;
|
||||||
|
case WHAT_PK_TIME:
|
||||||
|
changePkTime();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -313,7 +373,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
if (mLiveLinkMicPkViewHolder != null) {
|
if (mLiveLinkMicPkViewHolder != null) {
|
||||||
String s = mIsPkEnd ? mPkTimeString2 : mPkTimeString1;
|
String s = mIsPkEnd ? mPkTimeString2 : mPkTimeString1;
|
||||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||||
Log.i("tag23333",mPkTimeCount+"mPkTimeCount"+s1+"is"+is);
|
Log.i("tag23333", mPkTimeCount + "mPkTimeCount" + s1 + "is" + is);
|
||||||
if (i == 1 && s1.equals("00:01")) {
|
if (i == 1 && s1.equals("00:01")) {
|
||||||
s1 = "00:00";
|
s1 = "00:00";
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -324,13 +384,13 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
||||||
params.weight = 1;
|
params.weight = 1;
|
||||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
LivePushRyViewHolder.mPreView1.setLayoutParams(params);
|
livePushRyViewHolder.mPreView1.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i("tts", s1);
|
Log.i("tts", s1);
|
||||||
mLiveLinkMicPkViewHolder.setTime(s + " " + s1);
|
mLiveLinkMicPkViewHolder.setTime(s + " " + s1);
|
||||||
if ( s1.equals("00:01") && mIsAnchor && !s.contains("懲罰")) {
|
if (s1.equals("00:01") && mIsAnchor && !s.contains("懲罰")) {
|
||||||
HttpClient.getInstance().get("Livepk.endPK", "Livepk.endPK")
|
HttpClient.getInstance().get("Livepk.endPK", "Livepk.endPK")
|
||||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||||
.params("addtime", "00:00")
|
.params("addtime", "00:00")
|
||||||
@@ -385,7 +445,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
* pk时间倒计时
|
* pk时间倒计时
|
||||||
*/
|
*/
|
||||||
private void changePkTime() {
|
private void changePkTime() {
|
||||||
if (mPkTimeCount<0)return;
|
if (mPkTimeCount < 0) return;
|
||||||
mPkTimeCount--;
|
mPkTimeCount--;
|
||||||
Log.i("vvvs", "mPkTimeCount:" + mPkTimeCount);
|
Log.i("vvvs", "mPkTimeCount:" + mPkTimeCount);
|
||||||
if (mPkTimeCount >= 0) {//
|
if (mPkTimeCount >= 0) {//
|
||||||
@@ -490,35 +550,36 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
|
livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr1_preview.removeAllViews();
|
livePushRyViewHolder.mPreView1.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr1_preview.addView(remoteView);
|
livePushRyViewHolder.mPreView1.addView(remoteView);
|
||||||
|
|
||||||
} else if (i == 2) {
|
} else if (i == 2) {
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
// RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
// ((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
// //todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr2_preview.removeAllViews();
|
// LivePushRyViewHolder.dr2_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
// remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr2_preview.addView(remoteView);
|
// LivePushRyViewHolder.dr2_preview.addView(remoteView);
|
||||||
} else if (i == 3) {
|
} else if (i == 3) {
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
// RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
// ((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
// //todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr3_preview.removeAllViews();
|
// LivePushRyViewHolder.dr3_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
// remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr3_preview.addView(remoteView);
|
// LivePushRyViewHolder.dr3_preview.addView(remoteView);
|
||||||
} else if (i == 4) {
|
} else if (i == 4) {
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
// RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
// ((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
// //todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr4_preview.removeAllViews();
|
// LivePushRyViewHolder.dr4_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
// remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr4_preview.addView(remoteView);
|
// LivePushRyViewHolder.dr4_preview.addView(remoteView);
|
||||||
}
|
}
|
||||||
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
||||||
inputStreamList.add(stream);
|
inputStreamList.add(stream);
|
||||||
@@ -647,9 +708,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
// LivePushRyViewHolder.mPreView1.removeAllViews();
|
livePushRyViewHolder.mPreView1.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.mPreView1.addView(remoteView);
|
livePushRyViewHolder.mPreView1.addView(remoteView);
|
||||||
}
|
}
|
||||||
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
||||||
inputStreamList.add(stream);
|
inputStreamList.add(stream);
|
||||||
@@ -727,9 +788,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
||||||
params.weight = 1;
|
params.weight = 1;
|
||||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
LivePushRyViewHolder.mPreView1.setLayoutParams(params);
|
livePushRyViewHolder.mPreView1.setLayoutParams(params);
|
||||||
LivePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
|
livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
final SocketSendBean msg1 = new SocketSendBean()
|
final SocketSendBean msg1 = new SocketSendBean()
|
||||||
.param("_method_", SOCKET_LINK_MIC_PK)
|
.param("_method_", SOCKET_LINK_MIC_PK)
|
||||||
@@ -771,9 +832,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
||||||
params.weight = 1;
|
params.weight = 1;
|
||||||
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
LivePushRyViewHolder.mPreView1.setLayoutParams(params);
|
livePushRyViewHolder.mPreView1.setLayoutParams(params);
|
||||||
LivePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
|
livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
|
||||||
LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE);
|
LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE);
|
||||||
LiveRyAnchorActivity.isDRPK = 1;
|
LiveRyAnchorActivity.isDRPK = 1;
|
||||||
|
|
||||||
@@ -807,9 +868,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
// LivePushRyViewHolder.mPreView1.removeAllViews();
|
livePushRyViewHolder.mPreView1.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.mPreView1.addView(remoteView);
|
livePushRyViewHolder.mPreView1.addView(remoteView);
|
||||||
}
|
}
|
||||||
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
//如果要订阅所有远端用户的流。保存所有流信息,方便后面统一订阅
|
||||||
inputStreamList.add(stream);
|
inputStreamList.add(stream);
|
||||||
@@ -1070,7 +1131,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
/**
|
/**
|
||||||
* 退出多人PK
|
* 退出多人PK
|
||||||
*/
|
*/
|
||||||
public static void leaveDRRoom() {
|
public void leaveDRRoom() {
|
||||||
//清理PK上面对方的头像
|
//清理PK上面对方的头像
|
||||||
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
|
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
|
||||||
|
|
||||||
@@ -1143,25 +1204,31 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
leaveHandler.post(leaveRunnable);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Handler leaveHandler = new Handler(Looper.getMainLooper());
|
||||||
|
private Runnable leaveRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//恢复全屏画面
|
//恢复全屏画面
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = 0;
|
params.topMargin = 0;
|
||||||
mPreView.setLayoutParams(params);
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
livePushRyViewHolder.dr_pk_view.setVisibility(View.GONE);
|
||||||
inputStreamList.clear();
|
inputStreamList.clear();
|
||||||
inputStreamList1.clear();
|
inputStreamList1.clear();
|
||||||
//删除之前其他主播的画面
|
//删除之前其他主播的画面
|
||||||
LivePushRyViewHolder.dr1_preview.removeAllViews();
|
livePushRyViewHolder.dr1_preview.removeAllViews();
|
||||||
LivePushRyViewHolder.dr2_preview.removeAllViews();
|
livePushRyViewHolder.dr3_preview.removeAllViews();
|
||||||
LivePushRyViewHolder.dr3_preview.removeAllViews();
|
livePushRyViewHolder.cameraPreview3.removeAllViews();
|
||||||
LivePushRyViewHolder.dr4_preview.removeAllViews();
|
leaveHandler.removeCallbacks(leaveRunnable);
|
||||||
}
|
livePushRyViewHolder.timeTitle.setVisibility(View.GONE);
|
||||||
});
|
livePushRyViewHolder.mPreView.removeView(detailsView1);
|
||||||
|
livePushRyViewHolder.cameraPreview3.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 随机PK拒绝对话框
|
* 随机PK拒绝对话框
|
||||||
@@ -1556,15 +1623,28 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
//把多人PK的View显示出来
|
//把多人PK的View显示出来
|
||||||
if (dr_pk_view.getVisibility() == View.GONE) {
|
if (livePushRyViewHolder.dr_pk_view.getVisibility() == View.GONE) {
|
||||||
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
||||||
int mScreenWdith = util.getScreenWdith();
|
int mScreenWdith = util.getScreenWdith();
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
||||||
params.weight = 1;
|
params.weight = 1;
|
||||||
params.topMargin = DpUtil.dp2px(123);
|
params.topMargin = DpUtil.dp2px(123);
|
||||||
dr_pk_view.setLayoutParams(params);
|
livePushRyViewHolder.dr_pk_view.setLayoutParams(params);
|
||||||
mPreView.setLayoutParams(params);
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
livePushRyViewHolder.dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
|
livePushRyViewHolder.dr1_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr2_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr3_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr4_preview.setVisibility(View.GONE);
|
||||||
|
detailsView1 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout1 = detailsView1.findViewById(R.id.lin_pk1);
|
||||||
|
linearGrade1 = detailsView1.findViewById(R.id.linear_grade1);
|
||||||
|
imageGrade1 = detailsView1.findViewById(R.id.image_grade1);
|
||||||
|
textGrade1 = detailsView1.findViewById(R.id.text_grade1);
|
||||||
|
imageGrade1.setTag(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
||||||
|
livePushRyViewHolder.mPreView.addView(detailsView1);
|
||||||
|
detailsLinearLayout1.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade1.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.e("ry", "多人接受成功" + mApplyUid);
|
Log.e("ry", "多人接受成功" + mApplyUid);
|
||||||
@@ -1577,37 +1657,99 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
Log.e("ry", i + "收到" + stream.getMediaType() + "实打实打算" + rcrtcOtherRoom.getRemoteUsers().get(i).getUserId());
|
Log.e("ry", i + "收到" + stream.getMediaType() + "实打实打算" + rcrtcOtherRoom.getRemoteUsers().get(i).getUserId());
|
||||||
if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
|
if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
|
||||||
if (inputStreamList.size() == 0) {
|
if (inputStreamList.size() == 0) {
|
||||||
|
livePushRyViewHolder.dr1_preview.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr1_preview.removeAllViews();
|
livePushRyViewHolder.dr1_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr1_preview.addView(remoteView);
|
livePushRyViewHolder.dr1_preview.addView(remoteView);
|
||||||
|
|
||||||
|
|
||||||
|
LiveNetManager.get(mContext).getLiveInfo(uid, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveInfoModel data) {
|
||||||
|
detailsView2 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout2 = detailsView2.findViewById(R.id.lin_pk2);
|
||||||
|
linearGrade2 = detailsView2.findViewById(R.id.linear_grade2);
|
||||||
|
textPkName2 = detailsView2.findViewById(R.id.text_pk_name2);
|
||||||
|
imageGrade2 = detailsView2.findViewById(R.id.image_grade2);
|
||||||
|
textGrade2 = detailsView2.findViewById(R.id.text_grade2);
|
||||||
|
imageGrade2.setTag(String.valueOf(uid));
|
||||||
|
textPkName2.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.dr1_preview.addView(detailsView2);
|
||||||
|
detailsLinearLayout2.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} else if (inputStreamList.size() == 1) {
|
} else if (inputStreamList.size() == 1) {
|
||||||
|
livePushRyViewHolder.dr3_preview.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr2_preview.removeAllViews();
|
livePushRyViewHolder.dr3_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr2_preview.addView(remoteView);
|
livePushRyViewHolder.dr3_preview.addView(remoteView);
|
||||||
|
LiveNetManager.get(mContext).getLiveInfo(uid, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveInfoModel data) {
|
||||||
|
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
||||||
|
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
||||||
|
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
||||||
|
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
||||||
|
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
||||||
|
imageGrade4.setTag(uid);
|
||||||
|
textPkName4.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.dr3_preview.addView(detailsView4);
|
||||||
|
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade4.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (inputStreamList.size() == 2) {
|
} else if (inputStreamList.size() == 2) {
|
||||||
|
livePushRyViewHolder.cameraPreview3.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(mContext);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr3_preview.removeAllViews();
|
livePushRyViewHolder.cameraPreview3.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr3_preview.addView(remoteView);
|
livePushRyViewHolder.cameraPreview3.addView(remoteView);
|
||||||
} else if (inputStreamList.size() == 3) {
|
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
LiveNetManager.get(mContext).getLiveInfo(uid, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
@Override
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
public void onSuccess(LiveInfoModel data) {
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
detailsView3 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
LivePushRyViewHolder.dr4_preview.removeAllViews();
|
detailsLinearLayout3 = detailsView3.findViewById(R.id.lin_pk3);
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
linearGrade3 = detailsView3.findViewById(R.id.linear_grade3);
|
||||||
LivePushRyViewHolder.dr4_preview.addView(remoteView);
|
textPkName3 = detailsView3.findViewById(R.id.text_pk_name3);
|
||||||
|
imageGrade3 = detailsView3.findViewById(R.id.image_grade3);
|
||||||
|
textGrade3 = detailsView3.findViewById(R.id.text_grade3);
|
||||||
|
imageGrade3.setTag(uid);
|
||||||
|
textPkName3.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.cameraPreview3.addView(detailsView3);
|
||||||
|
detailsLinearLayout3.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade3.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
inputStreamList.add(stream);
|
inputStreamList.add(stream);
|
||||||
}
|
}
|
||||||
@@ -1673,6 +1815,31 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
|
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
if (livePushRyViewHolder.dr_pk_view.getVisibility() == View.GONE) {
|
||||||
|
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
||||||
|
int mScreenWdith = util.getScreenWdith();
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
||||||
|
params.weight = 1;
|
||||||
|
params.topMargin = DpUtil.dp2px(123);
|
||||||
|
livePushRyViewHolder.dr_pk_view.setLayoutParams(params);
|
||||||
|
livePushRyViewHolder.camera.setLayoutParams(params);
|
||||||
|
livePushRyViewHolder.dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
|
livePushRyViewHolder.dr1_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr2_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr3_preview.setVisibility(View.GONE);
|
||||||
|
livePushRyViewHolder.dr4_preview.setVisibility(View.GONE);
|
||||||
|
detailsView1 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout1 = detailsView1.findViewById(R.id.lin_pk1);
|
||||||
|
linearGrade1 = detailsView1.findViewById(R.id.linear_grade1);
|
||||||
|
imageGrade1 = detailsView1.findViewById(R.id.image_grade1);
|
||||||
|
textGrade1 = detailsView1.findViewById(R.id.text_grade1);
|
||||||
|
imageGrade1.setTag(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
||||||
|
livePushRyViewHolder.mPreView.addView(detailsView1);
|
||||||
|
detailsLinearLayout1.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade1.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
//遍历远端用户列表
|
//遍历远端用户列表
|
||||||
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
|
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
|
||||||
//遍历远端用户发布的资源列表
|
//遍历远端用户发布的资源列表
|
||||||
@@ -1680,37 +1847,96 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
Log.e("ry111", stream.getMediaType() + "");
|
Log.e("ry111", stream.getMediaType() + "");
|
||||||
if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
|
if (stream.getMediaType() == RCRTCMediaType.VIDEO) {
|
||||||
if (inputStreamList.size() == 0) {
|
if (inputStreamList.size() == 0) {
|
||||||
|
livePushRyViewHolder.dr1_preview.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr1_preview.removeAllViews();
|
livePushRyViewHolder.dr1_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr1_preview.addView(remoteView);
|
livePushRyViewHolder.dr1_preview.addView(remoteView);
|
||||||
|
LiveNetManager.get(mContext).getLiveInfo(u, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveInfoModel data) {
|
||||||
|
detailsView2 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout2 = detailsView2.findViewById(R.id.lin_pk2);
|
||||||
|
linearGrade2 = detailsView2.findViewById(R.id.linear_grade2);
|
||||||
|
textPkName2 = detailsView2.findViewById(R.id.text_pk_name2);
|
||||||
|
imageGrade2 = detailsView2.findViewById(R.id.image_grade2);
|
||||||
|
textGrade2 = detailsView2.findViewById(R.id.text_grade2);
|
||||||
|
imageGrade2.setTag(String.valueOf(u));
|
||||||
|
textPkName2.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.dr1_preview.addView(detailsView2);
|
||||||
|
detailsLinearLayout2.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (inputStreamList.size() == 1) {
|
} else if (inputStreamList.size() == 1) {
|
||||||
|
livePushRyViewHolder.dr3_preview.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr2_preview.removeAllViews();
|
livePushRyViewHolder.dr3_preview.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr2_preview.addView(remoteView);
|
livePushRyViewHolder.dr3_preview.addView(remoteView);
|
||||||
|
LiveNetManager.get(mContext).getLiveInfo(u, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(LiveInfoModel data) {
|
||||||
|
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
||||||
|
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
||||||
|
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
||||||
|
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
||||||
|
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
||||||
|
imageGrade4.setTag(u);
|
||||||
|
textPkName4.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.dr3_preview.addView(detailsView4);
|
||||||
|
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade4.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (inputStreamList.size() == 2) {
|
} else if (inputStreamList.size() == 2) {
|
||||||
|
livePushRyViewHolder.cameraPreview3.setVisibility(View.VISIBLE);
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
LivePushRyViewHolder.dr3_preview.removeAllViews();
|
livePushRyViewHolder.cameraPreview3.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
||||||
LivePushRyViewHolder.dr3_preview.addView(remoteView);
|
livePushRyViewHolder.cameraPreview3.addView(remoteView);
|
||||||
} else if (inputStreamList.size() == 3) {
|
|
||||||
//如果远端用户发布的是视频流,创建显示视图RCRTCVideoView,并添加到布局中显示
|
LiveNetManager.get(mContext).getLiveInfo(u, new com.yunbao.common.http.base.HttpCallback<LiveInfoModel>() {
|
||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
@Override
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
public void onSuccess(LiveInfoModel data) {
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
detailsView3 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
LivePushRyViewHolder.dr4_preview.removeAllViews();
|
detailsLinearLayout3 = detailsView3.findViewById(R.id.lin_pk3);
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
linearGrade3 = detailsView3.findViewById(R.id.linear_grade3);
|
||||||
LivePushRyViewHolder.dr4_preview.addView(remoteView);
|
textPkName3 = detailsView3.findViewById(R.id.text_pk_name3);
|
||||||
|
imageGrade3 = detailsView3.findViewById(R.id.image_grade3);
|
||||||
|
textGrade3 = detailsView3.findViewById(R.id.text_grade3);
|
||||||
|
imageGrade3.setTag(u);
|
||||||
|
textPkName3.setText(data.getUserNicename());
|
||||||
|
livePushRyViewHolder.cameraPreview3.addView(detailsView3);
|
||||||
|
detailsLinearLayout3.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade3.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
inputStreamList.add(stream);
|
inputStreamList.add(stream);
|
||||||
|
|
||||||
@@ -1770,7 +1996,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
* @param streams 必须为视频流列表
|
* @param streams 必须为视频流列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static RCRTCMixConfig create_Custom_MixConfig(boolean isCrop, List<RCRTCInputStream> streams) {
|
private RCRTCMixConfig create_Custom_MixConfig(boolean isCrop, List<RCRTCInputStream> streams) {
|
||||||
|
Log.e("视频合流", streams.toString());
|
||||||
|
Log.e("视频合流", "视频长度:" + streams.size());
|
||||||
RCRTCMixConfig config = new RCRTCMixConfig();
|
RCRTCMixConfig config = new RCRTCMixConfig();
|
||||||
//1. 设置自定义合流布局模式
|
//1. 设置自定义合流布局模式
|
||||||
config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.CUSTOM);
|
config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.CUSTOM);
|
||||||
@@ -1798,7 +2026,27 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
//(请参照画布和声音配置示例代码)
|
//(请参照画布和声音配置示例代码)
|
||||||
//3. 假设以画布设置的宽高为 300 * 300为例(应以真实设置的宽高为准),设置每个视频流小窗口的坐标及宽高
|
//3. 假设以画布设置的宽高为 300 * 300为例(应以真实设置的宽高为准),设置每个视频流小窗口的坐标及宽高
|
||||||
ArrayList<RCRTCMixConfig.CustomLayoutList.CustomLayout> list = new ArrayList<>();
|
ArrayList<RCRTCMixConfig.CustomLayoutList.CustomLayout> list = new ArrayList<>();
|
||||||
config.setCustomLayouts(list);
|
|
||||||
|
if (streams.size() == 1) {
|
||||||
|
//user1的视频流
|
||||||
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout1 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
|
videoLayout1.setVideoStream(RCRTCEngine.getInstance().getDefaultVideoStream()); // RCRTCStream#MediaType 必须是Video
|
||||||
|
videoLayout1.setX(0); //X 坐标
|
||||||
|
videoLayout1.setY(0); //Y 坐标
|
||||||
|
videoLayout1.setWidth(480); // 视频窗口的宽
|
||||||
|
videoLayout1.setHeight(720); // 视频窗口的高
|
||||||
|
list.add(videoLayout1);
|
||||||
|
|
||||||
|
//user2的视频流
|
||||||
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout2 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
|
videoLayout2.setVideoStream(streams.get(0)); // RCRTCStream#MediaType 必须是Video
|
||||||
|
videoLayout2.setX(480); //X 坐标
|
||||||
|
videoLayout2.setY(0); //Y 坐标
|
||||||
|
videoLayout2.setWidth(480); // 视频窗口的宽
|
||||||
|
videoLayout2.setHeight(720); // 视频窗口的高
|
||||||
|
list.add(videoLayout2);
|
||||||
|
|
||||||
|
} else if (streams.size() == 2) {
|
||||||
//user1的视频流
|
//user1的视频流
|
||||||
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout1 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout1 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
list.add(videoLayout1);
|
list.add(videoLayout1);
|
||||||
@@ -1808,52 +2056,62 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
videoLayout1.setWidth(480); // 视频窗口的宽
|
videoLayout1.setWidth(480); // 视频窗口的宽
|
||||||
videoLayout1.setHeight(720); // 视频窗口的高
|
videoLayout1.setHeight(720); // 视频窗口的高
|
||||||
|
|
||||||
for (int i = 0; i < streams.size(); i++) {
|
|
||||||
Log.e("tttts,", "a" + i + "cccc" + streams.size());
|
|
||||||
Log.e("tttts", streams.get(i).getUserId() + "");
|
|
||||||
if (i == 0) {
|
|
||||||
//user2的视频流
|
//user2的视频流
|
||||||
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout2 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout2 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
list.add(videoLayout2);
|
videoLayout2.setVideoStream(streams.get(0)); // RCRTCStream#MediaType 必须是Video
|
||||||
videoLayout2.setVideoStream(streams.get(i)); // RCRTCStream#MediaType 必须是Video
|
|
||||||
videoLayout2.setX(480); //X 坐标
|
videoLayout2.setX(480); //X 坐标
|
||||||
videoLayout2.setY(0); //Y 坐标
|
videoLayout2.setY(0); //Y 坐标
|
||||||
videoLayout2.setWidth(240); // 视频窗口的宽
|
videoLayout2.setWidth(480); // 视频窗口的宽
|
||||||
videoLayout2.setHeight(360); // 视频窗口的高
|
videoLayout2.setHeight(360); // 视频窗口的高
|
||||||
Log.e("ttt1112", "0" + "VS" + streams.get(i).getUserId());
|
list.add(videoLayout2);
|
||||||
} else if (i == 1) {
|
|
||||||
//user3的视频流
|
//user3的视频流
|
||||||
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout3 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout3 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
list.add(videoLayout3);
|
videoLayout3.setVideoStream(streams.get(1)); // RCRTCStream#MediaType 必须是Video
|
||||||
videoLayout3.setVideoStream(streams.get(i)); // RCRTCStream#MediaType 必须是Video
|
videoLayout3.setX(480); //X 坐标
|
||||||
videoLayout3.setX(720); //X 坐标
|
videoLayout3.setY(360); //Y 坐标
|
||||||
videoLayout3.setY(0); //Y 坐标
|
videoLayout3.setWidth(480); // 视频窗口的宽
|
||||||
videoLayout3.setWidth(240); // 视频窗口的宽
|
|
||||||
videoLayout3.setHeight(360); // 视频窗口的高
|
videoLayout3.setHeight(360); // 视频窗口的高
|
||||||
Log.e("ttt1112", "1" + "VS" + streams.get(i).getUserId());
|
list.add(videoLayout3);
|
||||||
|
|
||||||
|
} else if (streams.size() == 3) {
|
||||||
|
//user1的视频流
|
||||||
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout1 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
|
videoLayout1.setVideoStream(RCRTCEngine.getInstance().getDefaultVideoStream()); // RCRTCStream#MediaType 必须是Video
|
||||||
|
videoLayout1.setX(0); //X 坐标
|
||||||
|
videoLayout1.setY(0); //Y 坐标
|
||||||
|
videoLayout1.setWidth(480); // 视频窗口的宽
|
||||||
|
videoLayout1.setHeight(720); // 视频窗口的高
|
||||||
|
list.add(videoLayout1);
|
||||||
|
|
||||||
|
//user2的视频流
|
||||||
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout2 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
|
videoLayout2.setVideoStream(streams.get(0)); // RCRTCStream#MediaType 必须是Video
|
||||||
|
videoLayout2.setX(480); //X 坐标
|
||||||
|
videoLayout2.setY(0); //Y 坐标
|
||||||
|
videoLayout2.setWidth(480); // 视频窗口的宽
|
||||||
|
videoLayout2.setHeight(360); // 视频窗口的高
|
||||||
|
list.add(videoLayout2);
|
||||||
|
|
||||||
|
//user3的视频流
|
||||||
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout3 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
|
videoLayout3.setVideoStream(streams.get(1)); // RCRTCStream#MediaType 必须是Video
|
||||||
|
videoLayout3.setX(480); //X 坐标
|
||||||
|
videoLayout3.setY(360); //Y 坐标
|
||||||
|
videoLayout3.setWidth(480); // 视频窗口的宽
|
||||||
|
videoLayout3.setHeight(360); // 视频窗口的高
|
||||||
|
list.add(videoLayout3);
|
||||||
|
|
||||||
} else if (i == 2) {
|
|
||||||
//user3的视频流
|
//user3的视频流
|
||||||
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout4 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout4 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
||||||
list.add(videoLayout4);
|
videoLayout4.setVideoStream(streams.get(2)); // RCRTCStream#MediaType 必须是Video
|
||||||
videoLayout4.setVideoStream(streams.get(i)); // RCRTCStream#MediaType 必须是Video
|
videoLayout4.setX(0); //X 坐标
|
||||||
videoLayout4.setX(480); //X 坐标
|
|
||||||
videoLayout4.setY(360); //Y 坐标
|
videoLayout4.setY(360); //Y 坐标
|
||||||
videoLayout4.setWidth(240); // 视频窗口的宽
|
videoLayout4.setWidth(480); // 视频窗口的宽
|
||||||
videoLayout4.setHeight(360); // 视频窗口的高
|
videoLayout4.setHeight(360); // 视频窗口的高
|
||||||
Log.e("ttt1112", "2" + "VS" + streams.get(i).getUserId());
|
|
||||||
} else if (i == 3) {
|
|
||||||
//user3的视频流
|
|
||||||
RCRTCMixConfig.CustomLayoutList.CustomLayout videoLayout4 = new RCRTCMixConfig.CustomLayoutList.CustomLayout();
|
|
||||||
list.add(videoLayout4);
|
list.add(videoLayout4);
|
||||||
videoLayout4.setVideoStream(streams.get(i)); // RCRTCStream#MediaType 必须是Video
|
|
||||||
videoLayout4.setX(720); //X 坐标
|
|
||||||
videoLayout4.setY(360); //Y 坐标
|
|
||||||
videoLayout4.setWidth(240); // 视频窗口的宽
|
|
||||||
videoLayout4.setHeight(360); // 视频窗口的高
|
|
||||||
Log.e("ttt1112", "3" + "VS" + streams.get(i).getUserId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
config.setCustomLayouts(list);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1886,7 +2144,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
if (mPkPopWindow != null) {
|
if (mPkPopWindow != null) {
|
||||||
mPkPopWindow.dismiss();
|
mPkPopWindow.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1978,13 +2235,15 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
|
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
|
||||||
mLiveLinkMicPkViewHolder.addToParent();
|
mLiveLinkMicPkViewHolder.addToParent();
|
||||||
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
|
mLiveLinkMicPkViewHolder.setIsAnchor(mIsAnchor);
|
||||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
if (mContext instanceof LiveAudienceActivity) {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
((LiveAudienceActivity) mContext).getmLivePlayViewHolder().setPkview();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
mLiveLinkMicPkViewHolder.startAnim();
|
mLiveLinkMicPkViewHolder.startAnim();
|
||||||
|
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid));
|
||||||
mLiveLinkMicPkViewHolder.showTime();
|
mLiveLinkMicPkViewHolder.showTime();
|
||||||
|
nextPkTimeCountDown(2);
|
||||||
if (mIsAnchor) {
|
if (mIsAnchor) {
|
||||||
((LiveRyAnchorActivity) mContext).setPkBtnVisible(false);
|
((LiveRyAnchorActivity) mContext).setPkBtnVisible(false);
|
||||||
mPkTimeCount = PK_TIME_MAX;
|
mPkTimeCount = PK_TIME_MAX;
|
||||||
@@ -1993,7 +2252,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
// mPkTimeCount=mPkTimeFromServer;
|
// mPkTimeCount=mPkTimeFromServer;
|
||||||
mPkTimeCount = PK_TIME_MAX;
|
mPkTimeCount = PK_TIME_MAX;
|
||||||
}
|
}
|
||||||
nextPkTimeCountDown(4);
|
|
||||||
Log.d("mPkTimeCount2", "" + mPkTimeCount + ";mPkTimeFromServer=" + mPkTimeFromServer);
|
Log.d("mPkTimeCount2", "" + mPkTimeCount + ";mPkTimeFromServer=" + mPkTimeFromServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2164,6 +2422,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
if (mHandler != null) {
|
if (mHandler != null) {
|
||||||
mHandler.removeCallbacksAndMessages(null);
|
mHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
|
mHandler = null;
|
||||||
mSocketRyClient = null;
|
mSocketRyClient = null;
|
||||||
if (mLiveLinkMicPkViewHolder != null) {
|
if (mLiveLinkMicPkViewHolder != null) {
|
||||||
mLiveLinkMicPkViewHolder.release();
|
mLiveLinkMicPkViewHolder.release();
|
||||||
@@ -2199,4 +2458,227 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
public void setSelfStream(String selfStream) {
|
public void setSelfStream(String selfStream) {
|
||||||
mSelfStream = selfStream;
|
mSelfStream = selfStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新Pk分数
|
||||||
|
*/
|
||||||
|
public void upDataPkScore(JSONArray pkScores, String uid, int time) {
|
||||||
|
String userID1 = (String) imageGrade1.getTag();
|
||||||
|
String userID2 = (String) imageGrade2.getTag();
|
||||||
|
String userID4 = (String) imageGrade4.getTag();
|
||||||
|
if (livePushRyViewHolder.timeTitle.getVisibility() == View.GONE) {
|
||||||
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) livePushRyViewHolder.timeTitle.getLayoutParams();
|
||||||
|
layoutParams.topMargin = DpUtil.dp2px(123);
|
||||||
|
livePushRyViewHolder.timeTitle.setLayoutParams(layoutParams);
|
||||||
|
livePushRyViewHolder.timeTitle.setVisibility(View.VISIBLE);
|
||||||
|
String pkTime = StringUtil.getDurationText(time * 1000);
|
||||||
|
livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), pkTime));
|
||||||
|
mPkTimeCount = time;
|
||||||
|
pkCountdownTimer();
|
||||||
|
}
|
||||||
|
int pkScoreSize = pkScores.size();
|
||||||
|
if (pkScoreSize == 3) {
|
||||||
|
linearGrade1.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade2.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade4.setVisibility(View.VISIBLE);
|
||||||
|
//拿到原始数据
|
||||||
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
|
String userID = score.getString("id");
|
||||||
|
long userScore = score.getLong("score");
|
||||||
|
if (TextUtils.equals(userID, userID1)) {
|
||||||
|
textGrade1.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade1);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (TextUtils.equals(userID, userID2)) {
|
||||||
|
textGrade2.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade2);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (TextUtils.equals(userID, userID4)) {
|
||||||
|
textGrade4.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade4);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String userID3 = (String) imageGrade3.getTag();
|
||||||
|
linearGrade1.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade2.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade3.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade4.setVisibility(View.VISIBLE);
|
||||||
|
//拿到原始数据
|
||||||
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
|
String userID = score.getString("id");
|
||||||
|
long userScore = score.getLong("score");
|
||||||
|
if (TextUtils.equals(userID, userID1)) {
|
||||||
|
textGrade1.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade1);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade1);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (TextUtils.equals(userID, userID2)) {
|
||||||
|
textGrade2.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade2);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade2);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (TextUtils.equals(userID, userID4)) {
|
||||||
|
textGrade4.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade4);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade4);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (TextUtils.equals(userID, userID3)) {
|
||||||
|
textGrade3.setText(String.valueOf(userScore));
|
||||||
|
if (!score.containsKey("paiming")) {
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade3);
|
||||||
|
} else {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no1, imageGrade3);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no2, imageGrade3);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no3, imageGrade3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
ImgLoader.display(mContext, R.mipmap.icon_livepk_no4, imageGrade3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PK倒计时
|
||||||
|
*/
|
||||||
|
private void pkCountdownTimer() {
|
||||||
|
|
||||||
|
mPkTimeCount--;
|
||||||
|
if (mPkTimeCount > 0) {//
|
||||||
|
if (mHandler != null) {
|
||||||
|
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||||
|
livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||||
|
mHandler.sendEmptyMessageAtTime(WHAT_PK_TIME2, getNextSecondTime());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
livePushRyViewHolder.timeTitle.setVisibility(View.GONE);
|
||||||
|
if (mHandler != null) {
|
||||||
|
mHandler.removeCallbacksAndMessages(null);
|
||||||
|
}
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
||||||
|
// endDRGif();
|
||||||
|
if (DRInitiator) {
|
||||||
|
LiveNetManager.get(mContext).jieshuDRPK("" + IMLoginManager.get(mContext).getUserInfo().getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package com.yunbao.live.socket;
|
|||||||
import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
|
import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
|
||||||
import static com.blankj.utilcode.util.ViewUtils.runOnUiThread;
|
import static com.blankj.utilcode.util.ViewUtils.runOnUiThread;
|
||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
||||||
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
|
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
|
||||||
|
|
||||||
@@ -154,7 +152,6 @@ public class SocketRyClient {
|
|||||||
public void processBroadcast(String socketMsg) {
|
public void processBroadcast(String socketMsg) {
|
||||||
L.e("收到socket--->" + socketMsg);
|
L.e("收到socket--->" + socketMsg);
|
||||||
|
|
||||||
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
|
||||||
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
||||||
|
|
||||||
if (Constants.SOCKET_STOP_PLAY.equals(socketMsg)) {
|
if (Constants.SOCKET_STOP_PLAY.equals(socketMsg)) {
|
||||||
@@ -282,42 +279,58 @@ public class SocketRyClient {
|
|||||||
}
|
}
|
||||||
//收到对方同意多人PK邀请
|
//收到对方同意多人PK邀请
|
||||||
else if (action3 == 2) {
|
else if (action3 == 2) {
|
||||||
UserBean u = new UserBean();
|
// UserBean u = new UserBean();
|
||||||
// u.setUserNiceName(map.getString("uname"));
|
//// u.setUserNiceName(map.getString("uname"));
|
||||||
u.setId(map.getString("uid"));
|
// u.setId(map.getString("uid"));
|
||||||
mListener.onLinkDRMicPkApplyOk(u);
|
// mListener.onLinkDRMicPkApplyOk(u);
|
||||||
} else if (action3 == 6) {
|
} else if (action3 == 6) {//开始Pk
|
||||||
if (LiveRoomViewHolder.mHandler != null) {
|
if (LiveRoomViewHolder.mHandler != null) {
|
||||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||||
|
.setPkScores(map.getJSONArray("userlist"))
|
||||||
|
.setUid(mLiveUid)
|
||||||
|
.setTime(map.getIntValue("drpk_time")));
|
||||||
if (livePushRyViewHolder == null) {
|
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) {
|
} else if (action3 == 5) {
|
||||||
// EventBus.getDefault().post(new LiveAudienceEvent()
|
// endDRGif();
|
||||||
// .setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
|
||||||
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
|
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
|
||||||
if (LiveRyAnchorActivity.mLiveAnchorViewHolder != null) {
|
if (LiveRyAnchorActivity.mLiveAnchorViewHolder != null) {
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = 0;
|
params.topMargin = 0;
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
leaveDRRoom();
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||||
isDRPK = 0;
|
isDRPK = 0;
|
||||||
} else {
|
} 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) {
|
} else if (action3 == 3) {
|
||||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
/* if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||||
}
|
}*/
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||||
|
);
|
||||||
isDRPK = 1;
|
isDRPK = 1;
|
||||||
} else if (action3 == 10) {
|
} else if (action3 == 10) {
|
||||||
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
|
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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,6 +377,13 @@ public class SocketRyClient {
|
|||||||
} else if (action == 19) {
|
} else if (action == 19) {
|
||||||
mListener.onAnchorInvalid();
|
mListener.onAnchorInvalid();
|
||||||
}
|
}
|
||||||
|
//主播强制下播
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_END)
|
||||||
|
.setVotes(map.getString("votes"))
|
||||||
|
.setLength(map.getString("length"))
|
||||||
|
.setNums(map.getIntValue("nums"))
|
||||||
|
.setUname(map.getString("uname")));
|
||||||
break;
|
break;
|
||||||
case Constants.SOCKET_CHANGE_LIVE://主播切换计时收费类型
|
case Constants.SOCKET_CHANGE_LIVE://主播切换计时收费类型
|
||||||
mListener.onChangeTimeCharge(map.getIntValue("type_val"));
|
mListener.onChangeTimeCharge(map.getIntValue("type_val"));
|
||||||
@@ -918,7 +938,12 @@ public class SocketRyClient {
|
|||||||
mListener.onSendGift(receiveGiftBean);
|
mListener.onSendGift(receiveGiftBean);
|
||||||
}
|
}
|
||||||
if (map.getIntValue("drpk_status") == 1) {
|
if (map.getIntValue("drpk_status") == 1) {
|
||||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||||
|
.setPkScores(map.getJSONArray("userlist"))
|
||||||
|
.setUid(mLiveUid)
|
||||||
|
.setTime(0));
|
||||||
|
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1068,16 +1093,8 @@ public class SocketRyClient {
|
|||||||
break;
|
break;
|
||||||
case 5://PK时候断开连麦的回调
|
case 5://PK时候断开连麦的回调
|
||||||
if (rtcRoom != null) {
|
if (rtcRoom != null) {
|
||||||
if (LivePushRyViewHolder.mPreView1 != null) {
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
LivePushRyViewHolder.mPreView1.removeAllViews();
|
.setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
|
||||||
LivePushRyViewHolder.mPreView1.setVisibility(View.GONE);
|
|
||||||
isDRPK = 0;
|
|
||||||
leaveDRRoom();
|
|
||||||
}
|
|
||||||
LivePushRyViewHolder.btn_close.setVisibility(View.GONE);
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
|
||||||
params.topMargin = 0;
|
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
|
||||||
//断开连麦
|
//断开连麦
|
||||||
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
|
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
|
||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ public class AbsRyLivePushViewHolder extends AbsViewHolder implements ILivePushV
|
|||||||
protected ViewGroup mLeftContainer;
|
protected ViewGroup mLeftContainer;
|
||||||
protected ViewGroup mRightContainer;
|
protected ViewGroup mRightContainer;
|
||||||
protected ViewGroup mPkContainer;
|
protected ViewGroup mPkContainer;
|
||||||
public static FrameLayout mPreView,mPreView1,dr1_preview,dr2_preview,dr3_preview,dr4_preview;
|
public FrameLayout mPreView, mPreView1, cameraPreview3, dr1_preview, dr2_preview, dr3_preview, dr4_preview;
|
||||||
public static ImageView leave;
|
public ImageView leave;
|
||||||
protected boolean mOpenCamera;//是否选择了相机
|
protected boolean mOpenCamera;//是否选择了相机
|
||||||
|
public LinearLayout camera;
|
||||||
|
|
||||||
//倒计时
|
//倒计时
|
||||||
protected TextView mCountDownText;
|
protected TextView mCountDownText;
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public class CustomViewHolder implements BannerViewHolder<BannerBean> {
|
|||||||
TextView targetAssist = contextView.findViewById(R.id.target_assist_num);
|
TextView targetAssist = contextView.findViewById(R.id.target_assist_num);
|
||||||
TextView currentAssist = contextView.findViewById(R.id.current_assist_num);
|
TextView currentAssist = contextView.findViewById(R.id.current_assist_num);
|
||||||
TextView title = contextView.findViewById(R.id.title);
|
TextView title = contextView.findViewById(R.id.title);
|
||||||
|
|
||||||
|
bannerBack.setImageResource(R.mipmap.start_level);
|
||||||
|
iconStart.setImageResource(R.mipmap.icon_start);
|
||||||
|
iconStartNumber.setImageResource(R.mipmap.icon_start_number);
|
||||||
if (data.isStart()) {
|
if (data.isStart()) {
|
||||||
startContext.setVisibility(View.VISIBLE);
|
startContext.setVisibility(View.VISIBLE);
|
||||||
Glide.with(context).load(R.mipmap.start_level).into(bannerBack);
|
Glide.with(context).load(R.mipmap.start_level).into(bannerBack);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import pl.droidsonroids.gif.GifImageView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/9.
|
* Created by cxf on 2018/10/9.
|
||||||
@@ -198,12 +199,23 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
super.init();
|
super.init();
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
findViewById(R.id.btn_close).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_share).setOnClickListener(this);
|
GifImageView btn_share = (GifImageView) findViewById(R.id.btn_share);
|
||||||
|
btn_share.setImageResource(R.mipmap.zan_gif);
|
||||||
|
btn_share.setOnClickListener(this);
|
||||||
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
findViewById(R.id.btn_red_pack).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_gift).setOnClickListener(this);
|
GifImageView btn_gift = (GifImageView) findViewById(R.id.btn_gift);
|
||||||
findViewById(R.id.btn_zg).setOnClickListener(this);
|
btn_gift.setImageResource(R.mipmap.live_lw);
|
||||||
|
btn_gift.setOnClickListener(this);
|
||||||
|
GifImageView btn_zg = (GifImageView) findViewById(R.id.btn_zg);
|
||||||
|
btn_zg.setImageResource(R.mipmap.zg);
|
||||||
|
btn_zg.setOnClickListener(this);
|
||||||
|
|
||||||
|
GifImageView onecz = (GifImageView) findViewById(R.id.img_onecz);
|
||||||
|
onecz.setImageResource(R.mipmap.onecz);
|
||||||
|
|
||||||
voiceButton = (LinearLayout) findViewById(R.id.voice_button);
|
voiceButton = (LinearLayout) findViewById(R.id.voice_button);
|
||||||
giftImage = (ImageView) findViewById(R.id.gift_image);
|
giftImage = (ImageView) findViewById(R.id.gift_image);
|
||||||
|
giftImage.setImageResource(R.mipmap.live_lw);
|
||||||
liveNewPeople = (ImageView) findViewById(R.id.live_new_people);
|
liveNewPeople = (ImageView) findViewById(R.id.live_new_people);
|
||||||
svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif);
|
svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif);
|
||||||
svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double);
|
svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double);
|
||||||
@@ -249,7 +261,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_hd).setOnClickListener(new View.OnClickListener() {//游戏,活动按钮
|
GifImageView btn_hd = (GifImageView) findViewById(R.id.btn_hd);
|
||||||
|
btn_hd.setImageResource(R.mipmap.play);
|
||||||
|
btn_hd.setOnClickListener(new View.OnClickListener() {//游戏,活动按钮
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
LivePromotionDialogFragment fragment = new LivePromotionDialogFragment();
|
LivePromotionDialogFragment fragment = new LivePromotionDialogFragment();
|
||||||
|
|||||||
@@ -10,17 +10,22 @@ import android.graphics.Color;
|
|||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.os.SystemClock;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewParent;
|
import android.view.ViewParent;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.android.exoplayer2.PlaybackException;
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
||||||
@@ -31,6 +36,7 @@ import com.lxj.xpopup.interfaces.XPopupCallback;
|
|||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.lzy.okserver.OkDownload;
|
import com.lzy.okserver.OkDownload;
|
||||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
@@ -40,6 +46,7 @@ import com.yunbao.common.utils.DpUtil;
|
|||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.MicStatusManager;
|
import com.yunbao.common.utils.MicStatusManager;
|
||||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.common.views.LiveClarityCustomPopup;
|
import com.yunbao.common.views.LiveClarityCustomPopup;
|
||||||
@@ -83,6 +90,7 @@ import cn.rongcloud.rtc.base.RCRTCRoomType;
|
|||||||
import cn.rongcloud.rtc.base.RCRTCStreamType;
|
import cn.rongcloud.rtc.base.RCRTCStreamType;
|
||||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||||
import cn.rongcloud.rtc.center.stream.RCRTCAudioInputStreamImpl;
|
import cn.rongcloud.rtc.center.stream.RCRTCAudioInputStreamImpl;
|
||||||
|
import cn.rongcloud.rtc.core.RendererCommon;
|
||||||
|
|
||||||
public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
||||||
|
|
||||||
@@ -548,8 +556,18 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||||
mVideoView.requestLayout();
|
mVideoView.requestLayout();
|
||||||
}
|
}
|
||||||
|
if (detailsView != null) {
|
||||||
|
mVideoView.removeView(detailsView);
|
||||||
|
detailsView = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeDetailView(){
|
||||||
|
if (detailsView != null) {
|
||||||
|
mVideoView.removeView(detailsView);
|
||||||
|
detailsView = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ViewGroup getSmallContainer() {
|
public ViewGroup getSmallContainer() {
|
||||||
@@ -645,7 +663,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
|
||||||
params.topMargin = 0;
|
params.topMargin = 0;
|
||||||
params.addRule(RelativeLayout.ALIGN_TOP);
|
params.addRule(RelativeLayout.ALIGN_TOP);
|
||||||
// mPlayer.setRenderRotation(V2TXLiveDef.V2TXLiveRotation.V2TXLiveRotation270);
|
|
||||||
mVideoView.requestLayout();
|
mVideoView.requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -891,7 +908,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
RCRTCVideoView remoteView = new RCRTCVideoView(contexts);
|
||||||
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
((RCRTCVideoInputStream) stream).setVideoView(remoteView);
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
|
remoteView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);
|
||||||
ry_view.addView(remoteView);
|
ry_view.addView(remoteView);
|
||||||
Log.e("ry", stream.getMediaType() + "rcrtcOtherRoom成功 :" + data.getLiveStreams().size());
|
Log.e("ry", stream.getMediaType() + "rcrtcOtherRoom成功 :" + data.getLiveStreams().size());
|
||||||
}
|
}
|
||||||
@@ -1072,7 +1090,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
});
|
});
|
||||||
//todo 本demo只演示添加1个远端用户的视图
|
//todo 本demo只演示添加1个远端用户的视图
|
||||||
ry_view.removeAllViews();
|
ry_view.removeAllViews();
|
||||||
remoteView.setScalingType(SCALE_ASPECT_FILL);
|
remoteView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||||
|
remoteView.setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FIT);
|
||||||
ry_view.addView(remoteView);
|
ry_view.addView(remoteView);
|
||||||
}
|
}
|
||||||
userinputStreamList1.add(stream);
|
userinputStreamList1.add(stream);
|
||||||
@@ -1201,5 +1220,130 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
private int mPkTimeCount = 0;
|
||||||
|
private Handler countdownHandler = new Handler();
|
||||||
|
private View detailsView = null;
|
||||||
|
private FrameLayout timeTitle;
|
||||||
|
private TextView textTime;
|
||||||
|
private TextView textPkName1, textPkName2, textPkName3, textPkName4;
|
||||||
|
private TextView textGrade1, textGrade2, textGrade3, textGrade4;
|
||||||
|
private ImageView imageGrade1, imageGrade2, imageGrade3, imageGrade4;
|
||||||
|
private LinearLayout linearGrade1, linearGrade2, linearGrade3, linearGrade4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PK倒计时
|
||||||
|
*/
|
||||||
|
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||||
|
|
||||||
|
if (detailsView == null) {
|
||||||
|
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
timeTitle = detailsView.findViewById(R.id.time_title);
|
||||||
|
textTime = detailsView.findViewById(R.id.text_time);
|
||||||
|
linearGrade1 = detailsView.findViewById(R.id.lin_pk1);
|
||||||
|
linearGrade2 = detailsView.findViewById(R.id.lin_pk2);
|
||||||
|
linearGrade3 = detailsView.findViewById(R.id.lin_pk3);
|
||||||
|
linearGrade4 = detailsView.findViewById(R.id.lin_pk4);
|
||||||
|
textPkName1 = detailsView.findViewById(R.id.text_pk_name1);
|
||||||
|
textPkName2 = detailsView.findViewById(R.id.text_pk_name2);
|
||||||
|
textPkName3 = detailsView.findViewById(R.id.text_pk_name3);
|
||||||
|
textPkName4 = detailsView.findViewById(R.id.text_pk_name4);
|
||||||
|
textGrade1 = detailsView.findViewById(R.id.text_grade1);
|
||||||
|
textGrade2 = detailsView.findViewById(R.id.text_grade2);
|
||||||
|
textGrade3 = detailsView.findViewById(R.id.text_grade3);
|
||||||
|
textGrade4 = detailsView.findViewById(R.id.text_grade4);
|
||||||
|
imageGrade1 = detailsView.findViewById(R.id.image_grade1);
|
||||||
|
imageGrade2 = detailsView.findViewById(R.id.image_grade2);
|
||||||
|
imageGrade3 = detailsView.findViewById(R.id.image_grade3);
|
||||||
|
imageGrade4 = detailsView.findViewById(R.id.image_grade4);
|
||||||
|
linearGrade1.setVisibility(View.GONE);
|
||||||
|
linearGrade2.setVisibility(View.GONE);
|
||||||
|
linearGrade3.setVisibility(View.GONE);
|
||||||
|
linearGrade4.setVisibility(View.GONE);
|
||||||
|
mVideoView.addView(detailsView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
|
String userNiceName = score.getString("user_nicename");
|
||||||
|
long userScore = score.getLong("score");
|
||||||
|
int resScore = R.mipmap.icon_livepk_no1;
|
||||||
|
if (userScore == 0 && !score.containsKey("paiming")) {
|
||||||
|
resScore = R.mipmap.icon_livepk_no1;
|
||||||
|
} else {
|
||||||
|
if (score.containsKey("paiming")) {
|
||||||
|
int ranking = score.getIntValue("paiming");
|
||||||
|
switch (ranking) {
|
||||||
|
case 1:
|
||||||
|
resScore = R.mipmap.icon_livepk_no1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
resScore = R.mipmap.icon_livepk_no2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
resScore = R.mipmap.icon_livepk_no3;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
resScore = R.mipmap.icon_livepk_no4;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i == 0) {
|
||||||
|
linearGrade1.setVisibility(View.VISIBLE);
|
||||||
|
textPkName1.setText(userNiceName);
|
||||||
|
ImgLoader.display(mContext, resScore, imageGrade1);
|
||||||
|
textGrade1.setText(String.valueOf(userScore));
|
||||||
|
} else if (i == 1) {
|
||||||
|
linearGrade2.setVisibility(View.VISIBLE);
|
||||||
|
textPkName2.setText(userNiceName);
|
||||||
|
ImgLoader.display(mContext, resScore, imageGrade2);
|
||||||
|
textGrade2.setText(String.valueOf(userScore));
|
||||||
|
} else if (i == 2) {
|
||||||
|
linearGrade4.setVisibility(View.VISIBLE);
|
||||||
|
textPkName4.setText(userNiceName);
|
||||||
|
ImgLoader.display(mContext, resScore, imageGrade4);
|
||||||
|
textGrade4.setText(String.valueOf(userScore));
|
||||||
|
} else if (i == 3) {
|
||||||
|
linearGrade3.setVisibility(View.VISIBLE);
|
||||||
|
textPkName3.setText(userNiceName);
|
||||||
|
ImgLoader.display(mContext, resScore, imageGrade3);
|
||||||
|
textGrade3.setText(String.valueOf(userScore));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time > 0) {
|
||||||
|
mPkTimeCount = time;
|
||||||
|
timeTitle.setVisibility(View.VISIBLE);
|
||||||
|
countdownHandler.postAtTime(countdownRunnable, getNextSecondTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Runnable countdownRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mPkTimeCount--;
|
||||||
|
if (mPkTimeCount > 0) {//
|
||||||
|
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||||
|
textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||||
|
countdownHandler.postAtTime(countdownRunnable, getNextSecondTime());
|
||||||
|
} else {
|
||||||
|
timeTitle.setVisibility(View.GONE);
|
||||||
|
countdownHandler.removeCallbacks(countdownRunnable);
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取下一秒钟的时间
|
||||||
|
*/
|
||||||
|
private long getNextSecondTime() {
|
||||||
|
long now = SystemClock.uptimeMillis();
|
||||||
|
return now + (1000 - now % 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,11 +102,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
public TencentTRTCBeautyManager tencentTRTCBeautyManager;
|
public TencentTRTCBeautyManager tencentTRTCBeautyManager;
|
||||||
public static Context contexts;
|
public static Context contexts;
|
||||||
public static TextView btn_close;
|
public static TextView btn_close;
|
||||||
public static LinearLayout dr_pk_view;
|
public LinearLayout dr_pk_view;
|
||||||
public static RCRTCRoom rtcRoom;
|
public static RCRTCRoom rtcRoom;
|
||||||
public static RCRTCLiveInfo rcrtcLiveInfo;
|
public static RCRTCLiveInfo rcrtcLiveInfo;
|
||||||
|
|
||||||
private ViewGroup liveActivityContainer;
|
private ViewGroup liveActivityContainer;
|
||||||
|
public FrameLayout timeTitle;
|
||||||
|
public TextView textTime;
|
||||||
private TextView tv_avatarOther_name;
|
private TextView tv_avatarOther_name;
|
||||||
private ImageView avatarOther;
|
private ImageView avatarOther;
|
||||||
private LinearLayout goto_room_view;
|
private LinearLayout goto_room_view;
|
||||||
@@ -341,6 +343,8 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
userBean1.setUserNiceName("null");
|
userBean1.setUserNiceName("null");
|
||||||
userBean1.setAvatar("null");
|
userBean1.setAvatar("null");
|
||||||
}
|
}
|
||||||
|
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
||||||
|
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3);
|
||||||
//单人PK,减掉次数
|
//单人PK,减掉次数
|
||||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||||
@@ -398,14 +402,19 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
super.init();
|
super.init();
|
||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
mPreView = (FrameLayout) findViewById(R.id.camera_preview);
|
mPreView = (FrameLayout) findViewById(R.id.camera_preview);
|
||||||
|
camera = (LinearLayout) findViewById(R.id.camera);
|
||||||
mPreView1 = (FrameLayout) findViewById(R.id.camera_preview1);
|
mPreView1 = (FrameLayout) findViewById(R.id.camera_preview1);
|
||||||
|
cameraPreview3 = (FrameLayout) findViewById(R.id.camera_preview3);
|
||||||
dr1_preview = (FrameLayout) findViewById(R.id.dr1_preview);
|
dr1_preview = (FrameLayout) findViewById(R.id.dr1_preview);
|
||||||
dr2_preview = (FrameLayout) findViewById(R.id.dr2_preview);
|
dr2_preview = (FrameLayout) findViewById(R.id.dr2_preview);
|
||||||
dr3_preview = (FrameLayout) findViewById(R.id.dr3_preview);
|
dr3_preview = (FrameLayout) findViewById(R.id.dr3_preview);
|
||||||
dr4_preview = (FrameLayout) findViewById(R.id.dr4_preview);
|
dr4_preview = (FrameLayout) findViewById(R.id.dr4_preview);
|
||||||
leave = (ImageView) findViewById(R.id.leave);
|
leave = (ImageView) findViewById(R.id.leave);
|
||||||
dr_pk_view = (LinearLayout) findViewById(R.id.dr_pk_view);
|
dr_pk_view = (LinearLayout) findViewById(R.id.dr_pk_view);
|
||||||
|
timeTitle = (FrameLayout) findViewById(R.id.time_title);
|
||||||
|
textTime = (TextView) findViewById(R.id.text_time);
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
dr_pk_view.setVisibility(View.GONE);
|
||||||
|
cameraPreview3.setVisibility(View.GONE);
|
||||||
btn_close = (TextView) findViewById(R.id.btn_close);
|
btn_close = (TextView) findViewById(R.id.btn_close);
|
||||||
tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name);
|
tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name);
|
||||||
avatarOther = (ImageView) findViewById(R.id.avatarOther);
|
avatarOther = (ImageView) findViewById(R.id.avatarOther);
|
||||||
@@ -450,6 +459,10 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
mPreView1.setVisibility(View.GONE);
|
mPreView1.setVisibility(View.GONE);
|
||||||
inputStreamList.clear();
|
inputStreamList.clear();
|
||||||
inputStreamList1.clear();
|
inputStreamList1.clear();
|
||||||
|
changeToBig();
|
||||||
|
//清理PK上面对方的头像
|
||||||
|
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
|
||||||
|
closeButtonGone();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -668,19 +681,29 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
params.width = mPreView.getWidth() / 2;
|
params.width = mPreView.getWidth() / 2;
|
||||||
params.height = DpUtil.dp2px(250);
|
params.height = DpUtil.dp2px(250);
|
||||||
params.topMargin = DpUtil.dp2px(130);
|
params.topMargin = DpUtil.dp2px(130);
|
||||||
mPreView.setLayoutParams(params);
|
camera.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeToBig() {
|
public void changeToBig() {
|
||||||
if (mPreView != null) {
|
if (camera != null) {
|
||||||
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mPreView.getLayoutParams();
|
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) camera.getLayoutParams();
|
||||||
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
params.topMargin = 0;
|
params.topMargin = 0;
|
||||||
mPreView.setLayoutParams(params);
|
camera.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
|
if (mPreView1.getVisibility() == View.VISIBLE) {
|
||||||
|
mPreView1.removeAllViews();
|
||||||
|
mPreView1.setVisibility(View.GONE);
|
||||||
|
inputStreamList.clear();
|
||||||
|
inputStreamList1.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeButtonGone() {
|
||||||
|
btn_close.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.yunbao.live.views;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@@ -101,6 +102,7 @@ public abstract class LiveRoomPlayViewHolder extends AbsViewHolder implements IL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public interface OnMicCallback {
|
public interface OnMicCallback {
|
||||||
void onMikUpdate();
|
void onMikUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ import org.greenrobot.eventbus.Subscribe;
|
|||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -469,6 +470,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
public void endDRGif() {
|
public void endDRGif() {
|
||||||
if (dr_pk_end_gif.getVisibility() == View.GONE) {
|
if (dr_pk_end_gif.getVisibility() == View.GONE) {
|
||||||
|
dr_pk_end_gif.setImageResource(R.mipmap.drpkend);
|
||||||
dr_pk_end_gif.setVisibility(View.VISIBLE);
|
dr_pk_end_gif.setVisibility(View.VISIBLE);
|
||||||
RequestOptions options = new RequestOptions().skipMemoryCache(true);//配置
|
RequestOptions options = new RequestOptions().skipMemoryCache(true);//配置
|
||||||
Glide.with(mContext).asGif()
|
Glide.with(mContext).asGif()
|
||||||
@@ -3693,6 +3695,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
|
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE);
|
LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE);
|
||||||
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
|
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
|
||||||
|
clearImageView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
@@ -3937,7 +3940,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
customFullServiceNotify(event.getCustomFullServiceNotifyEvent());
|
customFullServiceNotify(event.getCustomFullServiceNotifyEvent());
|
||||||
break;
|
break;
|
||||||
case PK_TIME_COUNT:
|
case PK_TIME_COUNT:
|
||||||
endDRGif();
|
// endDRGif();
|
||||||
break;
|
break;
|
||||||
case UP_PK_TWO:
|
case UP_PK_TWO:
|
||||||
pkUid = (String) event.getObject();
|
pkUid = (String) event.getObject();
|
||||||
@@ -4009,4 +4012,22 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private void clearImageView() {
|
||||||
|
try {
|
||||||
|
Field[] fields = getClass().getFields();
|
||||||
|
int i = 0;
|
||||||
|
for (Field field : fields) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
if (field.get(this) instanceof ImageView) {
|
||||||
|
((ImageView) field.get(this)).setImageDrawable(null);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.i("清理图片缓存", "clearImageView: "+i);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
|||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@@ -149,7 +148,8 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
leaveDRRoom();
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||||
PKing = false;
|
PKing = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
|||||||
import androidx.viewpager.widget.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.GsonUtils;
|
import com.blankj.utilcode.util.GsonUtils;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
@@ -129,7 +130,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
//侧滑布局
|
//侧滑布局
|
||||||
// private DrawerLayout drawerLayout;
|
// private DrawerLayout drawerLayout;
|
||||||
//直播间拆分布局
|
//直播间拆分布局
|
||||||
private LiveRoomPlayViewHolder mLivePlayViewHolder;
|
private LivePlayRyViewHolder mLivePlayViewHolder;
|
||||||
//头部布局
|
//头部布局
|
||||||
public LiveRoomViewHolder mLiveRoomViewHolder;
|
public LiveRoomViewHolder mLiveRoomViewHolder;
|
||||||
//底部布局
|
//底部布局
|
||||||
@@ -255,6 +256,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) {
|
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) {
|
||||||
isEnterRoom = false;
|
isEnterRoom = false;
|
||||||
openParametersModel = new OpenParametersModel();
|
openParametersModel = new OpenParametersModel();
|
||||||
|
if(mLiveRoomViewHolder!=null){
|
||||||
|
mLiveRoomViewHolder.UpPkTwo();
|
||||||
|
}
|
||||||
mContext.runOnUiThread(new Runnable() {
|
mContext.runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -316,6 +320,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mask.setVisibility(View.VISIBLE);
|
mask.setVisibility(View.VISIBLE);
|
||||||
mLivePlayViewHolder.clearFrame();
|
mLivePlayViewHolder.clearFrame();
|
||||||
mLivePlayViewHolder.setLiveBean(mLiveBean);
|
mLivePlayViewHolder.setLiveBean(mLiveBean);
|
||||||
|
mLivePlayViewHolder.removeDetailView();
|
||||||
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
|
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
|
||||||
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
|
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
|
||||||
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
|
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
|
||||||
@@ -574,7 +579,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLivePlayViewHolder.setViewUP(4);
|
mLivePlayViewHolder.setViewUP(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
mLiveRoomViewHolder.UpPkBar(pkInfo.getJSONArray("userlist"), mLiveBean.getUid(), pkInfo.getIntValue("drpk_time"));
|
upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
|
||||||
}
|
}
|
||||||
//守护相关
|
//守护相关
|
||||||
mLiveGuardInfo = new LiveGuardInfo();
|
mLiveGuardInfo = new LiveGuardInfo();
|
||||||
@@ -1818,6 +1823,31 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mViewPager.setCanScroll(enableScroll);
|
mViewPager.setCanScroll(enableScroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户端多人Pk
|
||||||
|
*
|
||||||
|
* @param pkScores
|
||||||
|
* @param time
|
||||||
|
*/
|
||||||
|
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||||
|
if (mLivePlayViewHolder != null) {
|
||||||
|
String liveId = mLiveBean.getUid();
|
||||||
|
JSONObject liveModel = null;
|
||||||
|
//调整数据
|
||||||
|
int index = 0;
|
||||||
|
for (int i = 0; i < pkScores.size(); i++) {
|
||||||
|
JSONObject score = pkScores.getJSONObject(i);
|
||||||
|
if (TextUtils.equals(score.getString("id"), liveId)) {
|
||||||
|
liveModel = score;
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pkScores.remove(index);
|
||||||
|
pkScores.add(0, liveModel);
|
||||||
|
mLivePlayViewHolder.upDataPkScore(pkScores, time);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void endDRGif() {
|
public void endDRGif() {
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
|
|||||||
5
live/src/main/res/drawable/background_pk_time.xml
Normal file
5
live/src/main/res/drawable/background_pk_time.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#60000000" />
|
||||||
|
<corners android:radius="7.17dp" />
|
||||||
|
</shape>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@@ -9,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@@ -36,7 +38,7 @@
|
|||||||
android:onClick="backClick"
|
android:onClick="backClick"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:src="@mipmap/icon_back"
|
android:src="@mipmap/icon_back"
|
||||||
android:tint="@color/textColor" />
|
app:tint="@color/textColor" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/img_more"
|
android:id="@+id/img_more"
|
||||||
@@ -46,21 +48,21 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:padding="9dp"
|
android:padding="9dp"
|
||||||
android:src="@mipmap/btn_more_black"
|
android:src="@mipmap/btn_more_black"
|
||||||
android:tint="@color/textColor"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
app:tint="@color/textColor" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/html_error"
|
android:id="@+id/html_error"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<WebView
|
<!-- <WebView
|
||||||
android:id="@+id/rlWebview"
|
android:id="@+id/rlWebview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,7 @@
|
|||||||
android:id="@+id/img_onecz"
|
android:id="@+id/img_onecz"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true" />
|
||||||
android:src="@mipmap/onecz" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -144,7 +143,6 @@
|
|||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:src="@mipmap/zg"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
@@ -166,7 +164,7 @@
|
|||||||
android:layout_width="33dp"
|
android:layout_width="33dp"
|
||||||
android:layout_height="33dp"
|
android:layout_height="33dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@mipmap/play" />
|
/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -181,7 +179,6 @@
|
|||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:src="@mipmap/zan_gif"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<pl.droidsonroids.gif.GifImageView
|
<pl.droidsonroids.gif.GifImageView
|
||||||
@@ -194,7 +191,6 @@
|
|||||||
android:layout_toLeftOf="@id/btn_close"
|
android:layout_toLeftOf="@id/btn_close"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@mipmap/img_bg"
|
android:background="@mipmap/img_bg"
|
||||||
android:src="@mipmap/live_lw"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -394,8 +390,7 @@
|
|||||||
android:id="@+id/gift_image"
|
android:id="@+id/gift_image"
|
||||||
android:layout_width="38dp"
|
android:layout_width="38dp"
|
||||||
android:layout_height="38dp"
|
android:layout_height="38dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp" />
|
||||||
android:src="@mipmap/live_lw" />
|
|
||||||
<!--普通工具合集-->
|
<!--普通工具合集-->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/total_image"
|
android:id="@+id/total_image"
|
||||||
|
|||||||
252
live/src/main/res/layout/view_live_pk_details.xml
Normal file
252
live/src/main/res/layout/view_live_pk_details.xml
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<!--左上-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_pk1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_grade1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginTop="4.67dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_grade1"
|
||||||
|
android:layout_width="10.67dp"
|
||||||
|
android:layout_height="10.67dp"
|
||||||
|
android:layout_marginStart="2.67dp"
|
||||||
|
android:layout_marginTop="1.67dp"
|
||||||
|
android:layout_marginEnd="4.33dp"
|
||||||
|
android:layout_marginBottom="1.67dp"
|
||||||
|
android:src="@mipmap/icon_livepk_no1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_grade1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.76dp"
|
||||||
|
android:text="000"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_pk_name1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginTop="3.3dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxWidth="50dp"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4.33dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4.33dp"
|
||||||
|
android:text="我方"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<!--右上-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_pk2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:gravity="end"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_grade2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4.67dp"
|
||||||
|
android:layout_marginEnd="5.33dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_grade2"
|
||||||
|
android:layout_width="10.67dp"
|
||||||
|
android:layout_height="10.67dp"
|
||||||
|
android:layout_marginStart="2.67dp"
|
||||||
|
android:layout_marginTop="1.67dp"
|
||||||
|
android:layout_marginEnd="4.33dp"
|
||||||
|
android:layout_marginBottom="1.67dp"
|
||||||
|
android:src="@mipmap/icon_livepk_no2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_grade2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.76dp"
|
||||||
|
android:text="000"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_pk_name2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3.3dp"
|
||||||
|
android:layout_marginEnd="5.33dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxWidth="50dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4.33dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4.33dp"
|
||||||
|
android:text="我方"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<!--左下-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_pk3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_pk_name3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginBottom="3.3dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxWidth="50dp"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4.33dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4.33dp"
|
||||||
|
android:text="我方"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_grade3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.33dp"
|
||||||
|
android:layout_marginBottom="4.67dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_grade3"
|
||||||
|
android:layout_width="10.67dp"
|
||||||
|
android:layout_height="10.67dp"
|
||||||
|
android:layout_marginStart="2.67dp"
|
||||||
|
android:layout_marginTop="1.67dp"
|
||||||
|
android:layout_marginEnd="4.33dp"
|
||||||
|
android:layout_marginBottom="1.67dp"
|
||||||
|
android:src="@mipmap/icon_livepk_no3" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_grade3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.76dp"
|
||||||
|
android:text="000"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
<!--右下-->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/lin_pk4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:gravity="end"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_pk_name4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="5.33dp"
|
||||||
|
android:layout_marginBottom="3.3dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxWidth="50dp"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingTop="4.33dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:paddingBottom="4.33dp"
|
||||||
|
android:text="我方"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_grade4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="5.33dp"
|
||||||
|
android:layout_marginBottom="4.67dp"
|
||||||
|
android:background="@drawable/background_pk_time"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_grade4"
|
||||||
|
android:layout_width="10.67dp"
|
||||||
|
android:layout_height="10.67dp"
|
||||||
|
android:layout_marginStart="2.67dp"
|
||||||
|
android:layout_marginTop="1.67dp"
|
||||||
|
android:layout_marginEnd="4.33dp"
|
||||||
|
android:layout_marginBottom="1.67dp"
|
||||||
|
android:src="@mipmap/icon_livepk_no3" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_grade4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.76dp"
|
||||||
|
android:text="000"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
<!--PK时间-->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/time_title"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:background="@mipmap/live_pk_time_bg"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/pk_time"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
</FrameLayout>
|
||||||
@@ -1,33 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/camera"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/camera_preview"
|
android:id="@+id/camera_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/camera_preview3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/camera_preview1"
|
android:id="@+id/camera_preview1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/dr_pk_view"
|
<LinearLayout
|
||||||
|
android:id="@+id/dr_pk_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@+id/camera_preview"
|
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="130dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -37,17 +53,17 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr1_preview"
|
android:id="@+id/dr1_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr2_preview"
|
android:id="@+id/dr2_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -59,24 +75,23 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr3_preview"
|
android:id="@+id/dr3_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr4_preview"
|
android:id="@+id/dr4_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@@ -85,24 +100,20 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/layout_surface"
|
android:id="@+id/layout_surface"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<SurfaceView
|
<SurfaceView
|
||||||
android:id="@+id/surface_view"
|
android:id="@+id/surface_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -112,9 +123,9 @@
|
|||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginTop="122dp"
|
android:layout_marginTop="122dp"
|
||||||
android:layout_marginRight="9dp"
|
android:layout_marginRight="9dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:background="@drawable/bg_live_other_ico"
|
android:background="@drawable/bg_live_other_ico"
|
||||||
android:gravity="center">
|
android:gravity="center"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="21dp"
|
android:layout_width="21dp"
|
||||||
@@ -145,56 +156,54 @@
|
|||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/pk_container"
|
android:id="@+id/pk_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="270dp"
|
android:layout_height="270dp"
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="130dp">
|
||||||
>
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout4
|
<com.yunbao.live.custom.MyFrameLayout4
|
||||||
android:id="@+id/left_container"
|
android:id="@+id/left_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout4
|
<com.yunbao.live.custom.MyFrameLayout4
|
||||||
android:id="@+id/right_container"
|
android:id="@+id/right_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="right"
|
android:layout_gravity="right"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<TextView android:id="@+id/btn_close"
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_close"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="5dp"
|
android:layout_alignParentRight="true"
|
||||||
android:paddingBottom="5dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:layout_marginTop="400dp"
|
android:layout_marginTop="400dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_alignParentRight="true"
|
android:background="@drawable/background_dedede"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
android:text="結束連麥"
|
android:text="結束連麥"
|
||||||
android:textSize="13sp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@color/color_white"
|
android:textColor="@color/color_white"
|
||||||
android:background="@drawable/background_dedede"/>
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout3
|
<com.yunbao.live.custom.MyFrameLayout3
|
||||||
android:id="@+id/small_container"
|
android:id="@+id/small_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginBottom="120dp"
|
android:layout_marginBottom="120dp"
|
||||||
app:mfl3_ratio="0.25"
|
app:mfl3_ratio="0.25" />
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -202,7 +211,26 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/zslk"
|
android:src="@mipmap/zslk"
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/time_title"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="16.67dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@mipmap/live_pk_time_bg"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/pk_time"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
<!-- 详情-->
|
||||||
|
</FrameLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -654,7 +653,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -1265,7 +1263,6 @@
|
|||||||
android:layout_alignTop="@+id/live_video"
|
android:layout_alignTop="@+id/live_video"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:src="@mipmap/icon_rank_top_box"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
@@ -1533,7 +1530,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/live_top"
|
android:layout_marginTop="@dimen/live_top"
|
||||||
android:visibility="gone">
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/time"
|
||||||
@@ -1656,7 +1654,6 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -1710,7 +1707,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -1764,7 +1761,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -1820,7 +1817,7 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -1876,7 +1873,6 @@
|
|||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/bg_guard_buy_top_1"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -2041,7 +2037,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -2075,7 +2071,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -2109,7 +2105,7 @@
|
|||||||
android:layout_marginEnd="1dp"
|
android:layout_marginEnd="1dp"
|
||||||
android:layout_marginBottom="11dp"
|
android:layout_marginBottom="11dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/m_chu_xia"
|
|
||||||
app:riv_oval="true" />
|
app:riv_oval="true" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -2293,7 +2289,6 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="false"
|
android:layout_centerVertical="false"
|
||||||
android:layout_marginTop="160dp"
|
android:layout_marginTop="160dp"
|
||||||
android:src="@mipmap/drpkend"
|
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@mipmap/start_level" />
|
/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/start_context"
|
android:id="@+id/start_context"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
android:id="@+id/icon_start"
|
android:id="@+id/icon_start"
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:src="@mipmap/icon_start" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/total_star_value"
|
android:id="@+id/total_star_value"
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
android:id="@+id/icon_start_number"
|
android:id="@+id/icon_start_number"
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:src="@mipmap/icon_start_number" />
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/number_of_people_assisted"
|
android:id="@+id/number_of_people_assisted"
|
||||||
|
|||||||
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no1.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no2.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no3.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no4.png
Normal file
BIN
live/src/main/res/mipmap-xxxhdpi/icon_livepk_no4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -608,10 +608,11 @@ public class EntryActivity extends AppCompatActivity {
|
|||||||
private void onLoginSuccess(int code, String msg, String[] info) {
|
private void onLoginSuccess(int code, String msg, String[] info) {
|
||||||
Log.e("他", code + "code" + info.toString());
|
Log.e("他", code + "code" + info.toString());
|
||||||
if (code == 0 && info.length > 0) {
|
if (code == 0 && info.length > 0) {
|
||||||
|
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
String uid = obj.getString("id");
|
String uid = obj.getString("id");
|
||||||
String token = obj.getString("token");
|
String token = obj.getString("token");
|
||||||
if (obj.getString("need_bind").equals("0")) {
|
if (obj.containsKey("need_bind") && obj.getString("need_bind").equals("0")) {
|
||||||
mFirstLogin = obj.getIntValue("first_login") == 1;
|
mFirstLogin = obj.getIntValue("first_login") == 1;
|
||||||
mShowInvite = obj.getIntValue("isagent") == 1;
|
mShowInvite = obj.getIntValue("isagent") == 1;
|
||||||
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
CommonAppConfig.getInstance().setLoginInfo(uid, token, true);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.animation.Animator;
|
|||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.app.Application;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@@ -312,6 +313,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
|
if (mTabButtonGroup.getCurPosition() != position) {
|
||||||
|
System.err.println("重新初始化IM");
|
||||||
|
RongcloudIMManager.connectIM(mContext.getApplication());
|
||||||
|
position = 0;
|
||||||
|
mTabButtonGroup.setCurPosition(0);
|
||||||
|
}
|
||||||
if (position != 0) {
|
if (position != 0) {
|
||||||
loadPageData(position, true);
|
loadPageData(position, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ public class MyWebViewActivity extends AbsActivity {
|
|||||||
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
MicStatusManager.getInstance().showDownMicDialog(mContext);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)));
|
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal)).setLiveEnd(true));
|
||||||
} else {
|
} else {
|
||||||
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
package com.yunbao.main.views;
|
package com.yunbao.main.views;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
|
import com.lzf.easyfloat.enums.ShowPattern;
|
||||||
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.utils.DeviceUtils;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.dialog.LiveRobotSettingDialogFragment;
|
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/22.
|
* Created by cxf on 2018/9/22.
|
||||||
@@ -32,6 +45,9 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
|||||||
return R.layout.view_main_home;
|
return R.layout.view_main_home;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TextView debugView;
|
||||||
|
private TimerTask task;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -39,7 +55,44 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
|||||||
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
img_trophy = (ImageView) findViewById(R.id.img_trophy);
|
||||||
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
|
||||||
|
|
||||||
|
}
|
||||||
|
private void showDebugFloatView(){
|
||||||
|
img_trophy.setOnClickListener(v -> {
|
||||||
|
if (EasyFloat.isShow("Debug")) {
|
||||||
|
EasyFloat.dismiss("Debug");
|
||||||
|
task.cancel();
|
||||||
|
task = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (debugView == null) {
|
||||||
|
debugView = new TextView(mContext);
|
||||||
|
debugView.setBackgroundColor(Color.WHITE);
|
||||||
|
}
|
||||||
|
EasyFloat.with(mContext)
|
||||||
|
.setDragEnable(true)
|
||||||
|
.setTag("Debug")
|
||||||
|
.setShowPattern(ShowPattern.ALL_TIME)
|
||||||
|
.setLayout(debugView)
|
||||||
|
.show();
|
||||||
|
if (task == null) {
|
||||||
|
task = new TimerTask() {
|
||||||
|
Handler handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (WeakReference<Activity> reference : CommonAppContext.activityList) {
|
||||||
|
builder.append(reference.get().getClass().getSimpleName()).append("\n");
|
||||||
|
}
|
||||||
|
builder.append("内存:").append(DeviceUtils.getMemoryToFormat(mContext));
|
||||||
|
if (debugView != null) {
|
||||||
|
handler.post(() -> debugView.setText(builder.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
new Timer().schedule(task, 0, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user