修改用户端多人PK视频顺序

This commit is contained in:
18401019693 2022-12-09 16:40:42 +08:00
parent 415ed2fc9b
commit afed0c8833
4 changed files with 33 additions and 4 deletions

View File

@ -135,7 +135,13 @@ public class VersionUtil {
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
upd(context,configBean,downloadUrl); context.runOnUiThread(new Runnable() {
@Override
public void run() {
upd(context,configBean,downloadUrl);
}
});
} }
}) })
.build() .build()

View File

@ -1191,6 +1191,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
leaveHandler.removeCallbacks(leaveRunnable); leaveHandler.removeCallbacks(leaveRunnable);
livePushRyViewHolder.timeTitle.setVisibility(View.GONE); livePushRyViewHolder.timeTitle.setVisibility(View.GONE);
livePushRyViewHolder.mPreView.removeView(detailsView1); livePushRyViewHolder.mPreView.removeView(detailsView1);
livePushRyViewHolder.cameraPreview3.setVisibility(View.GONE);
} }
}; };

View File

@ -542,8 +542,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() {

View File

@ -16,8 +16,6 @@ import android.view.View;
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.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.drawerlayout.widget.DrawerLayout; import androidx.drawerlayout.widget.DrawerLayout;
@ -298,6 +296,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mask.setVisibility(View.VISIBLE); mask.setVisibility(View.VISIBLE);
mLivePlayViewHolder.setLiveBean(mLiveBean); mLivePlayViewHolder.setLiveBean(mLiveBean);
mLivePlayViewHolder.removeDetailView();
mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
mLivePlayViewHolder.play(mLiveBean.getPull()); mLivePlayViewHolder.play(mLiveBean.getPull());
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
@ -526,7 +525,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.initPkRank(null); mLiveRoomViewHolder.initPkRank(null);
} }
mLivePlayViewHolder.setViewUP(4); mLivePlayViewHolder.setViewUP(4);
upDataPkScore(pkInfo.getJSONArray("userlist"),pkInfo.getIntValue("drpk_time")); upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
} }
//守护相关 //守护相关
mLiveGuardInfo = new LiveGuardInfo(); mLiveGuardInfo = new LiveGuardInfo();
@ -1745,6 +1744,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
*/ */
public void upDataPkScore(JSONArray pkScores, int time) { public void upDataPkScore(JSONArray pkScores, int time) {
if (mLivePlayViewHolder != null) { 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); mLivePlayViewHolder.upDataPkScore(pkScores, time);
} }