第十次接口合并,手机开播横屏展示修复

This commit is contained in:
18401019693 2022-11-28 10:46:49 +08:00
parent 7008ccc505
commit 546d9b5728
4 changed files with 49 additions and 26 deletions

View File

@ -62,7 +62,7 @@ public class LiveInfoModel extends BaseModel {
@SerializedName("islive")
private long islive;
@SerializedName("landscape")
private long landscape = 0;
private int landscape = 0;
@SerializedName("is_rong")
private long isRong = 0;
@SerializedName("nums")
@ -208,11 +208,11 @@ public class LiveInfoModel extends BaseModel {
return this;
}
public long getLandscape() {
public int getLandscape() {
return landscape;
}
public LiveInfoModel setLandscape(long landscape) {
public LiveInfoModel setLandscape(int landscape) {
this.landscape = landscape;
return this;
}

View File

@ -1,5 +1,7 @@
package com.yunbao.live.dialog;
import static com.yunbao.live.activity.LiveActivity.mLiveUid;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
@ -13,11 +15,8 @@ import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveReportActivity;
import com.yunbao.live.views.LivePlayRyViewHolder;
import com.yunbao.live.views.LiveRoomViewHolder;
import static com.yunbao.live.activity.LiveActivity.mLiveUid;
/**
* 全屏 分享 弹出框
*/
@ -61,9 +60,7 @@ public class LiveMoreDialogFragment extends AbsDialogFragment {
@Override
public void onClick(View v) {
dismiss();
if (LivePlayRyViewHolder.landscape != 1) {
} else if (((LiveAudienceActivity) mContext).pkInfo != null && ((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 && ((LiveAudienceActivity) mContext).anyway.equals("1") && LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE) {
if (((LiveAudienceActivity) mContext).pkInfo != null && ((LiveAudienceActivity) mContext).pkInfo.getIntValue("ifpk") == 0 && ((LiveAudienceActivity) mContext).anyway.equals("1") && LiveRoomViewHolder.d_pk_view.getVisibility() != View.VISIBLE) {
((LiveAudienceActivity) mContext).btnSmallScreen.setVisibility(View.VISIBLE);
LiveAudienceActivity.setCurrentItem(0);
LiveAudienceActivity.getmLivePlayViewHolder().fullScreen();

View File

@ -87,7 +87,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public static ImageView leave;
private boolean mPausedPlay;//是否被动暂停了播放
public static int landscape; //1h 2s
public int landscape; //1h 2s
public static Context contexts;
public V2TXLivePlayer mPlayer;
public static FrameLayout ry_view;
@ -103,6 +103,10 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
RCRTCRoom rcrtcRoom;
String purl;
public int getLandscape() {
return landscape;
}
public LivePlayRyViewHolder(Context context, ViewGroup parentView, int landscapes) {
super(context, parentView);
contexts = context;
@ -110,14 +114,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
Log.i("收收收", landscape + "");
}
public LivePlayRyViewHolder(Context context, ViewGroup parentView) {
super(context, parentView);
}
public static void setLandscape(int landscape) {
Log.i("", "是的" + landscape);
LivePlayKsyViewHolder.landscape = landscape;
}
@Override
protected int getLayoutId() {
@ -164,7 +161,36 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override
public void setLiveBeanLandscape(int landscape) {
LivePlayRyViewHolder.landscape = landscape;
if (landscape == 2) {
Log.i("收到socket--->", "还原916");
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
params.topMargin = 0;
mVideoView.setLayoutParams(params);
mVideoView.requestLayout();
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
params1.height = RelativeLayout.LayoutParams.MATCH_PARENT;
params1.topMargin = 0;
ry_view.setLayoutParams(params1);
ry_view.requestLayout();
} else {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = vHeight;
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
params.addRule(RelativeLayout.ALIGN_TOP);
mVideoView.setLayoutParams(params);
mVideoView.requestLayout();
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
params1.height = vHeight;
params1.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
params1.addRule(RelativeLayout.ALIGN_TOP);
ry_view.setLayoutParams(params1);
ry_view.requestLayout();
}
hideCover();
}
/**
@ -335,7 +361,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public static void setViewUP(int i) {
if (mVideoView == null) return;
Log.i("", "整理" + i);
Log.e("", "整理" + i);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = vHeight;
params.topMargin = contexts.getResources().getDimensionPixelOffset(R.dimen.live_top);
@ -410,7 +436,6 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} else {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams();
params.height = vHeight;
// params.height = mContext.getResources().getDimensionPixelOffset(R.dimen.live_view);
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
params.addRule(RelativeLayout.ALIGN_TOP);
mVideoView.requestLayout();

View File

@ -15,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.drawerlayout.widget.DrawerLayout;
@ -52,6 +53,7 @@ import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.RandomUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
@ -87,7 +89,6 @@ import com.yunbao.live.socket.SocketRyChatUtil;
import com.yunbao.live.socket.SocketRyClient;
import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.utils.LiveImDeletUtil;
import com.yunbao.common.utils.MicStatusManager;
import org.greenrobot.eventbus.EventBus;
@ -256,8 +257,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
}
//直播间背景
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
//ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack);
@ -295,7 +296,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
@Override
public void onSuccess(EnterRoomNewModel data) {
// mLivePlayViewHolder.setLiveBeanLandscape(data.getLiveInfo().getLandscape());
isEnterRoom = true;
//加入房间发送Im消息
LiveNetManager.get(mContext).userJoinRoomNew(mLiveBean.getStream(), mLiveBean.getUid());
@ -363,7 +364,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
.setLiveBg(liveBg)));
//数据设置
if (mLiveRoomViewHolder != null) {
LivePlayKsyViewHolder.setLandscape(Integer.parseInt(data.getEnterRoomInfo().getLandscape()));
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), Integer.parseInt(data.getEnterRoomInfo().getUserlistTime()) * 4000);
mLiveRoomViewHolder.setFastMessage(greetings);
mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal());
@ -427,7 +427,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
if (data.getEnterRoomInfo().getIsattention() != null && data.getEnterRoomInfo().getIsattention().equals("1")) {
if (data.getEnterRoomInfo().getIsconnection() != null && data.getEnterRoomInfo().getIsconnection().equals("1")) {
LivePlayRyViewHolder.setViewUP(1);
@ -451,7 +451,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//pk排名数据
LivePKUserListBean livePKUserListBean = JSON.parseObject(pkInfo.getString("pk_top_users"), LivePKUserListBean.class);
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
}else{
} else {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.initPkRank(null);
}
@ -1655,4 +1655,5 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void setSecondPageEnableScroll(boolean enableScroll) {
mViewPager.setCanScroll(enableScroll);
}
}