From afed0c8833e7c6357e4f941052ee7f7c93a3c510 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 9 Dec 2022 16:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E5=A4=9A=E4=BA=BAPK=E8=A7=86=E9=A2=91=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/VersionUtil.java | 8 +++++++- .../presenter/LiveRyLinkMicPkPresenter.java | 1 + .../live/views/LivePlayRyViewHolder.java | 10 ++++++++++ .../yunbao/live/views/PortraitLiveManager.java | 18 +++++++++++++++--- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java index 55b441bda..82a13aa94 100644 --- a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java @@ -135,7 +135,13 @@ public class VersionUtil { @Override public void onConfirmClick(Dialog dialog, String content) { - upd(context,configBean,downloadUrl); + context.runOnUiThread(new Runnable() { + @Override + public void run() { + upd(context,configBean,downloadUrl); + } + }); + } }) .build() 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 d18ce963a..1f208a067 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -1191,6 +1191,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { leaveHandler.removeCallbacks(leaveRunnable); livePushRyViewHolder.timeTitle.setVisibility(View.GONE); livePushRyViewHolder.mPreView.removeView(detailsView1); + livePushRyViewHolder.cameraPreview3.setVisibility(View.GONE); } }; diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 7cb13c6ae..70271fc1a 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -542,8 +542,18 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { params.addRule(RelativeLayout.ALIGN_TOP); mVideoView.requestLayout(); } + if (detailsView != null) { + mVideoView.removeView(detailsView); + detailsView = null; + } } + public void removeDetailView(){ + if (detailsView != null) { + mVideoView.removeView(detailsView); + detailsView = null; + } + } @Override public ViewGroup getSmallContainer() { 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 133657767..cf1016722 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -16,8 +16,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.TextView; import androidx.annotation.NonNull; import androidx.drawerlayout.widget.DrawerLayout; @@ -298,6 +296,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mask.setVisibility(View.VISIBLE); mLivePlayViewHolder.setLiveBean(mLiveBean); + mLivePlayViewHolder.removeDetailView(); mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); mLivePlayViewHolder.play(mLiveBean.getPull()); mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { @@ -526,7 +525,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.initPkRank(null); } mLivePlayViewHolder.setViewUP(4); - upDataPkScore(pkInfo.getJSONArray("userlist"),pkInfo.getIntValue("drpk_time")); + upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time")); } //守护相关 mLiveGuardInfo = new LiveGuardInfo(); @@ -1745,6 +1744,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe */ 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); }