feat : bug修复, 幸运礼物 数字改为 自动化大小

This commit is contained in:
eggmanQQQ
2024-12-27 17:56:54 +08:00
parent 2f9263f3c9
commit c90f3b648f
13 changed files with 117 additions and 76 deletions

View File

@@ -259,7 +259,7 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
R.string.roomLevelErrorTips.doToast()
} else {
if ((typeId != -1 && typeId != mCurrentMicType) || (effectId != -1 && effectId != mCurrentMicEffects) || (skinsId != -1 && skinsId != mCurrentMicSkins)) {
if ((typeId != -1 && typeId != mCurrentMicType) || (effectId != mCurrentMicEffects) || (skinsId != mCurrentMicSkins)) {
dialogManager.showOkCancelDialog(
ResUtil.getString(R.string.switch_room_type_tips),
ResUtil.getString(R.string.login_fragment_adduserinfofragment_04)
@@ -269,26 +269,28 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
mTypeSet = false
dialogManager.showProgressDialog(context)
val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
mCurrentRoomInfo?.type = typeId
mCurrentRoomInfo?.usedMicSkinId = skinsId
mCurrentRoomInfo?.usedMicEffectId = effectId
val newRoomInfo = RoomInfo()
newRoomInfo.uid = AvRoomDataManager.get().roomUid
newRoomInfo.type = typeId
newRoomInfo.usedMicSkinId = skinsId
newRoomInfo.usedMicEffectId = effectId
if (mCurrentRoomInfo != null) {
OpenRoomHelper.updateRoomInfoEx(mCurrentRoomInfo)
.compose(bindToLifecycle())
.doOnSuccess {
mTypeSet = true
dialogManager.dismissDialog()
val mCurrentRoomInfo1 = AvRoomDataManager.get().mCurrentRoomInfo
finish()
}
.doOnError {
SingleToastUtil.showToast(it.message)
dialogManager.dismissDialog()
}
.subscribe()
}
OpenRoomHelper.updateRoomInfoEx(newRoomInfo)
.compose(bindToLifecycle())
.doOnSuccess {
mTypeSet = true
dialogManager.dismissDialog()
// val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
// mCurrentRoomInfo?.type = typeId
// mCurrentRoomInfo?.usedMicSkinId = skinsId
// mCurrentRoomInfo?.usedMicEffectId = effectId
finish()
}
.doOnError {
SingleToastUtil.showToast(it.message)
dialogManager.dismissDialog()
}
.subscribe()
}
}
} else {

View File

@@ -73,9 +73,10 @@ public class UpMicAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
ImageView imageView = helper.getView(R.id.iv_mic);
//todo do 19麦房间时 老板麦位特殊特殊图标 待更换
//麦上没人,且不是离开模式房主位,相亲模式的管理才能上房主位
if (roomQueueInfo.mChatRoomMember == null &&
(!AvRoomDataManager.get().isLeaveMode() || position != 0) &&
(!AvRoomDataManager.get().isDatingMode() || AvRoomDataManager.get().isManager(String.valueOf(upUid)) || position != 0)) {
if (roomQueueInfo.mChatRoomMember == null
&& (!AvRoomDataManager.get().isLeaveMode() || position != 0)
&& (!AvRoomDataManager.get().isDatingMode() || AvRoomDataManager.get().isManager(String.valueOf(upUid)) || position != 0)) {
imageView.setImageResource(position == 0 ? R.drawable.icon_up_mic_ture : R.drawable.icon_up_mic_ture);
helper.itemView.setClickable(true);
helper.itemView.setOnClickListener(v -> Single.just(position).subscribe(consumer));

View File

@@ -9,12 +9,12 @@ import com.chwl.app.common.widget.dialog.DialogManager
import com.chwl.app.common.widget.dialog.DialogManager.OkCancelDialogListener
import com.chwl.app.databinding.RoomNotifyLuckGiftDlgBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.app.utils.NumberUtils
import com.chwl.core.gift.bean.LuckyGiftMsgAllBean
import com.chwl.core.manager.AvRoomDataManager
import com.chwl.library.common.util.setAutoSizeModel
import com.chwl.library.common.util.setRL
import com.chwl.library.common.util.setString
import com.chwl.library.utils.ResUtil
import com.example.lib_utils.UiUtils
/**
* @Author Vance
@@ -37,8 +37,10 @@ class RoomNotifyLuckGiftDialog(private val context: Context) : BaseRoomNotifyDia
mBinding.giftName.text = luckyGiftMsgBean?.giftNameMap?.getFirstText()
mBinding.winNum.text = luckyGiftMsgBean?.times.toString()
val coinNum = NumberUtils.format(luckyGiftMsgBean?.coins?:0)
mBinding.coinNum.text = coinNum
// val coinNum = NumberUtils.format(luckyGiftMsgBean?.coins?:0)
val coinNum = luckyGiftMsgBean?.coins?:0
mBinding.coinNum.setString(coinNum.toString())
mBinding.coinNum.setAutoSizeModel()
mBinding.clickArea.setOnClickListener {
val activity = GlobalHandleManager.get().activity ?: return@setOnClickListener

View File

@@ -37,7 +37,6 @@ import com.chwl.app.ui.widget.BonsellaJoinAttackButtonView;
import com.chwl.app.ui.widget.GiftDialog;
import com.chwl.app.ui.widget.UserInfoDialog;
import com.chwl.app.utils.GiftAnimUtil;
import com.chwl.app.utils.NumberUtils;
import com.chwl.app.utils.RegexUtil;
import com.chwl.app.utils.RoomBoomManager;
import com.chwl.app.utils.RoomNotifyDialogManager;
@@ -789,7 +788,8 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
return LayoutInflater.from(gameMainBinding.flLuckyGiftNotifyLayout.getContext()).inflate(R.layout.layout_room_notify_lucky_gift_tip, gameMainBinding.flLuckyGiftNotifyLayout, false);
});
LayoutRoomNotifyLuckyGiftTipBinding binding = LayoutRoomNotifyLuckyGiftTipBinding.bind(root);
binding.coinNum.setText(NumberUtils.format(luckyGiftMsgBean.getCoins()));
binding.coinNum.setText(String.valueOf(luckyGiftMsgBean.getCoins()));
OtherExtKt.setAutoSizeModel(binding.coinNum);
binding.winNum.setText(java.lang.String.valueOf(luckyGiftMsgBean.getTimes()));
if (luckyGiftMsgBean.getLevel() > 1) {
binding.rootView.setBackgroundResource(R.drawable.bg_lucky_gift_tip_2);

View File

@@ -128,7 +128,7 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
showSplash(false);
}
}
//todo 展示闪屏
private void showSplash(boolean first) {
if (!TextUtils.isEmpty(DeviceUtil.getAndroidID())) {
@@ -139,14 +139,15 @@ public class SplashActivity extends AppCompatActivity implements View.OnClickLis
mBinding.tvSkip.setVisibility(View.VISIBLE);
// 不过期的,并且已经下载出来图片的闪屏页数据
mLocalSplashVo = InitialModel.get().getLocalSplashVo();
if (mLocalSplashVo != null &&
!TextUtils.isEmpty(mLocalSplashVo.getPict())) {
if (mLocalSplashVo != null && !TextUtils.isEmpty(mLocalSplashVo.getPict())) {
animation();
GlideApp.with(this)
.load(mLocalSplashVo.getPict())
//添加图片处理机制
.apply(RequestOptions.bitmapTransform(new SplashBitmapTransformation()))
.into(mBinding.ivActivity);
if (mLocalSplashVo.getType() != 0 && !TextUtils.isEmpty(mLocalSplashVo.getLink())) {
mBinding.tvJump.setVisibility(View.VISIBLE);
}

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
@@ -12,10 +13,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/fl_init_flutter"
android:layout_width="1px"
android:layout_height="1px"/>
<ImageView
android:id="@+id/iv_activity"
@@ -34,6 +31,7 @@
android:background="@drawable/selector_bg_splash_skip"
android:gravity="center"
android:onClick="@{click}"
tools:visibility="visible"
android:text="@string/text_skip"
android:textColor="@color/white"
android:textSize="13dp"
@@ -51,6 +49,7 @@
android:text="@string/layout_activity_splash_01"
android:textColor="@color/base_selector_color_theme_btn"
android:textSize="18dp"
android:visibility="gone" />
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
</layout>

View File

@@ -19,21 +19,23 @@
android:textColor="#ffffe375"
android:textSize="16sp" />
<TextView
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/coinNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/dp_6"
android:drawablePadding="3dp"
android:layout_marginTop="@dimen/dp_4"
android:shadowColor="#ffa40e00"
android:shadowDx="0"
android:lines="1"
android:shadowDy="1"
android:gravity="center"
android:shadowRadius="3.0"
android:textColor="#ffffe375"
android:textSize="26sp"
android:textStyle="bold"
app:drawableStartCompat="@drawable/ic_coin_63"
tools:text="666.52K" />
tools:text="6660000" />
<LinearLayout
android:layout_width="wrap_content"

View File

@@ -27,8 +27,8 @@
app:layout_constraintTop_toTopOf="@+id/bg"
android:src="@drawable/all_service_gift_bg_luck_2"
app:layout_constraintBottom_toBottomOf="@+id/bg"
android:layout_width="@dimen/dp_82"
android:layout_height="@dimen/dp_82"/>
android:layout_width="@dimen/dp_92"
android:layout_height="@dimen/dp_92"/>
<com.chwl.app.common.widget.CircleImageView
@@ -120,9 +120,11 @@
<TextView
android:id="@+id/coinNum"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:minWidth="@dimen/dp_45"
android:layout_marginHorizontal="@dimen/dp_11"
android:lines="1"
android:includeFontPadding="false"
android:shadowColor="#ffa40e00"
android:layout_marginTop="@dimen/dp_3"
@@ -131,14 +133,14 @@
android:shadowDy="1"
android:shadowRadius="3.0"
android:textColor="#ffffe375"
android:textSize="20sp"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/bg2"
app:layout_constraintEnd_toEndOf="@+id/bg2"
app:layout_constraintTop_toTopOf="@+id/bg2"
app:layout_constraintBottom_toTopOf="@id/coins"
app:layout_constraintVertical_chainStyle="packed"
tools:text="1000k" />
tools:text="1111111" />
<TextView
android:id="@+id/coins"
@@ -161,7 +163,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintStart_toStartOf="@id/bg"
tools:visibility="visible"
tools:visibility="gone"
app:layout_constraintEnd_toEndOf="@id/bg"
app:layout_constraintWidth_max="375dp"
app:layout_constraintBottom_toBottomOf="@id/avatar"

View File

@@ -2509,9 +2509,9 @@ public final class IMNetEaseManager {
*/
public void markManagerListBySdk(String roomId, final String account, final boolean mark, final CallBack<ChatRoomMember> callBack) {
OtherExtKt.doLog("开始设置管理员 - 请求接口");
AvRoomModel.get().getCheckManagerNum(AvRoomDataManager.get().getRoomUid())
AvRoomModel.get().getCheckManagerNum(AvRoomDataManager.get().getRoomUid(),mark)
.doOnSuccess(s -> {
OtherExtKt.doLog("开始设置管理员 - 请求接口 - 成功");
OtherExtKt.doLog("开始设置管理员 - 请求接口 - 成功 str = "+s);
NIMClient.getService(ChatRoomService.class)
.markChatRoomManager(mark, new MemberOption(roomId, account))
.setCallback(new RequestCallback<ChatRoomMember>() {

View File

@@ -860,10 +860,16 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
.compose(RxHelper.handleIgnoreData())
.compose(RxHelper.handleSchedulers());
}
public Single<String> getCheckManagerNum(long roomUid) {
return mRoomService.getCheckManagerNum(roomUid)
.compose(RxHelper.handleIgnoreData())
.compose(RxHelper.handleSchedulers());
public Single<String> getCheckManagerNum(long roomUid,boolean isMark) {
if (!isMark) {
return Single.just("取消管理员 不用请求");
} else {
return mRoomService.getCheckManagerNum(roomUid)
.compose(RxHelper.handleIgnoreData())
.compose(RxHelper.handleSchedulers());
}
}
public interface Api {
@@ -1308,8 +1314,9 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
//是否还能设置房间管理员
@GET("/room/checkManagerNum")
Single<ServiceResult<JsonElement>> getCheckManagerNum(@Query("roomUid") long roomUid);
@FormUrlEncoded
@POST("/room/checkManageNum")
Single<ServiceResult<JsonElement>> getCheckManagerNum(@Field("roomUid") long roomUid);
}

View File

@@ -139,21 +139,24 @@ public class RoomSettingModel extends BaseMvpModel {
});
}
public Single<RoomInfo> updateRoomInfoEx(RoomInfo roomInfo) {
return mRoomSettingService.updateRoomInfoEx(roomInfo.getType(), roomInfo.getUsedMicSkinId(), roomInfo.getUsedMicEffectId(),
roomInfo.getRoomId(),
return mRoomSettingService.updateRoomInfoEx(
roomInfo.getType(),
roomInfo.getUsedMicSkinId(),
roomInfo.getUsedMicEffectId(),
roomInfo.getRoomId(),
null,
roomInfo.getTitle(),
roomInfo.getAvatar(),
roomInfo.getRoomDesc(),
roomInfo.getIntroduction(),
roomInfo.roomPwd,
roomInfo.getRoomTag(),
roomInfo.tagId,
AuthModel.get().getCurrentUid(),
roomInfo.isHasAnimationEffect(),
roomInfo.getAudioQuality(),
roomInfo.getLimitType(),
roomInfo.isPureMode()
null,
null,
null,
null,
null,
null,
null,
roomInfo.getUid(),
null,
null,
null,
null
)
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
@@ -333,9 +336,9 @@ public class RoomSettingModel extends BaseMvpModel {
@Field("singleRoomSortId") Long singleRoomSortId);
@FormUrlEncoded
@POST("room/update")
Single<ServiceResult<RoomInfo>> updateRoomInfoEx(@Field("type") int type,
@Field("usedMicSkinId") int usedMicSkinId,
@Field("usedMicEffectId") int usedMicEffectId,
Single<ServiceResult<RoomInfo>> updateRoomInfoEx(@Field("type") Integer type,
@Field("usedMicSkinId") Integer usedMicSkinId,
@Field("usedMicEffectId") Integer usedMicEffectId,
@Field("mgId") Long gameId,
@Field("singleRoomSortId") Long singleRoomSortId,

View File

@@ -13,6 +13,7 @@ import androidx.core.text.TextUtilsCompat
import androidx.core.text.clearSpans
import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
import androidx.core.widget.TextViewCompat
import com.chwl.library.BuildConfig
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.SizeUtils
@@ -101,6 +102,17 @@ fun TextView.setString(strId:Int,vararg vars: Any) {
fun TextView.setString(strId:Int) {
this.text = ResUtil.getString(strId)
}
fun TextView.setString(str:String) {
this.text = str
}
fun TextView.setAutoSizeModel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
} else {
TextViewCompat.setAutoSizeTextTypeWithDefaults(this,TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM)
}
}
fun String?.isVerify() : Boolean {

View File

@@ -2,7 +2,13 @@
"code": 200,
"message": "success",
"data": {
"roomMicDressList": [
"roomVal": 276525.5,
"currentLevelIcon": "https://image.pekolive.com/7room_lv.png",
"currentLevel": 7,
"currentLevelExp": 265781,
"nextLevel": 8,
"nextLevelExp": 398672,
"micEffects": [
{
"id": 4,
"dressType": 2,
@@ -29,7 +35,9 @@
"normalMicLockUrl": "",
"bossMicUrl": "",
"bossMicLockUrl": ""
},
}
],
"micSkins": [
{
"id": 1,
"dressType": 1,
@@ -57,7 +65,9 @@
"bossMicUrl": "https://image.pekolive.com/60levelmic_mic_boss.png",
"bossMicLockUrl": "https://image.pekolive.com/60levelmic_lockmic_boss.png"
}
]
],
"managerLimitNum": 5,
"currentManagerNum": 0
},
"timestamp": 1735280964981
"timestamp": 1735288296705
}