新增接受PK邀请时,判断自身PK状态和对方PK状态

This commit is contained in:
Martin 2024-10-23 16:02:12 +08:00
parent 3cdf9d5609
commit a038384f2c
2 changed files with 61 additions and 31 deletions

View File

@ -117,6 +117,25 @@ public abstract class AbsLinkMicPkPresenter {
} }
protected void isPKTmp(UserBean u) { protected void isPKTmp(UserBean u) {
/* if(PKing){
ToastUtil.show(AppManager.getInstance().getMainActivity().getString(R.string.pking_over));
}else{
LiveHttpUtil.livePkCheckLive(u.getId()+"", "", "", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]);
if (obj != null) {
if (obj.getString("ispk").equals("0")) {
isPK(u);
} else {
ToastUtil.show(AppManager.getInstance().getMainActivity().getString(R.string.pking_over));
}
}
}
}
});
}*/
LiveHttpUtil.livePkCheckLive(IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()+"", "", "", new HttpCallback() { LiveHttpUtil.livePkCheckLive(IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo().getId()+"", "", "", new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -124,7 +143,21 @@ public abstract class AbsLinkMicPkPresenter {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
if (obj != null) { if (obj != null) {
if (obj.getString("ispk").equals("0")) { if (obj.getString("ispk").equals("0")) {
isPK(u); LiveHttpUtil.livePkCheckLive(u.getId()+"", "", "", new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]);
if (obj != null) {
if (obj.getString("ispk").equals("0")) {
isPK(u);
} else {
ToastUtil.show(AppManager.getInstance().getMainActivity().getString(R.string.pking_over));
}
}
}
}
});
} else { } else {
ToastUtil.show(AppManager.getInstance().getMainActivity().getString(R.string.pking_over)); ToastUtil.show(AppManager.getInstance().getMainActivity().getString(R.string.pking_over));
} }
@ -132,7 +165,6 @@ public abstract class AbsLinkMicPkPresenter {
} }
} }
}); });
} }
protected void onDRPkApplyTmp(UserBean u) { protected void onDRPkApplyTmp(UserBean u) {

View File

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="#05000000"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
@ -14,7 +15,6 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageView <ImageView
android:id="@+id/rt_setting" android:id="@+id/rt_setting"
android:layout_width="29dp" android:layout_width="29dp"
@ -208,7 +208,7 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="25dp" android:layout_marginTop="15dp"
android:scrollbars="none" android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/rt_setting"> app:layout_constraintTop_toBottomOf="@id/rt_setting">
@ -221,10 +221,10 @@
<com.makeramen.roundedimageview.RoundedImageView <com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="86dp" android:layout_width="72dp"
android:layout_height="86dp" android:layout_height="72dp"
android:layout_marginStart="18dp" android:layout_marginStart="18dp"
android:layout_marginTop="9dp" android:layout_marginTop="8dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -234,8 +234,8 @@
<com.opensource.svgaplayer.SVGAImageView <com.opensource.svgaplayer.SVGAImageView
android:id="@+id/gift_svga" android:id="@+id/gift_svga"
android:layout_width="104dp" android:layout_width="90dp"
android:layout_height="104dp" android:layout_height="90dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="9dp" android:layout_marginStart="9dp"
@ -268,14 +268,12 @@
app:layout_constraintTop_toTopOf="@id/name" app:layout_constraintTop_toTopOf="@id/name"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="17dp" android:layout_height="17dp"
app:layout_constraintBottom_toBottomOf="@id/avatar" app:layout_constraintBottom_toBottomOf="@id/avatar"
app:layout_constraintStart_toStartOf="@id/name" app:layout_constraintStart_toStartOf="@id/name"
android:layout_marginBottom="18dp" android:layout_marginBottom="10dp"
app:cardElevation="0dp" app:cardElevation="0dp"
app:cardBackgroundColor="@color/color_FF8D8D" app:cardBackgroundColor="@color/color_FF8D8D"
app:cardCornerRadius="10dp" app:cardCornerRadius="10dp"
@ -323,26 +321,24 @@
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@drawable/new_me_shape"
app:layout_constraintTop_toBottomOf="@id/avatar" app:layout_constraintTop_toBottomOf="@id/avatar"
android:layout_marginTop="16dp" android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="@id/lt_advertisement" app:layout_constraintBottom_toBottomOf="@id/lt_advertisement"
android:id="@+id/background_tv" android:id="@+id/background_tv"
/> />
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="72dp"
android:background="@drawable/new_me_shape_1" android:background="@drawable/new_me_shape_line"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/background_tv" app:layout_constraintTop_toTopOf="@id/background_tv"
app:layout_constraintEnd_toStartOf="@id/shouhu_center" app:layout_constraintEnd_toStartOf="@id/shouhu_center"
android:id="@+id/guizu_center_tv" android:id="@+id/guizu_center_tv"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_marginTop="15dp" android:layout_marginTop="12dp"
/> />
<ImageView <ImageView
@ -352,7 +348,7 @@
app:layout_constraintTop_toTopOf="@id/guizu_center_tv" app:layout_constraintTop_toTopOf="@id/guizu_center_tv"
app:layout_constraintBottom_toBottomOf="@id/guizu_center_tv" app:layout_constraintBottom_toBottomOf="@id/guizu_center_tv"
app:layout_constraintStart_toStartOf="@id/guizu_center_tv" app:layout_constraintStart_toStartOf="@id/guizu_center_tv"
android:layout_marginStart="14dp" android:layout_marginStart="10dp"
android:id="@+id/user_noble_ico" android:id="@+id/user_noble_ico"
/> />
@ -374,16 +370,17 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/open_noble_text_new" android:text="@string/open_noble_text_new"
android:textColor="#777777" android:textColor="#777777"
android:textSize="10sp" android:textSize="9sp"
app:layout_constraintStart_toEndOf="@id/user_noble_ico" app:layout_constraintStart_toEndOf="@id/user_noble_ico"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:maxLines="2" android:maxLines="2"
android:paddingEnd="6dp"
android:ellipsize="end" android:ellipsize="end"
app:layout_constraintEnd_toEndOf="@id/guizu_center_tv" app:layout_constraintEnd_toEndOf="@id/guizu_center_tv"
app:layout_constraintTop_toBottomOf="@id/user_noble_text" app:layout_constraintTop_toBottomOf="@id/user_noble_text"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="2dp"
/> />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
@ -396,8 +393,8 @@
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="72dp"
android:background="@drawable/new_me_shape_2" android:background="@drawable/new_me_shape_line"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/guizu_center_tv" app:layout_constraintTop_toTopOf="@id/guizu_center_tv"
app:layout_constraintStart_toEndOf="@id/guizu_center_tv" app:layout_constraintStart_toEndOf="@id/guizu_center_tv"
@ -413,7 +410,7 @@
app:layout_constraintTop_toTopOf="@id/shouhu_center" app:layout_constraintTop_toTopOf="@id/shouhu_center"
app:layout_constraintBottom_toBottomOf="@id/shouhu_center" app:layout_constraintBottom_toBottomOf="@id/shouhu_center"
app:layout_constraintStart_toStartOf="@id/shouhu_center" app:layout_constraintStart_toStartOf="@id/shouhu_center"
android:layout_marginStart="14dp" android:layout_marginStart="10dp"
android:id="@+id/shouhu_center_iv" android:id="@+id/shouhu_center_iv"
/> />
@ -432,12 +429,13 @@
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="2dp"
android:text="@string/guard_for_your_beloved_one" android:text="@string/guard_for_your_beloved_one"
android:textColor="#777777" android:textColor="#777777"
android:textSize="10sp" android:textSize="9sp"
app:layout_constraintStart_toEndOf="@id/shouhu_center_iv" app:layout_constraintStart_toEndOf="@id/shouhu_center_iv"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:paddingEnd="6dp"
android:id="@+id/shouhu_center_tv2" android:id="@+id/shouhu_center_tv2"
app:layout_constraintEnd_toEndOf="@id/shouhu_center" app:layout_constraintEnd_toEndOf="@id/shouhu_center"
app:layout_constraintTop_toBottomOf="@id/shouhu_center_tv" app:layout_constraintTop_toBottomOf="@id/shouhu_center_tv"
@ -445,17 +443,17 @@
android:ellipsize="end" android:ellipsize="end"
/> />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="14dp" android:layout_marginTop="12dp"
app:layout_constraintTop_toBottomOf="@id/lt_advertisement" app:layout_constraintTop_toBottomOf="@id/lt_advertisement"
android:focusable="false" android:focusable="false"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
android:overScrollMode="never" android:overScrollMode="never"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="@drawable/new_me_shape_line" android:background="@drawable/new_me_shape_line"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
@ -464,9 +462,9 @@
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/lt_advertisement" android:id="@+id/lt_advertisement"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="110dp" android:layout_height="80dp"
app:layout_constraintTop_toBottomOf="@id/guizu_center_tv" app:layout_constraintTop_toBottomOf="@id/guizu_center_tv"
android:layout_marginTop="14dp" android:layout_marginTop="12dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
app:cardBackgroundColor="@color/transparent" app:cardBackgroundColor="@color/transparent"