|
/** 用来切换的标识 */
private int tag = 0;
/** 此方法会交换两个位置的信息 */
private void changeSize() {
if (tag == 0) {
// 先取消绑定别人的画面
anychatSDK.mVideoHelper.UnBindVideo(index);
// 移出别人的画面
rlContainer.removeView(mOtherView);
mMyView.setLayoutParams(paramsBig);
mOtherView.setLayoutParams(paramsSmall);
mOtherView.setZOrderOnTop(true);
rlContainer.addView(mOtherView);
// 绑定别人的画面
index = anychatSDK.mVideoHelper.bindVideo(mOtherView.getHolder());
anychatSDK.mVideoHelper.SetVideoUser(index, userID);
tag = 1;
} else {
// 先取消绑定别人的画面
anychatSDK.mVideoHelper.UnBindVideo(index);
// 移出别的画面
rlContainer.removeView(mOtherView);
mMyView.setLayoutParams(paramsSmall);
mOtherView.setLayoutParams(paramsBig);
rlContainer.addView(mOtherView, -1);
mOtherView.setZOrderOnTop(false);
mOtherView.setZOrderMediaOverlay(false);
mMyView.setZOrderMediaOverlay(true);
mMyView.setZOrderOnTop(true);
// 绑定别人的画面
index = anychatSDK.mVideoHelper.bindVideo(mOtherView.getHolder());
anychatSDK.mVideoHelper.SetVideoUser(index, userID);
tag = 0;
}
}
您看看调用的顺序对吗? |
|