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