feat : 补全 vip功能设置接口 及 相关功能

This commit is contained in:
eggmanQQQ
2024-10-22 15:35:30 +08:00
parent e725a918e2
commit 71ce6ee37e
5 changed files with 32 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import com.hjq.toast.ToastUtils;
import com.netease.nim.uikit.business.uinfo.UserInfoHelper;
import com.netease.nim.uikit.common.util.log.LogUtil;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
@@ -262,6 +263,11 @@ public class ButtonItemFactory {
@Override
public void onClick() {
if (VipHelper.notKick(userInfo)) {
ToastUtils.show(R.string.vipPower);
return;
}
String tips = (AvRoomDataManager.get().isGamePlaying(Long.parseLong(account)) ? ResUtil.getString(R.string.erban_avroom_buttonitemfactory_07) : "") + ResUtil.getString(R.string.erban_avroom_buttonitemfactory_08);
if (VipHelper.notKick(userInfo)) {
if (AvRoomDataManager.get().isRoomOwner()) {
@@ -350,6 +356,10 @@ public class ButtonItemFactory {
final String account,
String nick) {
return new ViewItem(ResUtil.getString(R.string.erban_avroom_buttonitemfactory_015), R.drawable.icon_dialog_mark_black_list, () -> {
if (VipHelper.notKick(userInfo)) {
ToastUtils.show(R.string.vipPower);
return;
}
int roomBlackListSize = 200;
InitInfo initInfo = InitialModel.get().getCacheInitInfo();
if (initInfo != null && initInfo.getRoomBlackListSize() != 0) {
@@ -446,9 +456,6 @@ public class ButtonItemFactory {
public void onOk() {
NimFriendModel.get().addToBlackList(account)
.subscribe((aBoolean, throwable) -> {
// Toast.makeText(BasicConfig.INSTANCE.getAppContext(),
// (throwable == null) ? ResUtil.getString(R.string.erban_avroom_buttonitemfactory_032) : ResUtil.getString(R.string.erban_avroom_buttonitemfactory_033),
// Toast.LENGTH_SHORT).show();
SingleToastUtil.showToastShort((throwable == null) ? ResUtil.getString(R.string.erban_avroom_buttonitemfactory_034) : ResUtil.getString(R.string.erban_avroom_buttonitemfactory_035));
});
}

View File

@@ -69,10 +69,10 @@ class VipSetActivity : BaseViewBindingActivity<VipSetActivityBinding>(), ILog, V
.compose(bindToLifecycle())
.doOnSuccess {
it.userVipInfoVO?.let { vInfo->
setSwitchView(binding.vipSetSwitch1,vInfo.enterHide)
setSwitchView(binding.vipSetSwitch2,vInfo.enterHide)
setSwitchView(binding.vipSetSwitch3,vInfo.enterHide)
setSwitchView(binding.vipSetSwitch4,vInfo.enterHide)
setSwitchView(binding.vipSetSwitch1,vInfo.enterHide)//不被关注
setSwitchView(binding.vipSetSwitch2,vInfo.enterHide)//防跟随
setSwitchView(binding.vipSetSwitch3,vInfo.enterHide)//开关隐身进房状态
setSwitchView(binding.vipSetSwitch4,vInfo.preventKick)//防踢
}
}
.doOnError {
@@ -137,12 +137,12 @@ class VipSetActivity : BaseViewBindingActivity<VipSetActivityBinding>(), ILog, V
/**
* 不被关注
*/
@GET("/vip/changeInvisibleInRoom")
@GET("/vip/changePreventFollow")
fun notFollowed(@Query("open") open: Boolean): Single<ServiceResult<JsonElement>>
/**
* 防跟随
*/
@GET("/vip/changeInvisibleInRoom")
@GET("/vip/changePreventTrace")
fun notTrace(@Query("open") open: Boolean): Single<ServiceResult<JsonElement>>
/**
* 开关隐身进房状态
@@ -152,7 +152,7 @@ class VipSetActivity : BaseViewBindingActivity<VipSetActivityBinding>(), ILog, V
/**
* 防踢
*/
@GET("/vip/changeInvisibleInRoom")
@GET("/vip/changePreventKick")
fun notKick(@Query("open") open: Boolean): Single<ServiceResult<JsonElement>>
}

View File

@@ -42,6 +42,7 @@ import com.chwl.library.download.FileDownloadListener;
import com.chwl.library.utils.PathHelper;
import com.chwl.library.widget.SVGAView;
import com.google.android.flexbox.FlexboxLayout;
import com.hjq.toast.ToastUtils;
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomKickOutEvent;
@@ -1415,6 +1416,12 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
return new ViewItem(getString(R.string.ui_widget_userinfodialog_029), R.drawable.user_card_ic_down_mic_listen, true, new ViewItem.OnClickListener() {
@Override
public void onClick() {
if (userInfo != null && userInfo.getUserVipInfoVO() != null && userInfo.getUserVipInfoVO().getPreventKick()) {
ToastUtils.show(R.string.vipPower);
return;
}
if (SuperAdminUtil.isSuperAdmin()) {
mSuperAdminModel.roomOperate(SuperAdminModel.TAKE_OUT_MIC, uid).subscribe();
kickDownMicCode();

View File

@@ -5390,10 +5390,12 @@ You cannot join again within 24 hours after leaving</string>
<string name="vipSetTitle2">vipSetTitle2</string>
<string name="vipSetItemTitle1">vipSetItemTitle1</string>
<string name="vipSetItemTitle2">vipSetItemTitle2</string>
<string name="vipSetItemTitle3">vipSetItemTitle3</string>
<string name="vipSetItemTitle4">vipSetItemTitle4</string>
<string name="vipSetItemTitle1">不被关注</string>
<string name="vipSetItemTitle2">防跟随</string>
<string name="vipSetItemTitle3">开关隐身进房状态</string>
<string name="vipSetItemTitle4">防踢</string>
<string name="vipPower">vip权利</string>

View File

@@ -9,6 +9,8 @@ data class UserVipInfo(
val friendNickColour: String = "",
val preventKick: Boolean = false,
var enterHide: Boolean = false,
val preventTrace: Boolean = false,
var enterFollow: Boolean = false,
val enterRoomEffects: String = "",
var userCardBG: String = ""
) : Serializable