feat : 麦位皮肤 提交
This commit is contained in:
@@ -64,6 +64,7 @@ import com.chwl.app.ui.widget.MainTabLayout;
|
||||
import com.chwl.app.utils.CleanLeakUtils;
|
||||
import com.chwl.app.utils.HomeUIManager;
|
||||
import com.chwl.app.utils.PushMessageHandler;
|
||||
import com.chwl.app.utils.ResourceManager;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.DemoCache;
|
||||
import com.chwl.core.UriProvider;
|
||||
@@ -270,6 +271,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
WLog.INSTANCE.init(context,"logFile.txt");
|
||||
|
||||
HomeUIManager.INSTANCE.setHomeTabBg(findViewById(R.id.main_tab_layout_bg));
|
||||
ResourceManager.INSTANCE.initResource();
|
||||
}
|
||||
|
||||
private void otherModelInit() {
|
||||
|
@@ -5,7 +5,6 @@ import android.content.Intent
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.dialog.RoomBgSetDialog.Api
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.bindadapter.BaseBindingViewHolder
|
||||
@@ -13,12 +12,11 @@ import com.chwl.app.databinding.ItemRoomModeBinding
|
||||
import com.chwl.app.databinding.RoomTypeSwitchActivityBinding
|
||||
import com.chwl.app.home.helper.OpenRoomHelper
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.app.ui.utils.loadAvatar
|
||||
import com.chwl.app.ui.utils.loadFromUrl
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.bean.RoomLevelDressBase
|
||||
import com.chwl.core.gift.bean.RoomLevelInfo
|
||||
import com.chwl.core.gift.bean.RoomLevelMicEffects
|
||||
import com.chwl.core.gift.bean.RoomLevelMicSkins
|
||||
import com.chwl.core.gift.bean.RoomLevelMicType
|
||||
import com.chwl.core.gift.bean.RoomMicDress
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.room.bean.RoomInfo
|
||||
import com.chwl.core.super_admin.util.SuperAdminUtil
|
||||
@@ -32,10 +30,8 @@ import com.chwl.library.net.rxnet.RxNet
|
||||
import com.chwl.library.utils.ResUtil
|
||||
import com.chwl.library.utils.SingleToastUtil
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.google.gson.JsonElement
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
|
||||
@@ -79,6 +75,7 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
private var mCurrentMicType: Int? = null
|
||||
private var mCurrentMicSkins: Int? = null
|
||||
private var mCurrentMicEffects: Int? = null
|
||||
private var mCurrentLevel = 0
|
||||
|
||||
private val mMicTypeAdapter = RoomModeAdapter()
|
||||
private val mMicSkinsAdapter = RoomModeAdapter()
|
||||
@@ -110,7 +107,6 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
|
||||
binding.btnConfirm.click {
|
||||
switchRoomMicType()
|
||||
switchEffectsSkins()
|
||||
}
|
||||
|
||||
binding.btnMore.click {
|
||||
@@ -121,47 +117,87 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
mCurrentMicType = AvRoomDataManager.get().roomType
|
||||
|
||||
val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
mCurrentMicType = mCurrentRoomInfo?.type
|
||||
|
||||
getBoomLevelInfo(AvRoomDataManager.get().roomUid).compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
|
||||
if (it != null) {
|
||||
|
||||
mCurrentMicSkins = it.userMicSkinsId
|
||||
mCurrentMicEffects = it.userMicEffectsId
|
||||
val levelExp = it.nextLevelExp - it.currentLevelExp
|
||||
val proExp = it.roomVal - it.currentLevelExp
|
||||
val nexExp = levelExp - proExp
|
||||
|
||||
//todo do 房间等级信息接口 缺少数据
|
||||
binding.avatar.load("")
|
||||
binding.nick.text = ""
|
||||
binding.proExp.max = levelExp.toInt()
|
||||
binding.proExp.progress = proExp.toInt()
|
||||
|
||||
|
||||
binding.avatar.loadAvatar(mCurrentRoomInfo?.avatar)
|
||||
binding.nick.text = mCurrentRoomInfo?.nick
|
||||
binding.levelIcon.load(it.getCurrentLevelIcon())
|
||||
binding.roomValue.text = R.string.Room_Value_s.getString(it.roomVal)
|
||||
binding.roomAdmin.text = R.string.Room_Admin_s.getString() // 却少
|
||||
binding.roomAdmin.text = R.string.Room_Admin_s.getString("${it.currentManagerNum}/${it.managerLimitNum}")
|
||||
binding.currentLevel.text = R.string.LV_s.getString(it.currentLevel)
|
||||
binding.nextLevel.text = R.string.LV_s.getString(it.nextLevel)
|
||||
binding.nextExp.text = R.string.Next_LV_EXP_s.getString(it.nextLevelExp)
|
||||
binding.nextExp.text = R.string.Next_LV_EXP_s.getString(nexExp)
|
||||
|
||||
val typeArr = arrayOf(RoomInfo.ROOMTYPE_HOME_PARTY, RoomInfo.ROOMTYPE_PARTY, RoomInfo.ROOMTYPE_REVELRY, RoomInfo.ROOMTYPE_19_ROOM, RoomInfo.ROOMTYPE_20_ROOM)
|
||||
val typeNArr = arrayOf(R.drawable.ic_room_mic_type_9_n,R.drawable.ic_room_mic_type_10_n,R.drawable.ic_room_mic_type_15_n,R.drawable.ic_room_mic_type_19_n,R.drawable.ic_room_mic_type_20_n,)
|
||||
val typeSArr = arrayOf(R.drawable.ic_room_mic_type_9_s,R.drawable.ic_room_mic_type_10_s,R.drawable.ic_room_mic_type_15_s,R.drawable.ic_room_mic_type_19_s,R.drawable.ic_room_mic_type_20_s,)
|
||||
val typeData = mutableListOf<RoomLevelDressBase>()
|
||||
typeArr. filterIndexed { index,micType ->
|
||||
typeData.add(RoomLevelMicType().apply {
|
||||
type = micType
|
||||
|
||||
mCurrentMicSkins = it.usedMicSkinId
|
||||
mCurrentMicEffects = it.usedMicEffectId
|
||||
mCurrentLevel = it.currentLevel
|
||||
|
||||
val typeArr = arrayOf(
|
||||
RoomInfo.ROOMTYPE_HOME_PARTY,
|
||||
RoomInfo.ROOMTYPE_PARTY,
|
||||
RoomInfo.ROOMTYPE_REVELRY,
|
||||
RoomInfo.ROOMTYPE_19_ROOM,
|
||||
RoomInfo.ROOMTYPE_20_ROOM
|
||||
)
|
||||
val typeNArr = arrayOf(
|
||||
R.drawable.ic_room_mic_type_9_n,
|
||||
R.drawable.ic_room_mic_type_10_n,
|
||||
R.drawable.ic_room_mic_type_15_n,
|
||||
R.drawable.ic_room_mic_type_19_n,
|
||||
R.drawable.ic_room_mic_type_20_n,
|
||||
)
|
||||
val typeSArr = arrayOf(
|
||||
R.drawable.ic_room_mic_type_9_s,
|
||||
R.drawable.ic_room_mic_type_10_s,
|
||||
R.drawable.ic_room_mic_type_15_s,
|
||||
R.drawable.ic_room_mic_type_19_s,
|
||||
R.drawable.ic_room_mic_type_20_s,
|
||||
)
|
||||
val typeData = mutableListOf<RoomMicDress>()
|
||||
typeArr.filterIndexed { index, micType ->
|
||||
typeData.add(RoomMicDress().apply {
|
||||
id = micType
|
||||
dressType = RoomMicDress.RoomDressType.T_Type
|
||||
isSelect = micType == mCurrentMicType
|
||||
dressUrl = typeNArr[index]
|
||||
dressUrl_S = typeSArr[index]
|
||||
normalRes = typeNArr[index]
|
||||
selectRes = typeSArr[index]
|
||||
})
|
||||
}
|
||||
mMicTypeAdapter.setNewData(typeData as List<RoomLevelDressBase>?)
|
||||
mMicTypeAdapter.setNewData(typeData as List<RoomMicDress>?)
|
||||
|
||||
if (it.getMicSkins().isVerify()) {
|
||||
mMicSkinsAdapter.setNewData(it.getMicSkins() as List<RoomLevelDressBase>?)
|
||||
val micSkins = it.getMicSkins()
|
||||
micSkins.add(0, RoomMicDress().apply {
|
||||
id = 0
|
||||
normalRes = R.drawable.icon_room_up_micro
|
||||
})
|
||||
micSkins.forEach { it.isSelect = (it.id == mCurrentMicSkins) }
|
||||
mMicSkinsAdapter.setNewData(micSkins)
|
||||
}
|
||||
|
||||
if (it.getMicEffects().isVerify()) {
|
||||
mMicEffectsAdapter.setNewData(it.getMicEffects() as List<RoomLevelDressBase>?)
|
||||
val micEffects = it.getMicEffects()
|
||||
micEffects.add(0, RoomMicDress().apply {
|
||||
id = 0
|
||||
normalRes = R.drawable.shape_463a26_circle
|
||||
})
|
||||
micEffects.forEach { it.isSelect = (it.id == mCurrentMicEffects) }
|
||||
mMicEffectsAdapter.setNewData(it.getMicEffects())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,7 +209,7 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
private fun setListView(rvList: RecyclerView, adapter: RoomModeAdapter) {
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
adapter?.data?.forEachIndexed { index, feData ->
|
||||
if (feData is RoomLevelDressBase) {
|
||||
if (feData is RoomMicDress) {
|
||||
feData.isSelect = index == position
|
||||
}
|
||||
}
|
||||
@@ -187,134 +223,126 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
|
||||
private fun switchRoomMicType() {
|
||||
var typeId = -1
|
||||
|
||||
mMicTypeAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicType) {
|
||||
if (it.isSelect) {
|
||||
typeId = it.type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeId != -1 && typeId != mCurrentMicType) {
|
||||
dialogManager.showOkCancelDialog(
|
||||
ResUtil.getString(R.string.switch_room_type_tips),
|
||||
ResUtil.getString(R.string.login_fragment_adduserinfofragment_04)
|
||||
) {
|
||||
|
||||
binding.btnConfirm.post {
|
||||
mTypeSet = false
|
||||
dialogManager.showProgressDialog(context)
|
||||
OpenRoomHelper.updateRoomInfoRx(
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
typeId,
|
||||
0
|
||||
)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
mTypeSet = true
|
||||
dialogManager.dismissDialog()
|
||||
doFinish()
|
||||
}
|
||||
.doOnError {
|
||||
SingleToastUtil.showToast(it.message)
|
||||
dialogManager.dismissDialog()
|
||||
}
|
||||
.subscribe()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun switchEffectsSkins() {
|
||||
var skinsId = -1
|
||||
var effectId = -1
|
||||
var isLevelError = false
|
||||
|
||||
mMicTypeAdapter.data?.forEach {
|
||||
if (it.isSelect) {
|
||||
typeId = it.id
|
||||
}
|
||||
}
|
||||
|
||||
mMicSkinsAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicSkins) {
|
||||
if (it.isSelect) {
|
||||
skinsId = it.dressId
|
||||
if (it.isSelect) {
|
||||
if (it.id > 0) {
|
||||
skinsId = it.id
|
||||
}
|
||||
if (mCurrentLevel < it.reachLevel) {
|
||||
isLevelError = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mMicEffectsAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicEffects) {
|
||||
if (it.isSelect) {
|
||||
effectId = it.dressId
|
||||
if (it.isSelect) {
|
||||
if (it.id > 0) {
|
||||
effectId = it.id
|
||||
}
|
||||
if (mCurrentLevel < it.reachLevel) {
|
||||
isLevelError = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isLevelError) {
|
||||
R.string.roomLevelErrorTips.doToast()
|
||||
} else {
|
||||
|
||||
if ((effectId != -1 && effectId != mCurrentMicEffects) || (skinsId != -1 && skinsId != mCurrentMicSkins)) {
|
||||
micSkinsEffectsSet = false
|
||||
postMicSkinEffect(skinsId, effectId).compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
micSkinsEffectsSet = true
|
||||
doFinish()
|
||||
if ((typeId != -1 && typeId != mCurrentMicType) || (effectId != -1 && effectId != mCurrentMicEffects) || (skinsId != -1 && skinsId != mCurrentMicSkins)) {
|
||||
dialogManager.showOkCancelDialog(
|
||||
ResUtil.getString(R.string.switch_room_type_tips),
|
||||
ResUtil.getString(R.string.login_fragment_adduserinfofragment_04)
|
||||
) {
|
||||
|
||||
binding.btnConfirm.post {
|
||||
mTypeSet = false
|
||||
dialogManager.showProgressDialog(context)
|
||||
|
||||
val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
mCurrentRoomInfo?.type = typeId
|
||||
mCurrentRoomInfo?.usedMicSkinId = skinsId
|
||||
mCurrentRoomInfo?.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()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
|
||||
}.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun doFinish() {
|
||||
if (mTypeSet && micSkinsEffectsSet) {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun transparencyBar() = true
|
||||
|
||||
|
||||
class RoomModeAdapter : BaseBindingAdapter<ItemRoomModeBinding, RoomLevelDressBase>() {
|
||||
class RoomModeAdapter : BaseBindingAdapter<ItemRoomModeBinding, RoomMicDress>() {
|
||||
override fun convert(
|
||||
helper: BaseBindingViewHolder<ItemRoomModeBinding>,
|
||||
item: RoomLevelDressBase
|
||||
item: RoomMicDress
|
||||
) {
|
||||
helper?.binding?.let { binding ->
|
||||
binding.bg.changeStrikeColor(if (item.isSelect) "#ff8c03".toColor() else "#1b1b1d".toColor())
|
||||
binding.bg.changeSoildColor(if (item.isSelect) "#261800".toColor() else "#1b1b1d".toColor())
|
||||
binding.ivType.setVis(false)
|
||||
binding.ivSkins.setVis(false)
|
||||
binding.ivEffect.setVis(false)
|
||||
if (item is RoomLevelMicType) {
|
||||
binding.ivType.setImageResource(if (item.isSelect) item.dressUrl_S else item.dressUrl)
|
||||
binding.ivType.setVis(true)
|
||||
} else if (item is RoomLevelMicSkins) {
|
||||
binding.ivSkins.load(item.dressUrl)
|
||||
|
||||
if (item.id == 0) {
|
||||
binding.ivSkins.setImageResource(item.normalRes)
|
||||
binding.ivSkins.setVis(true)
|
||||
} else if (item is RoomLevelMicEffects) {
|
||||
binding.ivEffect.setVis(false)
|
||||
binding.ivEffect.load(item.dressUrl)
|
||||
} else {
|
||||
if (item.dressType == RoomMicDress.RoomDressType.T_Type) {
|
||||
binding.ivType.setImageResource(if (item.isSelect) item.selectRes else item.normalRes)
|
||||
binding.ivType.setVis(true)
|
||||
} else if (item.dressType == RoomMicDress.RoomDressType.T_Skin) {
|
||||
binding.ivSkins.load(item.normalMicUrl)
|
||||
binding.ivSkins.setVis(true)
|
||||
} else if (item.dressType == RoomMicDress.RoomDressType.T_Effects) {
|
||||
binding.ivEffect.setVis(true)
|
||||
binding.ivEffect.loadFromUrl(item.normalMicUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getBoomLevelInfo(roomUid: Long): Single<RoomLevelInfo> {
|
||||
return api.getBoomLevelInfo(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun postMicSkinEffect(skinsId: Int, effectId: Int): Single<String> {
|
||||
return api.postMicSkinEffect(skinsId, effectId)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
|
||||
interface Api {
|
||||
@@ -322,11 +350,7 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
@GET("/room/level/info")
|
||||
fun getBoomLevelInfo(@Query("roomUid") roomUid: Long): Single<ServiceResult<RoomLevelInfo>>
|
||||
|
||||
@POST("/room/use/micSkinEffect")
|
||||
fun postMicSkinEffect(
|
||||
@Query("skinsId") skinsId: Int,
|
||||
@Query("effectId") effectId: Int
|
||||
): Single<ServiceResult<JsonElement>>
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -6,7 +6,9 @@ import android.graphics.drawable.BitmapDrawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -19,15 +21,18 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
import com.chwl.app.common.widget.CircleImageView;
|
||||
import com.chwl.app.ui.utils.ImageLoadKt;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.webview.DialogWebViewActivity;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.chwl.app.utils.AvatarHelper;
|
||||
import com.chwl.app.utils.RegexUtil;
|
||||
import com.chwl.app.utils.ResourceManager;
|
||||
import com.chwl.core.UriProvider;
|
||||
import com.chwl.core.bean.RoomMicInfo;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.chwl.core.gift.bean.RoomMicDress;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.noble.NobleResourceType;
|
||||
import com.chwl.core.noble.NobleUtil;
|
||||
@@ -145,6 +150,8 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
public class NormalMicroViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
View rootView;
|
||||
|
||||
LinearLayout llNick;
|
||||
FrameLayout microLayout;
|
||||
TextView tvNick;
|
||||
ImageView ivUpImage;
|
||||
ImageView ivLockImage;
|
||||
@@ -164,9 +171,12 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
int position = TYPE_INVALID;
|
||||
int micPositionNameOffset = 2;
|
||||
|
||||
int micType = 0; //特殊麦位type , 麦位图片特殊处理
|
||||
|
||||
NormalMicroViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
rootView = itemView.findViewById(R.id.rootView);
|
||||
microLayout = itemView.findViewById(R.id.micro_layout);
|
||||
ivHalo = itemView.findViewById(R.id.iv_halo);
|
||||
ivUpImage = itemView.findViewById(R.id.up_image);
|
||||
ivLockImage = itemView.findViewById(R.id.lock_image);
|
||||
@@ -174,6 +184,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
ivAvatar = itemView.findViewById(R.id.avatar);
|
||||
ivHeadWear = itemView.findViewById(R.id.iv_head_wear);
|
||||
tvNick = itemView.findViewById(R.id.nick);
|
||||
llNick = itemView.findViewById(R.id.ll_nick);
|
||||
ivCharmLevelTag = itemView.findViewById(R.id.iv_charm_level_tag);
|
||||
ivKickGuard = itemView.findViewById(R.id.iv_kick_guard);
|
||||
|
||||
@@ -211,11 +222,19 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
ivCharmLevelTag.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
//todo do 麦位皮肤
|
||||
// up_image = icon_room_up_micro - 可上麦
|
||||
// lock_image = icon_room_lock_micro - 锁麦
|
||||
|
||||
|
||||
if (micType == 0) {
|
||||
// 麦位皮肤
|
||||
// ivUpImage = up_image = icon_room_up_micro - 可上麦
|
||||
// ivLockImage = lock_image = icon_room_lock_micro - 锁麦
|
||||
RoomMicDress roomMicSkins = ResourceManager.INSTANCE.getRoomMicSkins();
|
||||
if (roomMicSkins != null) {
|
||||
ImageLoadKt.loadImage(ivUpImage,roomMicSkins.normalMicUrl);
|
||||
ImageLoadKt.loadImage(ivLockImage,roomMicSkins.normalMicLockUrl);
|
||||
}else {
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
ivLockImage.setImageResource(R.drawable.icon_room_lock_micro);
|
||||
}
|
||||
}
|
||||
|
||||
if (roomMicInfo == null) {
|
||||
ivUpImage.setVisibility(View.VISIBLE);
|
||||
|
@@ -5,12 +5,16 @@ import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.ui.utils.ImageLoadKt;
|
||||
import com.chwl.app.ui.widget.recyclerview.layoutmanager.BoosRoomLayoutManager;
|
||||
import com.chwl.app.utils.ResourceManager;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.core.gift.bean.RoomMicDress;
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
import com.chwl.library.widget.SVGAView;
|
||||
import com.example.lib_utils.ktx.ResourcesKtxKt;
|
||||
@@ -60,8 +64,13 @@ public class Mic19ViewAdapter extends BaseMicroViewAdapter {
|
||||
}else if (view instanceof SVGAImageView){
|
||||
//光圈
|
||||
width = (int) (width / 0.5555);
|
||||
}else if (view instanceof FrameLayout){
|
||||
//头像布局 , 特殊更改
|
||||
width = ResourcesKtxKt.getDimensionToInt(R.dimen.dp_66);
|
||||
if (isDiff) {
|
||||
width = (int) (ResourcesKtxKt.getDimensionToInt(R.dimen.dp_66) / 0.7575);
|
||||
}
|
||||
}
|
||||
|
||||
OtherExtKt.setViewWH(view, width, width,false);
|
||||
}
|
||||
}
|
||||
@@ -85,6 +94,7 @@ public class Mic19ViewAdapter extends BaseMicroViewAdapter {
|
||||
class MicroViewHolder extends GiftValueViewHolder {
|
||||
MicroViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
micType = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,11 +102,30 @@ public class Mic19ViewAdapter extends BaseMicroViewAdapter {
|
||||
// int width = MyUtil.INSTANCE.getMAppWidth() / 5;
|
||||
// OtherExtKt.setViewWH(rootView,width, ViewGroup.LayoutParams.WRAP_CONTENT,false);
|
||||
|
||||
setViewDiff(new View[]{ivHalo,ivHeadWear, ivAvatar, ivLockImage, ivUpImage}, position == 6);
|
||||
setViewDiff(new View[]{ivHalo,ivHeadWear, ivAvatar, ivLockImage, ivUpImage,microLayout}, position == 6);
|
||||
|
||||
super.bind(info, position);
|
||||
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// 麦位皮肤
|
||||
// ivUpImage = up_image = icon_room_up_micro - 可上麦
|
||||
// ivLockImage = lock_image = icon_room_lock_micro - 锁麦
|
||||
RoomMicDress roomMicSkins = ResourceManager.INSTANCE.getRoomMicSkins();
|
||||
if (roomMicSkins != null) {
|
||||
if (getItemViewType() == TYPE_BOSS) {
|
||||
OtherExtKt.doLog("麦位 加载 麦位 图 boss position = "+position+" = "+roomMicSkins.bossMicUrl);
|
||||
ImageLoadKt.loadImage(ivUpImage,roomMicSkins.bossMicUrl);
|
||||
ImageLoadKt.loadImage(ivLockImage,roomMicSkins.bossMicLockUrl);
|
||||
} else {
|
||||
OtherExtKt.doLog("麦位 加载 麦位 图 normal position = "+position+" = "+roomMicSkins.bossMicUrl);
|
||||
ImageLoadKt.loadImage(ivUpImage,roomMicSkins.normalMicUrl);
|
||||
ImageLoadKt.loadImage(ivLockImage,roomMicSkins.normalMicLockUrl);
|
||||
}
|
||||
}else {
|
||||
OtherExtKt.doLog("麦位 加载 麦位 图 def position = "+position);
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
ivLockImage.setImageResource(R.drawable.icon_room_lock_micro);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public class Mic20ViewAdapter extends BaseMicroViewAdapter {
|
||||
@Override
|
||||
public void bind(RoomQueueInfo info, int position) {
|
||||
super.bind(info, position);
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
@@ -87,7 +87,7 @@ public class MicroViewAdapter extends BaseMicroViewAdapter {
|
||||
// if (position == 7) {
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro_vip);
|
||||
// } else {
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// }
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
|
||||
/**
|
||||
* @author xiaoyu
|
||||
@@ -67,7 +66,7 @@ public class PartyMicroViewAdapter extends BaseMicroViewAdapter {
|
||||
@Override
|
||||
public void bind(RoomQueueInfo info, int position) {
|
||||
super.bind(info, position);
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
@@ -66,7 +66,7 @@ public class RevelryMicroViewAdapter extends BaseMicroViewAdapter {
|
||||
@Override
|
||||
public void bind(RoomQueueInfo info, int position) {
|
||||
super.bind(info, position);
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
// ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
|
@@ -136,6 +136,7 @@ import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.utils.LogUtils
|
||||
import com.chwl.core.utils.net.VipLevelNotEnoughException
|
||||
import com.chwl.library.common.util.LimitClickUtils
|
||||
import com.chwl.library.common.util.doLog
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.common.util.setVis
|
||||
@@ -493,6 +494,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_INFO_UPDATE -> {
|
||||
"收到房间 ROOM_INFO_UPDATE 消息, 开始 跟新房间信息和UI ".doLog()
|
||||
Logger.i(ResUtil.getString(R.string.avroom_fragment_baseroomfragment_01))
|
||||
addOpenDatingTips() //一定要放在updateView之前!!!
|
||||
updateScreen()
|
||||
|
@@ -23,7 +23,9 @@ import com.chwl.app.avroom.adapter.OnMicroItemClickListener;
|
||||
import com.chwl.app.ui.anim.AnimFactory;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.chwl.app.ui.widget.recyclerview.decoration.DatingItemDecoration;
|
||||
import com.chwl.app.utils.ResourceManager;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.core.gift.bean.RoomMicDress;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.manager.IMNetEaseManager;
|
||||
import com.chwl.core.manager.RoomEvent;
|
||||
@@ -226,6 +228,12 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
String halo = (String) NobleUtil.getResource(NobleResourceType.KEY_HALO, roomQueueInfo.mChatRoomMember);
|
||||
String micCircle = roomQueueInfo.mChatRoomMember.getMicCircle();
|
||||
boolean isSingleAnchor = AvRoomDataManager.get().isSingleRoom() && pos == 0;
|
||||
RoomMicDress roomMicEffects = ResourceManager.INSTANCE.getRoomMicEffects();
|
||||
if (TextUtils.isEmpty(micCircle)) {
|
||||
if (roomMicEffects != null) {
|
||||
micCircle = roomMicEffects.normalMicUrl;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果 micCircle 没有值,表示 没有后台没有返回麦位光圈 且 他不是个播房 的 主播位 pos=0 , 那么 走默认光圈逻辑
|
||||
if (TextUtils.isEmpty(micCircle) && !isSingleAnchor) {
|
||||
@@ -244,8 +252,8 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
} else {
|
||||
isNeedSetBackground = true;
|
||||
}
|
||||
|
||||
if (isNeedSetBackground) {
|
||||
//todo do 房间默认 麦位光圈
|
||||
AnimFactory.getSpeakingAnimation(mContext, speakState.getWidth(), speakState.getHeight(), NobleUtil.getColor(halo), speakState.getWidth() * 3 / 4)
|
||||
.subscribe((animationDrawable, throwable) -> {
|
||||
speakState.setBackground(animationDrawable);
|
||||
|
@@ -157,6 +157,11 @@ public class OpenRoomHelper {
|
||||
gameId);
|
||||
}
|
||||
|
||||
public static Single<RoomInfo> updateRoomInfoEx(RoomInfo roomInfo) {
|
||||
RoomSettingModel roomSettingModel = new RoomSettingModel();
|
||||
return roomSettingModel.updateRoomInfoEx(roomInfo);
|
||||
}
|
||||
|
||||
public static void updateRoomInfo(BaseActivity activity, RoomInfo roomInfo, int type, long gameId, boolean needOpen) {
|
||||
RoomSettingModel roomSettingModel = new RoomSettingModel();
|
||||
roomSettingModel.updateRoomInfo(
|
||||
|
@@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.chwl.core.utils.MyUtil
|
||||
import com.chwl.library.common.util.doLog
|
||||
import com.chwl.library.common.util.doLogE
|
||||
|
||||
/**
|
||||
* 19 麦 管理器
|
||||
@@ -81,7 +82,7 @@ class BoosRoomLayoutManager : StaggeredGridLayoutManager {
|
||||
"pos = $i row = $row viewWidth = $viewWidth viewHeight = $viewHeight left = $offsetX top = $offsetY right = ${offsetX + viewWidth} bottom : ${offsetY+viewHeight} ".doLog()
|
||||
|
||||
if (i == 7) {
|
||||
layoutDecorated(view, offsetX, offsetY+(viewHeight/2), offsetX + viewWidth, offsetY+viewHeight+(viewHeight/2))
|
||||
layoutDecorated(view, offsetX, offsetY+(viewHeight/10), offsetX + viewWidth, offsetY+viewHeight+(viewHeight/10))
|
||||
}else if (i == 12 || i == 13) {
|
||||
layoutDecorated(view, offsetX+viewWidth, offsetY, offsetX + viewWidth+viewWidth, offsetY+viewHeight)
|
||||
} else {
|
||||
@@ -92,8 +93,7 @@ class BoosRoomLayoutManager : StaggeredGridLayoutManager {
|
||||
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"19麦布局管理器 发生严重错误 onLayoutChildren e = ${e.printStackTrace()}"
|
||||
e.printStackTrace()
|
||||
"19麦布局管理器 发生严重错误 onLayoutChildren e = ${e.message}".doLogE()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,8 +277,7 @@ class BoosRoomLayoutManager : StaggeredGridLayoutManager {
|
||||
try {
|
||||
super.onScrollStateChanged(state)
|
||||
} catch (e: Exception) {
|
||||
"19麦布局管理器 发生严重错误 onScrollStateChanged e = ${e.printStackTrace()}"
|
||||
e.printStackTrace()
|
||||
"19麦布局管理器 发生严重错误 onScrollStateChanged e = ${e.message}".doLogE()
|
||||
}
|
||||
}
|
||||
|
||||
|
50
app/src/main/java/com/chwl/app/utils/ResourceManager.kt
Normal file
50
app/src/main/java/com/chwl/app/utils/ResourceManager.kt
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.chwl.app.utils
|
||||
|
||||
import com.chwl.core.gift.bean.RoomMicDress
|
||||
import com.chwl.core.home.bean.ClientResource
|
||||
import com.chwl.core.initial.InitialModel
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.library.common.util.doLog
|
||||
import com.chwl.library.common.util.isVerify
|
||||
|
||||
object ResourceManager {
|
||||
|
||||
public var mClientResource : ClientResource? = null
|
||||
|
||||
fun initResource() {
|
||||
InitialModel.get().clientResource().doOnSuccess {
|
||||
"data = $it".doLog()
|
||||
mClientResource = it
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
fun getRoomMicSkins() : RoomMicDress?{
|
||||
val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (mCurrentRoomInfo != null) {
|
||||
return getRoomMicDress(RoomMicDress.RoomDressType.T_Skin,mCurrentRoomInfo.usedMicSkinId)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun getRoomMicEffects() : RoomMicDress?{
|
||||
val mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (mCurrentRoomInfo != null) {
|
||||
return getRoomMicDress(RoomMicDress.RoomDressType.T_Effects,mCurrentRoomInfo.usedMicEffectId)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun getRoomMicDress(type:Int,id:Int) : RoomMicDress ?{
|
||||
var data : RoomMicDress?=null;
|
||||
if (mClientResource?.roomMicDressList.isVerify()) {
|
||||
mClientResource?.roomMicDressList?.forEachIndexed { index, roomMicDress ->
|
||||
if (roomMicDress.dressType == type) {
|
||||
if (roomMicDress.id == id) {
|
||||
data = roomMicDress
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
8
app/src/main/res/drawable/shape_463a26_circle.xml
Normal file
8
app/src/main/res/drawable/shape_463a26_circle.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/white_transparent_15" />
|
||||
<stroke android:color="@color/white" android:width="1dp"/>
|
||||
<corners android:radius="50dp" />
|
||||
</shape>
|
@@ -45,9 +45,11 @@
|
||||
android:visibility="gone"
|
||||
android:layout_height="50dp"/>
|
||||
|
||||
<ImageView
|
||||
<com.chwl.library.widget.SVGAView
|
||||
android:id="@+id/ivEffect"
|
||||
android:layout_width="73dp"
|
||||
app:autoPlay="true"
|
||||
app:loopCount="-1"
|
||||
android:visibility="gone"
|
||||
android:layout_height="73dp"/>
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -10,7 +11,7 @@
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
@@ -24,8 +25,9 @@
|
||||
android:id="@+id/micro_layout"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
tools:background="#3F51B5">
|
||||
@@ -75,7 +77,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_9" />
|
||||
android:textSize="@dimen/sp_9" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_50"
|
||||
@@ -119,11 +121,13 @@
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:background="@drawable/shape_pk_mic_queue_mark_red"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_9"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_nick"
|
||||
android:textSize="@dimen/sp_9"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_list_item_micro_01"
|
||||
tools:visibility="visible" />
|
||||
@@ -133,8 +137,9 @@
|
||||
android:id="@+id/ll_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_below="@id/micro_layout"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/micro_layout"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
@@ -161,7 +166,7 @@
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="@string/layout_list_item_micro_02"
|
||||
tools:textColor="@color/white" />
|
||||
|
||||
@@ -171,10 +176,11 @@
|
||||
android:id="@+id/ll_charm_click"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_below="@id/ll_nick"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_nick"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:background="@drawable/shape_bg_of_mic_charm"
|
||||
android:paddingStart="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_2">
|
||||
@@ -200,6 +206,6 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -170,6 +170,7 @@
|
||||
android:id="@+id/rvListType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
@@ -187,6 +188,7 @@
|
||||
android:id="@+id/rvListSkins"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
@@ -203,6 +205,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListEffects"
|
||||
android:layout_width="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
@@ -5392,6 +5392,7 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="Carnival">Carnival</string>
|
||||
<string name="Celebration">Celebration</string>
|
||||
<string name="Unique">Unique</string>
|
||||
<string name="roomLevelErrorTips">房间等级错误</string>
|
||||
|
||||
</resources>
|
||||
|
||||
|
@@ -1,5 +0,0 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public class RoomLevelDressBase {
|
||||
public boolean isSelect;
|
||||
}
|
@@ -11,14 +11,17 @@ public class RoomLevelInfo {
|
||||
public int currentLevel;
|
||||
public String currentLevelIcon;
|
||||
|
||||
public List<RoomLevelMicEffects> micEffects;
|
||||
public List<RoomLevelMicSkins> micSkins;
|
||||
public List<RoomMicDress> micEffects;
|
||||
public List<RoomMicDress> micSkins;
|
||||
|
||||
public double nextLevelExp;
|
||||
public int nextLevel;
|
||||
public double roomVal;
|
||||
public int userMicEffectsId;
|
||||
public int userMicSkinsId;
|
||||
public int usedMicEffectId;
|
||||
public int usedMicSkinId;
|
||||
|
||||
public int managerLimitNum; //管理员上限
|
||||
public int currentManagerNum; //当前管理员数量
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public class RoomLevelMicEffects extends RoomLevelDressBase{
|
||||
public int dressId;
|
||||
public int dressType;
|
||||
public String dressUrl;
|
||||
public int id;
|
||||
public int reachLevel;
|
||||
public int status;
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public class RoomLevelMicSkins extends RoomLevelDressBase{
|
||||
public int dressId;
|
||||
public int dressType;
|
||||
public String dressUrl;
|
||||
public int id;
|
||||
public int reachLevel;
|
||||
public int status;
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public class RoomLevelMicType extends RoomLevelDressBase{
|
||||
public int dressType;
|
||||
public int dressId;
|
||||
public int dressUrl;
|
||||
public int dressUrl_S;
|
||||
public String iconRes;
|
||||
public int id;
|
||||
public int type;
|
||||
public int reachLevel;
|
||||
public int status;
|
||||
}
|
23
core/src/main/java/com/chwl/core/gift/bean/RoomMicDress.java
Normal file
23
core/src/main/java/com/chwl/core/gift/bean/RoomMicDress.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
|
||||
public class RoomMicDress {
|
||||
public int id;
|
||||
public int dressType;
|
||||
public int normalRes;
|
||||
public int selectRes;
|
||||
public int reachLevel;
|
||||
public String normalMicUrl;
|
||||
public String normalMicLockUrl;
|
||||
public String bossMicUrl;
|
||||
public String bossMicLockUrl;
|
||||
public boolean isSelect;
|
||||
|
||||
public @interface RoomDressType{
|
||||
int T_Skin = 1;
|
||||
int T_Effects = 2 ;
|
||||
int T_Type = 100 ; //特殊, 代表房间类型
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.chwl.core.home.bean;
|
||||
|
||||
import com.chwl.core.gift.bean.RoomMicDress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ClientResource {
|
||||
|
||||
public List<RoomMicDress> roomMicDressList;
|
||||
|
||||
}
|
@@ -6,6 +6,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import com.chwl.core.base.IModel;
|
||||
import com.chwl.core.home.bean.ClientResource;
|
||||
import com.chwl.core.home.bean.ConfigInfo;
|
||||
import com.chwl.core.home.bean.MainTabInfo;
|
||||
import com.chwl.core.initial.bean.FairyOpenInfo;
|
||||
@@ -53,4 +54,6 @@ public interface IInitialModel extends IModel {
|
||||
String getPublicChatSessionId();
|
||||
|
||||
Single<ConfigInfo> loadConfig();
|
||||
|
||||
Single<ClientResource> clientResource();
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import com.chwl.core.auth.event.LogoutEvent;
|
||||
import com.chwl.core.base.BaseModel;
|
||||
import com.chwl.core.bean.response.ServiceResult;
|
||||
import com.chwl.core.certification.CertificationModel;
|
||||
import com.chwl.core.home.bean.ClientResource;
|
||||
import com.chwl.core.home.bean.ConfigInfo;
|
||||
import com.chwl.core.home.bean.MainTabInfo;
|
||||
import com.chwl.core.home.bean.MainTabType;
|
||||
@@ -398,6 +399,13 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Single<ClientResource> clientResource() {
|
||||
return api.clientResource()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private List<MainTabInfo> getDefaultMainTab() {
|
||||
return new ArrayList<>(Arrays.asList(
|
||||
new MainTabInfo(
|
||||
@@ -548,5 +556,15 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
||||
@FormUrlEncoded
|
||||
Single<ServiceResult<Long>> regionCheck(@Field("lang") String lang, @Field("mcc") String mcc);
|
||||
|
||||
|
||||
/**
|
||||
* 资源接口 :
|
||||
* 房间资源信息 , 麦位皮肤,麦位光圈
|
||||
*
|
||||
* @return -
|
||||
*/
|
||||
@GET("/client/resource")
|
||||
Single<ServiceResult<ClientResource>> clientResource();
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -162,7 +162,10 @@ public class RoomInfo implements Parcelable,Serializable {
|
||||
// 总流水
|
||||
private double serialValue;
|
||||
|
||||
private String roomLevelIcon;
|
||||
private String roomLevelIcon; //房间等级icon
|
||||
|
||||
private int usedMicSkinId; // 正在使用的麦位皮肤id
|
||||
private int usedMicEffectId; // 正在使用的麦位光圈特效id
|
||||
|
||||
public RightBottomIconConfig rightBottomIconConfig;
|
||||
|
||||
|
@@ -138,6 +138,32 @@ public class RoomSettingModel extends BaseMvpModel {
|
||||
}
|
||||
});
|
||||
}
|
||||
public Single<RoomInfo> updateRoomInfoEx(RoomInfo roomInfo) {
|
||||
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()
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.onErrorResumeNext(this.<RoomInfo>getSingleCommonExceptionFunction())
|
||||
.flatMap(this.<RoomInfo>getSingleFunction())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnSuccess(roomInfoData -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -305,6 +331,27 @@ public class RoomSettingModel extends BaseMvpModel {
|
||||
@Field("type") int type,
|
||||
@Field("mgId") long gameId,
|
||||
@Field("singleRoomSortId") Long singleRoomSortId);
|
||||
@FormUrlEncoded
|
||||
@POST("room/update")
|
||||
Single<ServiceResult<RoomInfo>> updateRoomInfoEx(@Field("type") int type,
|
||||
@Field("usedMicSkinId") int usedMicSkinId,
|
||||
@Field("usedMicEffectId") int usedMicEffectId,
|
||||
|
||||
@Field("mgId") Long gameId,
|
||||
@Field("singleRoomSortId") Long singleRoomSortId,
|
||||
@Field("title") String title,
|
||||
@Field("avatar") String avatar,
|
||||
@Field("roomDesc") String desc,
|
||||
@Field("introduction") String introduction,
|
||||
@Field("roomPwd") String pwd,
|
||||
@Field("roomTag") String label,
|
||||
@Field("tagId") Integer tagId,
|
||||
@Field("uid") Long uid,
|
||||
@Field("hasAnimationEffect") Boolean hasAnimationEffect,
|
||||
@Field("audioQuality") Integer audioQuality,
|
||||
@Field("limitType") String limitType,
|
||||
@Field("isPureMode") Boolean isPureMode
|
||||
);
|
||||
|
||||
/**
|
||||
* 更新房间设置信息 - 主题背景
|
||||
|
@@ -308,9 +308,7 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
*/
|
||||
@Override
|
||||
public Single<UserInfo> getUserInfoFromServerUpdate(final long userId,boolean isRef) {
|
||||
return api.requestUserInfo(
|
||||
String.valueOf(userId)
|
||||
)
|
||||
return api.requestUserInfo(String.valueOf(userId))
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.flatMap(userInfoServiceResult -> {
|
||||
|
||||
|
@@ -1414,6 +1414,26 @@ class GlideUtils {
|
||||
val glideConfig = getGlideConfig(context)
|
||||
glideConfig
|
||||
?.asDrawable()
|
||||
// ?.skipMemoryCache(true)
|
||||
?.load(url)
|
||||
?.addListener(listener)
|
||||
?.submit()
|
||||
} /**
|
||||
* 使用Glide下载图片,返回File
|
||||
*/
|
||||
fun downloadFromUrlToBitmap(
|
||||
context: Context?,
|
||||
url: String?,
|
||||
listener: RequestListener<Bitmap?>?
|
||||
) {
|
||||
if (context == null) {
|
||||
LibLogger.error(TAG, "load context is null")
|
||||
return
|
||||
}
|
||||
|
||||
val glideConfig = getGlideConfig(context)
|
||||
glideConfig
|
||||
?.asBitmap()
|
||||
// ?.skipMemoryCache(true)
|
||||
?.load(url)
|
||||
?.addListener(listener)
|
||||
|
@@ -149,6 +149,16 @@ fun String?.doLogW() {
|
||||
}
|
||||
}
|
||||
}
|
||||
fun String?.doLogE() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
if (this.isVerify()) {
|
||||
val stackTrace = Thread.currentThread().stackTrace
|
||||
val line = stackTrace?.getOrNull(3)?.lineNumber?:""
|
||||
val fileName = stackTrace?.getOrNull(3)?.fileName?:""
|
||||
Log.println(Log.ERROR, "doLog", "$this at ($fileName:$line)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.doToast() {
|
||||
val string = this.getString()
|
||||
|
77
mode.json
77
mode.json
@@ -2,17 +2,70 @@
|
||||
"code": 200,
|
||||
"message": "success",
|
||||
"data": {
|
||||
"id": 2083,
|
||||
"uid": 3224,
|
||||
"type": 64,
|
||||
"starLevel": 5,
|
||||
"createTime": "2024-12-24 18:15:43",
|
||||
"updateTime": 1735035343000,
|
||||
"erbanNo": "6228657",
|
||||
"nick": "Molistar",
|
||||
"avatar": "https://image.pekolive.com/bfed3b08-1ebe-42dc-b9a4-619cb2da0e43.gif",
|
||||
"isOnline": 0,
|
||||
"seq": 0
|
||||
"roomVal": 60936.5,
|
||||
"currentLevelIcon": "https://image.pekolive.com/3room_lv.png",
|
||||
"currentLevel": 3,
|
||||
"currentLevelExp": 52500,
|
||||
"nextLevel": 4,
|
||||
"nextLevelExp": 78750,
|
||||
"micEffects": [
|
||||
{
|
||||
"id": 4,
|
||||
"dressType": 2,
|
||||
"reachLevel": 20,
|
||||
"normalMicUrl": "https://image.pekolive.com/20miceffect.svga",
|
||||
"normalMicLockUrl": "",
|
||||
"bossMicUrl": "",
|
||||
"bossMicLockUrl": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"dressType": 2,
|
||||
"reachLevel": 40,
|
||||
"normalMicUrl": "https://image.pekolive.com/40miceffect.svga",
|
||||
"normalMicLockUrl": "",
|
||||
"bossMicUrl": "",
|
||||
"bossMicLockUrl": ""
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"dressType": 2,
|
||||
"reachLevel": 60,
|
||||
"normalMicUrl": "https://image.pekolive.com/60miceffect.svga",
|
||||
"normalMicLockUrl": "",
|
||||
"bossMicUrl": "",
|
||||
"bossMicLockUrl": ""
|
||||
}
|
||||
],
|
||||
"micSkins": [
|
||||
{
|
||||
"id": 1,
|
||||
"dressType": 1,
|
||||
"reachLevel": 20,
|
||||
"normalMicUrl": "https://image.pekolive.com/20levelmic_mic.png",
|
||||
"normalMicLockUrl": "https://image.pekolive.com/20levelmic_lockmic.png",
|
||||
"bossMicUrl": "https://image.pekolive.com/20levelmic_mic_boss.png",
|
||||
"bossMicLockUrl": "https://image.pekolive.com/20levelmic_lockmic_boss.png"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"dressType": 1,
|
||||
"reachLevel": 40,
|
||||
"normalMicUrl": "https://image.pekolive.com/40levelmic_mic.png",
|
||||
"normalMicLockUrl": "https://image.pekolive.com/40levelmic_lockmic.png",
|
||||
"bossMicUrl": "https://image.pekolive.com/40levelmic_mic_boss.png",
|
||||
"bossMicLockUrl": "https://image.pekolive.com/40levelmic_lockmic_boss.png"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"dressType": 1,
|
||||
"reachLevel": 60,
|
||||
"normalMicUrl": "https://image.pekolive.com/60levelmic_mic.png",
|
||||
"normalMicLockUrl": "https://image.pekolive.com/60levelmic_lockmic.png",
|
||||
"bossMicUrl": "https://image.pekolive.com/60levelmic_mic_boss.png",
|
||||
"bossMicLockUrl": "https://image.pekolive.com/60levelmic_lockmic_boss.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timestamp": 1735109388648
|
||||
"timestamp": 1735200527891
|
||||
}
|
||||
|
Reference in New Issue
Block a user