feat:完成房间功能弹窗入口改动(部分功能入口移植到房间设置中)
This commit is contained in:
@@ -8,11 +8,17 @@ import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.chwl.app.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.chwl.core.super_admin.util.SuperAdminUtil;
|
||||
import com.chwl.core.utils.net.DontWarnObserver;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
@@ -112,6 +118,7 @@ public class RoomSettingActivity extends BaseMvpActivity<IRoomSettingView, RoomS
|
||||
}
|
||||
initView();
|
||||
initLeaveMode();
|
||||
loadGiftValueState();
|
||||
getMvpPresenter().requestRoomInfo(roomInfo.getUid());
|
||||
mRoomBgLayout.setVisibility(View.GONE);
|
||||
if (!AvRoomDataManager.get().isRoomOwner() && !AvRoomDataManager.get().isSuperAdmin()) {
|
||||
@@ -190,6 +197,28 @@ public class RoomSettingActivity extends BaseMvpActivity<IRoomSettingView, RoomS
|
||||
}
|
||||
}
|
||||
|
||||
private void loadGiftValueState(){
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
binding.layoutGiftValue.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
binding.layoutGiftValue.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (!AvRoomDataManager.get().isManager()) {
|
||||
binding.layoutGiftValue.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
binding.layoutGiftValue.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
boolean openGiftValue = AvRoomDataManager.get().isShowGiftValue();
|
||||
binding.layoutGiftValue.setVisibility(View.VISIBLE);
|
||||
setSelected(binding.switchGiftValue, openGiftValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改房间设置的消息
|
||||
*/
|
||||
@@ -516,10 +545,59 @@ public class RoomSettingActivity extends BaseMvpActivity<IRoomSettingView, RoomS
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.switch_gift_value:
|
||||
switchGiftValue();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
private void switchGiftValue(){
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast(ResUtil.getString(R.string.avroom_dialog_roomoperationdialog_029));
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
SingleToastUtil.showToast(R.string.before_open_gift_value_should_close_ktv_model);
|
||||
return;
|
||||
}
|
||||
//开启礼物值不需要弹框
|
||||
if (!AvRoomDataManager.get().isShowGiftValue()) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
if (!GiftValueDialogUiHelper.get().isNeedConfirmDialog(
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE)) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
GiftValueDialogUiHelper.get().showGiftValueDialog(context, getDialogManager(),
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE,
|
||||
this::handleOpenGiftValue);
|
||||
}
|
||||
|
||||
private void handleOpenGiftValue() {
|
||||
boolean isOpen = !binding.switchGiftValue.isSelected();
|
||||
getDialogManager().showProgressDialog(this);
|
||||
GiftValueModel.get().openGiftValue(isOpen)
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.subscribe(new DontWarnObserver<String>() {
|
||||
@Override
|
||||
public void accept(String s, String error) {
|
||||
super.accept(s, error);
|
||||
getDialogManager().dismissDialog();
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error);
|
||||
} else {
|
||||
setSelected(binding.switchGiftValue, !binding.switchGiftValue.isSelected());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResultRequestTagAllSuccess(List<RoomSettingTabInfo> tabInfoList) {
|
||||
this.tabInfoList = tabInfoList;
|
||||
@@ -806,4 +884,10 @@ public class RoomSettingActivity extends BaseMvpActivity<IRoomSettingView, RoomS
|
||||
StatusBarUtil.transparencyBar(this);
|
||||
StatusBarUtil.StatusBarLightMode(this);
|
||||
}
|
||||
|
||||
private void setSelected(ImageView imageView, boolean isSelected) {
|
||||
imageView.setSelected(isSelected);
|
||||
imageView.setImageResource(isSelected ?
|
||||
R.drawable.icon_room_set_lock_true : R.drawable.icon_room_set_lock_false);
|
||||
}
|
||||
}
|
||||
|
@@ -124,11 +124,11 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
addRedPacketAction(optAdapter);
|
||||
addRoomSettingAction(optAdapter);
|
||||
addGiftEffectAction(optAdapter);
|
||||
addOpenOrClosePublicScreenAction(optAdapter);
|
||||
// addOpenOrClosePublicScreenAction(optAdapter);
|
||||
// addRedPackageSwitch();
|
||||
addCleanScreenAction(optAdapter);
|
||||
// addRoomLimit(optAdapter);
|
||||
addGiftValueAction(optAdapter);
|
||||
// addGiftValueAction(optAdapter);
|
||||
addSuperAdminAction(optAdapter);
|
||||
addShieldReportAction(optAdapter);
|
||||
rvOPtList.setAdapter(optAdapter);
|
||||
|
@@ -42,7 +42,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_01"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -82,7 +82,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_03"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -102,7 +102,7 @@
|
||||
android:id="@+id/pwd_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_toEndOf="@id/pwd_text"
|
||||
android:background="@null"
|
||||
android:hint="@string/layout_activity_room_setting_04"
|
||||
@@ -161,7 +161,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_05"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -202,7 +202,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_07"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -240,7 +240,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_09"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -250,7 +250,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_010"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -281,7 +281,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -293,6 +293,7 @@
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<RelativeLayout
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/room_bg_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
@@ -302,7 +303,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/room_bg_text"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@@ -312,7 +313,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -336,7 +337,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@drawable/arrow_right" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -350,7 +351,7 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/gift_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp">
|
||||
android:layout_height="@dimen/dp_45">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -363,11 +364,11 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_gift"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_set_lock_false" />
|
||||
</RelativeLayout>
|
||||
@@ -388,18 +389,18 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/layout_activity_room_setting_013"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_screen"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_set_lock_false" />
|
||||
</RelativeLayout>
|
||||
@@ -412,6 +413,7 @@
|
||||
android:background="@color/line_353548" />
|
||||
|
||||
<RelativeLayout
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/queuing_micro_mode_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
@@ -428,16 +430,17 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_queuing_micro_mode"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_set_lock_false" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
tools:visibility="visible"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
@@ -450,6 +453,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/dp_45"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
@@ -497,6 +501,7 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/leave_mode_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -567,6 +572,40 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_secondary_2a2a39" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_gift_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_45">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="@string/gift_value"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_gift_value"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_set_lock_false" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:background="@color/line_353548" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
@@ -5278,4 +5278,6 @@
|
||||
<string name="fans_team_6">فتح نادي المعجبين</string>
|
||||
<string name="fans_team_8">Lv.%s القيمة الحميمية</string>
|
||||
<string name="fans_team_9">نجح في ترك نادي المعجبين</string>
|
||||
|
||||
<string name="gift_value">قيمة الهدايا</string>
|
||||
</resources>
|
@@ -5222,4 +5222,6 @@
|
||||
<string name="fans_team_6">開通粉絲團</string>
|
||||
<string name="fans_team_8">親密值Lv.%s</string>
|
||||
<string name="fans_team_9">退出粉絲團成功!</string>
|
||||
|
||||
<string name="gift_value">禮物值</string>
|
||||
</resources>
|
@@ -5260,6 +5260,8 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="fans_team_6">Open fan club</string>
|
||||
<string name="fans_team_8">intimacy Lv.%s</string>
|
||||
<string name="fans_team_9">Successfully exited the fan club!</string>
|
||||
|
||||
<string name="gift_value">Gift Value</string>
|
||||
</resources>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user