From 6c33ac15f81c07ba9ab4794a2c7336cc9e5aba98 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 13 Dec 2022 10:28:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=B8=BB=E6=92=AD?= =?UTF-8?q?=E5=BC=80=E6=92=AD=E8=BF=94=E5=9B=9E=E4=B8=8D=E4=BC=9A=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E7=A1=AE=E8=AE=A4=E6=A1=86=20fix=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=BB=E6=92=AD=E7=82=B9=E7=A6=BB=E5=BC=80=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E4=B8=BB=E6=92=AD=E7=AB=AF=E6=B2=A1=E6=9C=89=E7=A6=BB?= =?UTF-8?q?=E5=BC=80=E9=81=AE=E7=BD=A9=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/manager/RandomPkManager.java | 5 +---- .../com/yunbao/live/activity/LiveRyAnchorActivity.java | 10 +++++++--- live/src/main/res/layout/activity_live_anchor.xml | 8 ++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java index e8d6092cd..a48203591 100644 --- a/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/RandomPkManager.java @@ -38,7 +38,6 @@ public class RandomPkManager { public static String debugUid; private RankPkInfoBean rankPkInfoBean;//排位赛信息 Handler handler = new Handler(Looper.getMainLooper()); - private boolean exitSuccess = false; private RandomPkManager() { getRankInfo(); @@ -130,8 +129,7 @@ public class RandomPkManager { } private void next() { - if (exitSuccess) { - exitSuccess = false; + if (task==null) { return; } status = PK_STATUS_REQUEST; @@ -239,7 +237,6 @@ public class RandomPkManager { */ private void callEndPkSuccess() { status = PK_STATUS_DEFAULT; - exitSuccess = true; rankPkInfoBean = null; for (OnRandomPkTimer pkTimer : randomPkTimer) { pkTimer.onPkEndSuccess(); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 7082aacc3..1fe19cb63 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -22,6 +22,7 @@ import android.util.Log; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.LinearLayout; import androidx.annotation.NonNull; @@ -152,6 +153,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl public static int pk_nub; public static int backIndex = 0;//0=未判断,1=已判断 private FaceManager manager; + private ImageView leave_img; private final RandomPkManager.OnRandomPkTimer onRandomPkTimer = new RandomPkManager.OnRandomPkTimer() { @Override public void onTimer(String time) { @@ -197,6 +199,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl Bus.getOn(this); Intent intent = getIntent(); initFaceManager(); + leave_img = findViewById(R.id.leave_img); mLiveSDK = intent.getIntExtra(Constants.LIVE_SDK, Constants.LIVE_SDK_KSY); mLiveKsyConfigBean = intent.getParcelableExtra(Constants.LIVE_KSY_CONFIG); L.e(TAG, "直播sdk----->" + (mLiveSDK == Constants.LIVE_SDK_KSY ? "金山云" : "腾讯云")); @@ -446,6 +449,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl RCRTCRect rect = new RCRTCRect(0f, 0f, 1.0f); if (leave == 0) { leave = 1; + leave_img.setVisibility(View.VISIBLE); Glide.with(mContext).asBitmap().load(R.mipmap.zslk).into(new CustomTarget() { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { @@ -461,6 +465,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl }); } else if (leave == 1) { leave = 0; + leave_img.setVisibility(View.GONE); // 清除水印 boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(null, rect); sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back)); @@ -608,9 +613,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl bundle.putBoolean("isDRPK", isDRPK); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveLinkMicListDialogFragment");*/ - FreePkDialogFragment fragment=new FreePkDialogFragment(); + FreePkDialogFragment fragment = new FreePkDialogFragment(); fragment.setDrPkNum(pk_nub); - fragment.show(getSupportFragmentManager(),"LiveLinkMicListDialogFragment"); + fragment.show(getSupportFragmentManager(), "LiveLinkMicListDialogFragment"); } @@ -938,7 +943,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { isKeyBack = true; - finish(); } return super.onKeyUp(keyCode, event); } diff --git a/live/src/main/res/layout/activity_live_anchor.xml b/live/src/main/res/layout/activity_live_anchor.xml index 9d6bf5af3..9af2c68cc 100644 --- a/live/src/main/res/layout/activity_live_anchor.xml +++ b/live/src/main/res/layout/activity_live_anchor.xml @@ -47,4 +47,12 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + \ No newline at end of file