From 5f210af804abf7eff6c4657f65b484c469b53ba2 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 15 Nov 2022 10:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=AD=E5=B0=8F?= =?UTF-8?q?=E7=AA=97=E6=97=B6=E9=83=A8=E5=88=86=E6=9C=BA=E5=9E=8B=E9=97=AA?= =?UTF-8?q?=E9=80=80=E9=97=AE=E9=A2=98=20=E4=BF=AE=E5=A4=8D=E7=83=AD?= =?UTF-8?q?=E5=BA=A6=E5=8A=A0gif=E4=B8=8D=E6=92=AD=E6=94=BE=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E5=A4=8D=E9=80=81=E7=A4=BC=E4=B8=BB?= =?UTF-8?q?=E6=92=AD=E4=BC=9A=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95id=E5=86=B2=E7=AA=81=EF=BC=89=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84PK=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=BB=91=E5=8A=A8=E7=9B=B4=E6=92=AD=E9=97=B4=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=A6=BB=E5=BC=80=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/dialog/HintDialog.java | 14 +++++++++++ .../com/yunbao/common/glide/ImgLoader.java | 1 - .../common/views/weight/LiveFloatView.java | 4 ++++ .../yunbao/live/activity/LiveActivity.java | 4 ++-- .../presenter/LiveRyLinkMicPkPresenter.java | 24 +++++++++++-------- .../yunbao/live/views/LiveRoomViewHolder.java | 2 +- .../live/views/PortraitLiveManager.java | 10 ++++---- live/src/main/res/layout/view_live_room.xml | 2 +- 8 files changed, 41 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/HintDialog.java b/common/src/main/java/com/yunbao/common/dialog/HintDialog.java index a4ec14280..a7bdd8b35 100644 --- a/common/src/main/java/com/yunbao/common/dialog/HintDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/HintDialog.java @@ -7,6 +7,11 @@ import android.view.Window; import android.view.WindowManager; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + import com.yunbao.common.R; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; @@ -77,6 +82,15 @@ public class HintDialog extends AbsDialogFragment { } + @Override + public void show(@NonNull FragmentManager manager, @Nullable String tag) { + try { + super.show(manager, tag); + } catch (Exception e) { + e.printStackTrace(); + } + } + private HintListener listener; public HintDialog setListener(HintListener listener) { diff --git a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java index 3c26b148e..0f951c0cf 100644 --- a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java +++ b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java @@ -72,7 +72,6 @@ public class ImgLoader { .load(url) .thumbnail(thumbnail) - .dontAnimate() .placeholder(imageView.getDrawable()); if (width != -1 && height != -1) { builder = builder.override(width, height); diff --git a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java b/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java index fe5286d6e..88ae20e94 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java +++ b/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java @@ -25,10 +25,14 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.floatingview.FloatingMagnetView; import com.yunbao.common.views.floatingview.MagnetViewListener; +import java.lang.ref.WeakReference; +import java.util.List; + import kotlin.Unit; import kotlin.jvm.functions.Function1; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 22538594a..8e30e6430 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -159,7 +159,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL EventBus.getDefault().register(this); mDialogFragmentSet = new HashSet<>(); //解压 美颜模型 - try { + /*try { CommonAppConfig.VIDEO_TIE_MODEl_PATH = getFilesDir().getAbsolutePath() + "/model";//app安装路径 File model = new File(CommonAppConfig.VIDEO_TIE_MODEl_PATH); if (model.exists() && Objects.requireNonNull(model.listFiles()).length > 0) { @@ -169,7 +169,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL } catch (Exception e) { e.printStackTrace(); Log.i("log", "beauty e=" + e); - } + }*/ } @Override diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 6cb178c5a..8844d6818 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -525,18 +525,22 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { //1. 设置自适应合流布局模式 config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.ADAPTIVE); //2. 合流画布设置 - rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() { - @Override - public void onSuccess() { - Log.e("ry", "混成功" + u.getId()); - } + if(rcrtcLiveInfo!=null) { + rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() { + @Override + public void onSuccess() { + Log.e("ry", "混成功" + u.getId()); + } - @Override - public void onFailed(RTCErrorCode errorCode) { - Log.e("ry", "混失败" + errorCode); + @Override + public void onFailed(RTCErrorCode errorCode) { + Log.e("ry", "混失败" + errorCode); - } - }); + } + }); + }else{ + Log.w("PkDebug", "PK合流失败,rcrtcLiveInfo为空" ); + } } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index f667d1f5b..1b8fb54f7 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1405,7 +1405,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis wishListLayout.setVisibility(View.GONE); } ((Activity) mContext).runOnUiThread(() -> { - wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list); + wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list_vf); for (int i = 0; i < wishlist.size(); i++) { View wish = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); wish.setTag(wishlist.get(i).getId()); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 67b717693..97f534fd2 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -172,6 +172,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe private boolean mCoinNotEnough;//余额不足 private boolean mFirstConnectSocket;//是否是第一次连接成功socket private int liveBg = -1; + private int leave=-1;//是否正在休息 1为休息 0为直播 private LiveImDeletUtil liveImDeletUtil; private List greetings = new ArrayList<>(); private Handler liveHandler = new Handler(); @@ -1069,7 +1070,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mChatLevel = obj.getIntValue("speak_limit"); mDanMuLevel = obj.getIntValue("barrage_limit"); liveBg = obj.getIntValue("live_bg"); - + leave = obj.getInteger("isleave"); if (obj.containsKey("greetings")) { greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class); } @@ -1197,10 +1198,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.startRequestTimeCharge(); } } - - if (TextUtils.equals(obj.getString("isleave"), "1")) { - if (LivePlayKsyViewHolder.leave != null) { - LivePlayKsyViewHolder.leave.setVisibility(View.VISIBLE); + if (leave==1) { + if (LivePlayRyViewHolder.leave != null) { + LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE); } } //判断是否有连麦,要显示连麦窗口 diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 8d27fe65f..cf6805f4f 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -372,7 +372,7 @@ android:src="@mipmap/live_icon_wishlist" />