feat : 19 麦位 初次提交
@@ -259,6 +259,9 @@
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomTypeSwitchActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".DemoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".avroom.activity.RoomBgSettingActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
@@ -1,4 +1,75 @@
|
||||
package com.chwl.app
|
||||
|
||||
class DemoActivity {
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.ViewGroup
|
||||
import com.chwl.app.avroom.adapter.Mic19ViewAdapter
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.bindadapter.BaseBindingViewHolder
|
||||
import com.chwl.app.databinding.ActivityDemoBinding
|
||||
import com.chwl.app.databinding.ListItemMicroBinding
|
||||
import com.chwl.app.ui.widget.recyclerview.layoutmanager.BoosRoomLayoutManager
|
||||
import com.chwl.library.common.util.setVis
|
||||
|
||||
class DemoActivity : BaseViewBindingActivity<ActivityDemoBinding>() {
|
||||
|
||||
companion object{
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, DemoActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
//
|
||||
// val adapter = DemoAdapter()
|
||||
// adapter.onItemClickListener = object : BaseQuickAdapter.OnItemClickListener {
|
||||
// override fun onItemClick(adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int) {
|
||||
// " click $position ".doToast()
|
||||
// }
|
||||
// }
|
||||
// binding.rvList.adapter = adapter
|
||||
// binding.rvList.layoutManager = BoosRoomLayoutManager()
|
||||
//
|
||||
//
|
||||
// // 54 1 45
|
||||
// adapter.setNewData(arrayListOf(
|
||||
// 1,1,1,1,1,
|
||||
// 1,1,1,1,1,
|
||||
// 1,1,1,1,1,
|
||||
// 1,1,1,1,
|
||||
// ))
|
||||
|
||||
val adapter = Mic19ViewAdapter(context)
|
||||
binding.rvList.adapter = adapter
|
||||
binding.rvList.layoutManager = BoosRoomLayoutManager()
|
||||
|
||||
|
||||
val item = ListItemMicroBinding.inflate(layoutInflater, binding.layout, false)
|
||||
item.root.layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
binding.layout.addView(item.root)
|
||||
|
||||
}
|
||||
|
||||
|
||||
class DemoAdapter : BaseBindingAdapter<ListItemMicroBinding,Int>() {
|
||||
|
||||
override fun convert(helper: BaseBindingViewHolder<ListItemMicroBinding>, item: Int) {
|
||||
val bindingAdapterPosition = helper.bindingAdapterPosition
|
||||
|
||||
helper.binding.avatar.setVis(true)
|
||||
helper.binding.avatar.setImageResource(R.drawable.user_info_ic_id)
|
||||
helper.binding.llCharmClick.setVis(true)
|
||||
helper.binding.tvCharmValue.setVis(true)
|
||||
helper.binding.tvCharmValue.text = "${ bindingAdapterPosition + 1}"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -11,7 +11,6 @@ import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
@@ -99,10 +98,12 @@ import com.chwl.core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.chwl.core.user.event.NeedBindPhoneEvent;
|
||||
import com.chwl.core.user.event.NeedCompleteInfoEvent;
|
||||
import com.chwl.core.utils.MyUtil;
|
||||
import com.chwl.core.utils.SharedPreferenceUtils;
|
||||
import com.chwl.core.utils.StringFormatUtils;
|
||||
import com.chwl.core.utils.WLog;
|
||||
import com.chwl.library.base.factory.CreatePresenter;
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
import com.chwl.library.threadmgr.ThreadPoolManager;
|
||||
import com.chwl.library.utils.JavaUtil;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
@@ -283,36 +284,38 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void checkResumeGame() {
|
||||
GameModel2.INSTANCE.getResumeGameRoomInfo().compose(bindToLifecycle()).subscribe(gameRoomInfo -> {
|
||||
if (gameRoomInfo != null && gameRoomInfo.getData() != null) {
|
||||
Integer state = gameRoomInfo.getData().getMatchStatus();
|
||||
if (state != null && (state == GameStateAbility.STATE_MATCH_SUCCESS || state == GameStateAbility.STATE_MATCHING)) {
|
||||
if (resumeGameDialogManager == null) {
|
||||
resumeGameDialogManager = new DialogManager(this);
|
||||
}
|
||||
resumeGameDialogManager.showOkCancelDialog(getString(R.string.resume_game_tips), getString(R.string.join_organization_ok), getString(R.string.join_organization_no), false, new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
long gameId = JavaUtil.str2long(gameRoomInfo.getData().getMgId());
|
||||
int gameMode = 0;
|
||||
GameActivity.Companion.start(context, new GameIntent(gameId, gameMode));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
DialogManager.OkCancelDialogListener.super.onCancel();
|
||||
Long roomId = gameRoomInfo.getRoomId();
|
||||
if (roomId != null) {
|
||||
GameModel2.INSTANCE.closeGameRx(roomId).compose(bindToLifecycle()).subscribe(s -> {
|
||||
}, throwable -> {
|
||||
});
|
||||
GameModel2.INSTANCE.getResumeGameRoomInfo().compose(bindToLifecycle())
|
||||
.doOnSuccess(gameRoomInfo -> {
|
||||
if (gameRoomInfo != null && gameRoomInfo.getData() != null) {
|
||||
Integer state = gameRoomInfo.getData().getMatchStatus();
|
||||
if (state != null && (state == GameStateAbility.STATE_MATCH_SUCCESS || state == GameStateAbility.STATE_MATCHING)) {
|
||||
if (resumeGameDialogManager == null) {
|
||||
resumeGameDialogManager = new DialogManager(this);
|
||||
}
|
||||
resumeGameDialogManager.showOkCancelDialog(getString(R.string.resume_game_tips), getString(R.string.join_organization_ok), getString(R.string.join_organization_no), false, new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
long gameId = JavaUtil.str2long(gameRoomInfo.getData().getMgId());
|
||||
int gameMode = 0;
|
||||
GameActivity.Companion.start(context, new GameIntent(gameId, gameMode));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
DialogManager.OkCancelDialogListener.super.onCancel();
|
||||
Long roomId = gameRoomInfo.getRoomId();
|
||||
if (roomId != null) {
|
||||
GameModel2.INSTANCE.closeGameRx(roomId).compose(bindToLifecycle()).subscribe(s -> {
|
||||
}, throwable -> {
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, throwable -> {
|
||||
});
|
||||
}
|
||||
}).doOnError(e->{
|
||||
|
||||
}).subscribe();
|
||||
}
|
||||
|
||||
private void initPreloadResource() {
|
||||
@@ -405,6 +408,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
mMainTabLayout.setOnTabClickListener(this);
|
||||
anchorCardView = findViewById(R.id.vs_anchor_card);
|
||||
mMainTabLayout.setDefaultTabType(mCurrentTabType);
|
||||
MyUtil.INSTANCE.initAppWidth(findViewById(R.id.rootWidth));
|
||||
}
|
||||
|
||||
private void updateDatas() {
|
||||
@@ -524,9 +528,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void onLogin(long uid) {
|
||||
Logger.e(TAG, "onLogin Success ~~~~");
|
||||
|
||||
Log.i("checkLostUser", "onLogin");
|
||||
OtherExtKt.doLogW("onLogin Success ~~~~");
|
||||
OtherExtKt.doLogW("onLogin");
|
||||
|
||||
int unreadCount = IMMessageManager.get().queryUnreadMsg();
|
||||
mMainTabLayout.setMsgNum(unreadCount);
|
||||
|
@@ -885,6 +885,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
AvRoomDataManager.get().hasAvRoomAct = false;
|
||||
//关闭这么多弹窗,鬼知道哪个出问题了,简单的try catch下
|
||||
try {
|
||||
// 确保关闭 dialog,避免出现 leak window 异常
|
||||
@@ -925,7 +926,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
svgaCache.clear();
|
||||
}
|
||||
svgaCache = null;
|
||||
AvRoomDataManager.get().hasAvRoomAct = false;
|
||||
GlobalNotifyManager.INSTANCE.clearQueue();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ import java.util.Map;
|
||||
* @author jiahui
|
||||
* @date 2017/12/21
|
||||
*/
|
||||
//todo do 上麦逻辑
|
||||
@CreatePresenter(RoomInvitePresenter.class)
|
||||
public class RoomInviteActivity extends BaseMvpActivity<IRoomInviteView, RoomInvitePresenter>
|
||||
implements IRoomInviteView, RoomInviteAdapter.OnItemClickListener, RoomInviteAdapter.OnRoomOnlineNumberChangeListener {
|
||||
|
@@ -1,43 +1,72 @@
|
||||
package com.chwl.app.avroom.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
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
|
||||
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.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.manager.AvRoomDataManager
|
||||
import com.chwl.core.room.bean.RoomInfo
|
||||
import com.chwl.core.super_admin.util.SuperAdminUtil
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.doToast
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.common.util.toColor
|
||||
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.singleClick
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
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
|
||||
|
||||
|
||||
//切换麦位页面
|
||||
class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBinding>() {
|
||||
|
||||
private var currentType: Int? = null
|
||||
|
||||
private var selectType: Int? = null
|
||||
|
||||
companion object {
|
||||
fun isCanSwitch(): Boolean {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
return false
|
||||
}
|
||||
if (AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_HOME_PARTY && AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_PARTY && AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_REVELRY) {
|
||||
|
||||
if (AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_HOME_PARTY
|
||||
&& AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_PARTY
|
||||
&& AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_REVELRY
|
||||
&& AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_19_ROOM
|
||||
&& AvRoomDataManager.get().roomType != RoomInfo.ROOMTYPE_20_ROOM
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().isDatingMode) {
|
||||
return false
|
||||
}
|
||||
|
||||
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (roomInfo == null || roomInfo.isPermitRoom == 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
return AvRoomDataManager.get().isManager
|
||||
}
|
||||
|
||||
@@ -46,97 +75,259 @@ class RoomTypeSwitchActivity : BaseViewBindingActivity<RoomTypeSwitchActivityBin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var mCurrentMicType: Int? = null
|
||||
private var mCurrentMicSkins: Int? = null
|
||||
private var mCurrentMicEffects: Int? = null
|
||||
|
||||
private val mMicTypeAdapter = RoomModeAdapter()
|
||||
private val mMicSkinsAdapter = RoomModeAdapter()
|
||||
private val mMicEffectsAdapter = RoomModeAdapter()
|
||||
|
||||
|
||||
private var mTypeSet = true
|
||||
private var micSkinsEffectsSet = true
|
||||
|
||||
override fun init() {
|
||||
initWhiteTitleBar(ResUtil.getString(R.string.room_type))
|
||||
initEvent()
|
||||
this.currentType = AvRoomDataManager.get().mCurrentRoomInfo?.type
|
||||
updateSelectView(currentType)
|
||||
|
||||
initView()
|
||||
initListener()
|
||||
initData()
|
||||
|
||||
}
|
||||
|
||||
private fun initEvent() {
|
||||
binding.tvSubmit.singleClick {
|
||||
selectType?.let {
|
||||
if (currentType != it) {
|
||||
trySwitchRoomType(it)
|
||||
private fun initView() {
|
||||
initDarkTitleBar(R.string.Room_Mode.getString())
|
||||
|
||||
setListView(binding.rvListType, mMicTypeAdapter)
|
||||
setListView(binding.rvListSkins, mMicSkinsAdapter)
|
||||
setListView(binding.rvListEffects, mMicEffectsAdapter)
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun initListener() {
|
||||
|
||||
binding.btnConfirm.click {
|
||||
switchRoomMicType()
|
||||
switchEffectsSkins()
|
||||
}
|
||||
|
||||
binding.btnMore.click {
|
||||
//todo do 更多按钮
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
mCurrentMicType = AvRoomDataManager.get().roomType
|
||||
|
||||
|
||||
getBoomLevelInfo(AvRoomDataManager.get().roomUid).compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
|
||||
if (it != null) {
|
||||
|
||||
mCurrentMicSkins = it.userMicSkinsId
|
||||
mCurrentMicEffects = it.userMicEffectsId
|
||||
|
||||
//todo do 房间等级信息接口 缺少数据
|
||||
binding.avatar.load("")
|
||||
binding.nick.text = ""
|
||||
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.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)
|
||||
|
||||
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
|
||||
isSelect = micType == mCurrentMicType
|
||||
dressUrl = typeNArr[index]
|
||||
dressUrl_S = typeSArr[index]
|
||||
})
|
||||
}
|
||||
mMicTypeAdapter.setNewData(typeData as List<RoomLevelDressBase>?)
|
||||
|
||||
if (it.getMicSkins().isVerify()) {
|
||||
mMicSkinsAdapter.setNewData(it.getMicSkins() as List<RoomLevelDressBase>?)
|
||||
}
|
||||
|
||||
if (it.getMicEffects().isVerify()) {
|
||||
mMicEffectsAdapter.setNewData(it.getMicEffects() as List<RoomLevelDressBase>?)
|
||||
}
|
||||
|
||||
}
|
||||
}.doOnError { it?.message?.doToast() }.subscribe()
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setListView(rvList: RecyclerView, adapter: RoomModeAdapter) {
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
adapter?.data?.forEachIndexed { index, feData ->
|
||||
if (feData is RoomLevelDressBase) {
|
||||
feData.isSelect = index == position
|
||||
}
|
||||
}
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
rvList.layoutManager = GridLayoutManager(context, 3, RecyclerView.VERTICAL, false)
|
||||
rvList.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
private fun switchRoomMicType() {
|
||||
var typeId = -1
|
||||
|
||||
mMicTypeAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicType) {
|
||||
if (it.isSelect) {
|
||||
typeId = it.type
|
||||
}
|
||||
}
|
||||
}
|
||||
addTypeSelectClick(binding.iv9, RoomInfo.ROOMTYPE_HOME_PARTY)
|
||||
addTypeSelectClick(binding.iv10, RoomInfo.ROOMTYPE_PARTY)
|
||||
addTypeSelectClick(binding.iv15, RoomInfo.ROOMTYPE_REVELRY)
|
||||
}
|
||||
|
||||
private fun addTypeSelectClick(view: View, type: Int) {
|
||||
view.setOnClickListener {
|
||||
updateSelectView(type)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateSelectView(type: Int?) {
|
||||
this.selectType = type
|
||||
val views = mapOf(
|
||||
RoomInfo.ROOMTYPE_HOME_PARTY to binding.iv9Border,
|
||||
RoomInfo.ROOMTYPE_PARTY to binding.iv10Border,
|
||||
RoomInfo.ROOMTYPE_REVELRY to binding.iv15Border
|
||||
)
|
||||
val displayRes = mapOf(
|
||||
RoomInfo.ROOMTYPE_HOME_PARTY to R.drawable.room_type_bg_9,
|
||||
RoomInfo.ROOMTYPE_PARTY to R.drawable.room_type_bg_10,
|
||||
RoomInfo.ROOMTYPE_REVELRY to R.drawable.room_type_bg_15
|
||||
)
|
||||
views.forEach {
|
||||
it.value.isVisible = it.key == type
|
||||
}
|
||||
val resId = displayRes.get(type)
|
||||
if (resId != null) {
|
||||
binding.ivSelected.setImageResource(resId)
|
||||
} else {
|
||||
binding.ivSelected.setImageDrawable(null)
|
||||
}
|
||||
if (type == currentType) {
|
||||
binding.tvSubmit.setText(R.string.room_type_using)
|
||||
} else {
|
||||
binding.tvSubmit.setText(R.string.room_type_use)
|
||||
}
|
||||
}
|
||||
|
||||
private fun trySwitchRoomType(type: Int) {
|
||||
val currentType = this.currentType
|
||||
if (currentType != null && currentType > type) {
|
||||
if (typeId != -1 && typeId != mCurrentMicType) {
|
||||
dialogManager.showOkCancelDialog(
|
||||
ResUtil.getString(R.string.switch_room_type_tips),
|
||||
ResUtil.getString(R.string.login_fragment_adduserinfofragment_04)
|
||||
) {
|
||||
requestSwitchRoomType(type)
|
||||
|
||||
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()
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
requestSwitchRoomType(type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun switchEffectsSkins() {
|
||||
var skinsId = -1
|
||||
var effectId = -1
|
||||
|
||||
mMicSkinsAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicSkins) {
|
||||
if (it.isSelect) {
|
||||
skinsId = it.dressId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mMicEffectsAdapter.data?.forEach {
|
||||
if (it is RoomLevelMicEffects) {
|
||||
if (it.isSelect) {
|
||||
effectId = it.dressId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((effectId != -1 && effectId != mCurrentMicEffects) || (skinsId != -1 && skinsId != mCurrentMicSkins)) {
|
||||
micSkinsEffectsSet = false
|
||||
postMicSkinEffect(skinsId, effectId).compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
micSkinsEffectsSet = true
|
||||
doFinish()
|
||||
|
||||
}.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun doFinish() {
|
||||
if (mTypeSet && micSkinsEffectsSet) {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun requestSwitchRoomType(type: Int) {
|
||||
dialogManager.showProgressDialog(context)
|
||||
OpenRoomHelper.updateRoomInfoRx(
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
0
|
||||
).compose(bindToLifecycle()).subscribe({
|
||||
dialogManager.dismissDialog()
|
||||
finish()
|
||||
}, {
|
||||
SingleToastUtil.showToast(it.message)
|
||||
dialogManager.dismissDialog()
|
||||
})
|
||||
}
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
override fun transparencyBar() = true
|
||||
|
||||
|
||||
class RoomModeAdapter : BaseBindingAdapter<ItemRoomModeBinding, RoomLevelDressBase>() {
|
||||
override fun convert(
|
||||
helper: BaseBindingViewHolder<ItemRoomModeBinding>,
|
||||
item: RoomLevelDressBase
|
||||
) {
|
||||
helper?.binding?.let { binding ->
|
||||
binding.bg.changeStrikeColor(if (item.isSelect) "#ff8c03".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)
|
||||
binding.ivSkins.setVis(true)
|
||||
} else if (item is RoomLevelMicEffects) {
|
||||
binding.ivEffect.setVis(false)
|
||||
binding.ivEffect.load(item.dressUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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 {
|
||||
//房间 等级信息
|
||||
@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>>
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -11,23 +11,18 @@ import android.widget.PopupWindow;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
import com.chwl.app.utils.AvatarHelper;
|
||||
import com.chwl.library.widget.SVGAView;
|
||||
import com.chwl.core.utils.extension.StringExtensionKt;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.example.lib_utils.StringUtils2;
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
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.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.core.UriProvider;
|
||||
import com.chwl.core.bean.RoomMicInfo;
|
||||
@@ -43,8 +38,14 @@ import com.chwl.core.room.pk.bean.PKTeamInfo;
|
||||
import com.chwl.core.room.queue.bean.MicMemberInfo;
|
||||
import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.utils.ActivityUtil;
|
||||
import com.chwl.core.utils.extension.StringExtensionKt;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.config.BasicConfig;
|
||||
import com.chwl.library.widget.SVGAView;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.example.lib_utils.StringUtils2;
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
|
||||
/**
|
||||
* @author xiaoyu
|
||||
@@ -61,6 +62,8 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
public static final String MICRO_TYPE_SINGLE = "single";
|
||||
public static final String MICRO_TYPE_PARTY = "party";
|
||||
public static final String MICRO_TYPE_REVELRY = "revelry";
|
||||
public static final String MICRO_TYPE_REVELRY_19 = "revelry_19";
|
||||
public static final String MICRO_TYPE_REVELRY_20 = "revelry_20";
|
||||
|
||||
protected static final int TYPE_KING = 2;
|
||||
protected static final int TYPE_BOSS = 1;
|
||||
@@ -140,6 +143,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
}
|
||||
|
||||
public class NormalMicroViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
View rootView;
|
||||
|
||||
TextView tvNick;
|
||||
ImageView ivUpImage;
|
||||
@@ -162,6 +166,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
|
||||
NormalMicroViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
rootView = itemView.findViewById(R.id.rootView);
|
||||
ivHalo = itemView.findViewById(R.id.iv_halo);
|
||||
ivUpImage = itemView.findViewById(R.id.up_image);
|
||||
ivLockImage = itemView.findViewById(R.id.lock_image);
|
||||
@@ -197,7 +202,7 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
}
|
||||
}
|
||||
|
||||
void bind(RoomQueueInfo info, int position) {
|
||||
void bind(@NonNull RoomQueueInfo info, int position) {
|
||||
this.info = info;
|
||||
this.position = position;
|
||||
RoomMicInfo roomMicInfo = info.mRoomMicInfo;
|
||||
@@ -206,6 +211,12 @@ 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 (roomMicInfo == null) {
|
||||
ivUpImage.setVisibility(View.VISIBLE);
|
||||
ivLockImage.setVisibility(View.GONE);
|
||||
|
@@ -0,0 +1,112 @@
|
||||
package com.chwl.app.avroom.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.ui.widget.recyclerview.layoutmanager.BoosRoomLayoutManager;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
import com.chwl.library.widget.SVGAView;
|
||||
import com.example.lib_utils.ktx.ResourcesKtxKt;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
|
||||
public class Mic19ViewAdapter extends BaseMicroViewAdapter {
|
||||
|
||||
//麦位 从-1 开始的 , 所以 8好麦的pos是6
|
||||
int BossPos = 7;
|
||||
|
||||
public Mic19ViewAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LayoutManager and bind this to RecyclerView
|
||||
*/
|
||||
@Override
|
||||
public void bindToRecyclerView(RecyclerView recyclerView) {
|
||||
recyclerView.setLayoutManager(new BoosRoomLayoutManager(5));
|
||||
recyclerView.setAdapter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
OtherExtKt.doLog(" Mic19ViewAdapter onCreateViewHolder ");
|
||||
View item ;
|
||||
item = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_micro,parent,false);
|
||||
MicroViewHolder microViewHolder = new MicroViewHolder(item);
|
||||
return microViewHolder;
|
||||
}
|
||||
|
||||
private void setViewDiff(View[] views , boolean isDiff) {
|
||||
for (int i = 0; i <views.length; i++) {
|
||||
int width = 0;
|
||||
View view = views[i];
|
||||
//头像,锁头,上麦图 宽度
|
||||
if (isDiff) {
|
||||
width = ResourcesKtxKt.getDimensionToInt(R.dimen.dp_62);
|
||||
} else {
|
||||
width = ResourcesKtxKt.getDimensionToInt(R.dimen.dp_50);
|
||||
}
|
||||
|
||||
if (view instanceof SVGAView){
|
||||
// 头饰
|
||||
width = (int) (width / 0.7575);
|
||||
}else if (view instanceof SVGAImageView){
|
||||
//光圈
|
||||
width = (int) (width / 0.5555);
|
||||
}
|
||||
|
||||
OtherExtKt.setViewWH(view, width, width,false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String microType() {
|
||||
return BaseMicroViewAdapter.MICRO_TYPE_REVELRY_19;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position != BossPos ? TYPE_NORMAL : TYPE_BOSS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 19;
|
||||
}
|
||||
|
||||
class MicroViewHolder extends GiftValueViewHolder {
|
||||
MicroViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(RoomQueueInfo info, int position) {
|
||||
// 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);
|
||||
|
||||
super.bind(info, position);
|
||||
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void setDefalutText(int index) {
|
||||
super.setDefalutText(index);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
package com.chwl.app.avroom.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.core.bean.RoomQueueInfo;
|
||||
|
||||
public class Mic20ViewAdapter extends BaseMicroViewAdapter {
|
||||
|
||||
public Mic20ViewAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LayoutManager and bind this to RecyclerView
|
||||
*/
|
||||
@Override
|
||||
public void bindToRecyclerView(RecyclerView recyclerView) {
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(context,5,RecyclerView.VERTICAL,false));
|
||||
recyclerView.setAdapter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View item;
|
||||
item = LayoutInflater.from(parent.getContext()).
|
||||
inflate(R.layout.list_item_micro, parent, false);
|
||||
return new Mic20ViewAdapter.MicroViewHolder(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String microType() {
|
||||
return BaseMicroViewAdapter.MICRO_TYPE_REVELRY_20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return TYPE_NORMAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
class MicroViewHolder extends GiftValueViewHolder {
|
||||
MicroViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind(RoomQueueInfo info, int position) {
|
||||
super.bind(info, position);
|
||||
ivUpImage.setImageResource(R.drawable.icon_room_up_micro);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void setDefalutText(int index) {
|
||||
super.setDefalutText(index);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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
|
||||
|
@@ -50,6 +50,10 @@ public class UpMicAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
size = 10;
|
||||
} else if (AvRoomDataManager.get().isRevelryRoom()) {
|
||||
size = 15;
|
||||
}else if (AvRoomDataManager.get().is19Room()) {
|
||||
size = 19;
|
||||
} else if (AvRoomDataManager.get().is20Room()) {
|
||||
size = 20;
|
||||
} else {
|
||||
size = 9;
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@ import io.reactivex.disposables.Disposable;
|
||||
* @Description
|
||||
* @Date 2018/12/14
|
||||
*/
|
||||
//todo do 上麦逻辑
|
||||
public class MicQueueDialog extends BaseDialog implements
|
||||
LoadPageDataHelper.LoadData<List<QueuingMicMemeberInfo>>, View.OnClickListener {
|
||||
|
||||
|
@@ -803,6 +803,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
if (giftDialog != null) {
|
||||
giftDialog?.setOnDismissListener(null)
|
||||
giftDialog?.dismiss()
|
||||
giftDialog = null
|
||||
}
|
||||
super.onDestroyView()
|
||||
releaseView()
|
||||
unregisterWidgets()
|
||||
@@ -1383,7 +1388,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
if (giftDialog?.isShowing != true && !requireActivity().isFinishing) {
|
||||
EventBus.getDefault().post(GiftComboEvent(GiftComboEvent.Action.ACT_GIFT_POINT))
|
||||
EventBus.getDefault().post(GiftComboEvent(GiftComboEvent.Action.ACT_GIFT_DIALOG_DISMISS))
|
||||
giftDialog?.show()
|
||||
if (activity != null && activity?.isFinishing == false && activity?.isDestroyed == false && this@BaseRoomFragment.isAdded){
|
||||
if (AvRoomDataManager.get().hasAvRoomAct) {
|
||||
giftDialog?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -409,6 +409,16 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
tempFragment = RevelryRoomFragment.Companion.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOMTYPE_19_ROOM:
|
||||
if (!(tempFragment instanceof Room19Fragment)) {
|
||||
tempFragment = Room19Fragment.Companion.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOMTYPE_20_ROOM:
|
||||
if (!(tempFragment instanceof Room20Fragment)) {
|
||||
tempFragment = Room20Fragment.Companion.newInstance();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (tempFragment == null || !(tempFragment.getClass().getSimpleName().equals(HomePartyRoomFragment.class.getSimpleName()))) {
|
||||
tempFragment = HomePartyRoomFragment.newInstance();
|
||||
|
@@ -0,0 +1,33 @@
|
||||
package com.chwl.app.avroom.fragment
|
||||
|
||||
import com.chwl.app.avroom.adapter.BaseMicroViewAdapter
|
||||
import com.chwl.app.avroom.adapter.Mic19ViewAdapter
|
||||
import com.example.lib_utils.UiUtils
|
||||
import com.example.lib_utils.ktx.setMargin
|
||||
|
||||
/**
|
||||
* 十九麦房
|
||||
*/
|
||||
class Room19Fragment : HomePartyRoomFragment() {
|
||||
|
||||
companion object {
|
||||
fun newInstance(): Room19Fragment {
|
||||
return Room19Fragment()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
super.onFindViews()
|
||||
microView.setMargin(0, UiUtils.dip2px(30f),0,0)
|
||||
}
|
||||
|
||||
override fun updateMicroView() {
|
||||
val microType = if (microView.adapter == null) BaseMicroViewAdapter.MICRO_TYPE_NULL else microView.adapter.microType()
|
||||
if (microType != BaseMicroViewAdapter.MICRO_TYPE_REVELRY_19) {
|
||||
microView.bindAdapter(Mic19ViewAdapter(mContext))
|
||||
}
|
||||
if (microView.adapter != null) {
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package com.chwl.app.avroom.fragment
|
||||
|
||||
import com.chwl.app.avroom.adapter.BaseMicroViewAdapter
|
||||
import com.chwl.app.avroom.adapter.Mic20ViewAdapter
|
||||
import com.example.lib_utils.UiUtils
|
||||
import com.example.lib_utils.ktx.setMargin
|
||||
|
||||
/**
|
||||
* 二十麦房
|
||||
*/
|
||||
class Room20Fragment : HomePartyRoomFragment() {
|
||||
|
||||
companion object {
|
||||
fun newInstance(): Room20Fragment {
|
||||
return Room20Fragment()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
super.onFindViews()
|
||||
microView.setMargin(0, UiUtils.dip2px(30f),0,0)
|
||||
}
|
||||
|
||||
override fun updateMicroView() {
|
||||
val microType = if (microView.adapter == null) BaseMicroViewAdapter.MICRO_TYPE_NULL else microView.adapter.microType()
|
||||
if (microType != BaseMicroViewAdapter.MICRO_TYPE_REVELRY_20) {
|
||||
microView.bindAdapter(Mic20ViewAdapter(mContext))
|
||||
}
|
||||
if (microView.adapter != null) {
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,11 +16,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.lib_utils.UiUtils;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.avroom.adapter.BaseMicroViewAdapter;
|
||||
import com.chwl.app.avroom.adapter.DatingMicroViewAdapter;
|
||||
@@ -37,6 +32,11 @@ import com.chwl.core.noble.NobleUtil;
|
||||
import com.chwl.core.room.event.ReceiveFaceEvent;
|
||||
import com.chwl.core.room.face.FaceReceiveInfo;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.example.lib_utils.UiUtils;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -133,6 +133,16 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
subscribe.dispose();
|
||||
subscribe = null;
|
||||
}
|
||||
|
||||
if (recyclerView != null) {
|
||||
RecyclerView.Adapter adapter = recyclerView.getAdapter();
|
||||
if (adapter != null) {
|
||||
if (adapter instanceof BaseMicroViewAdapter) {
|
||||
((BaseMicroViewAdapter) adapter).setOnMicroItemClickListener(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@@ -216,6 +226,8 @@ 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;
|
||||
|
||||
// 如果 micCircle 没有值,表示 没有后台没有返回麦位光圈 且 他不是个播房 的 主播位 pos=0 , 那么 走默认光圈逻辑
|
||||
if (TextUtils.isEmpty(micCircle) && !isSingleAnchor) {
|
||||
//光圈的起始位置应该是头像边界,终止位置是头饰边界,头像:头饰=3:4
|
||||
boolean isNeedSetBackground = false;
|
||||
@@ -223,8 +235,7 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
if (speakState.getBackground() instanceof AnimationDrawable) {
|
||||
AnimationDrawable oldAnimationDrawable = (AnimationDrawable) speakState.getBackground();
|
||||
//因为设置了setOneShot属性,这里判断动画是否完成。
|
||||
if (oldAnimationDrawable.getCurrent() ==
|
||||
oldAnimationDrawable.getFrame(oldAnimationDrawable.getNumberOfFrames() - 1)) {
|
||||
if (oldAnimationDrawable.getCurrent() == oldAnimationDrawable.getFrame(oldAnimationDrawable.getNumberOfFrames() - 1)) {
|
||||
isNeedSetBackground = true;
|
||||
}
|
||||
} else {
|
||||
@@ -234,8 +245,8 @@ public class MicroView extends LinearLayout implements View.OnLayoutChangeListen
|
||||
isNeedSetBackground = true;
|
||||
}
|
||||
if (isNeedSetBackground) {
|
||||
AnimFactory.getSpeakingAnimation(mContext, speakState.getWidth(), speakState.getHeight(),
|
||||
NobleUtil.getColor(halo), speakState.getWidth() * 3 / 4)
|
||||
//todo do 房间默认 麦位光圈
|
||||
AnimFactory.getSpeakingAnimation(mContext, speakState.getWidth(), speakState.getHeight(), NobleUtil.getColor(halo), speakState.getWidth() * 3 / 4)
|
||||
.subscribe((animationDrawable, throwable) -> {
|
||||
speakState.setBackground(animationDrawable);
|
||||
animationDrawable.start();
|
||||
|
@@ -433,6 +433,11 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
if(playEffectList != null){
|
||||
playEffectList.clear();
|
||||
}
|
||||
|
||||
if (mDialogManager != null) {
|
||||
mDialogManager.dismissDialog();
|
||||
mDialogManager = null;
|
||||
}
|
||||
} catch (Exception e){
|
||||
Logger.i("关闭弹窗失败" + e.getMessage());
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@ package com.chwl.app.home.fragment
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.chwl.app.BuildConfig
|
||||
import com.chwl.app.DemoActivity
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.application.IReportConstants
|
||||
import com.chwl.app.application.ReportManager
|
||||
@@ -29,10 +31,19 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
|
||||
private fun initListener() {
|
||||
binding.tvSearch.setOnClickListener(this)
|
||||
binding.layoutTitleBar.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.layout_title_bar->{
|
||||
if (BuildConfig.DEBUG) {
|
||||
context?.let {
|
||||
DemoActivity.start(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
R.id.tv_search -> {
|
||||
//首页_搜索
|
||||
ReportManager.get().reportEvent(
|
||||
|
@@ -11,7 +11,6 @@ import android.view.View.OnLongClickListener
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.chwl.app.BuildConfig
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.UIHelper
|
||||
import com.chwl.app.application.IReportConstants
|
||||
@@ -36,7 +35,6 @@ import com.chwl.app.ui.relation.FansListActivity
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils
|
||||
import com.chwl.app.ui.wallet.WalletActivity
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||
import com.chwl.app.ui.widget.UserInfoDialog
|
||||
import com.chwl.app.utils.HomeUIManager
|
||||
import com.chwl.app.view.GenderAgeTextView
|
||||
import com.chwl.app.vip.VipCenterActivity
|
||||
@@ -372,37 +370,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
}
|
||||
|
||||
R.id.tv_user_name -> {
|
||||
//todo do 测试按钮
|
||||
if (BuildConfig.DEBUG) {
|
||||
|
||||
context?.let {
|
||||
// val url = "https://image.pekolive.com/boom3322.svga"
|
||||
// val url = "https://image.pekolive.com/kuaiting.png"
|
||||
// val url = "https://image.pekolive.com/4633_3Dlaosilaisi.mp4"
|
||||
// val view = EffectView(it)
|
||||
// view.elevation = 2f
|
||||
// mBinding.test.addView(view)
|
||||
// view.setViewWH(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT,false)
|
||||
// view.loadUrl(url);
|
||||
|
||||
|
||||
UserInfoDialog.showNewUserInfoDialog(
|
||||
mContext,
|
||||
AuthModel.get().currentUid
|
||||
)
|
||||
|
||||
// UIHelper.showAddInfoAct(it)
|
||||
|
||||
// CountrySelectDialog().apply {
|
||||
// isRegion = true
|
||||
// }.show(it)
|
||||
|
||||
// "特斯特特斯特".doLog()
|
||||
// LogUtil.d("特斯特特斯特")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
|
@@ -21,7 +21,7 @@ import com.chwl.library.utils.SingleToastUtil
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import io.reactivex.functions.Consumer
|
||||
|
||||
|
||||
//todo do 上麦逻辑
|
||||
class MicSelectDialog : BaseDialogFragment<DialogMicSelectBinding>() {
|
||||
|
||||
|
||||
|
@@ -1,4 +1,303 @@
|
||||
package com.chwl.app.ui.widget.recyclerview.layoutmanager
|
||||
|
||||
class BoosRoomLayoutManager {
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.chwl.core.utils.MyUtil
|
||||
import com.chwl.library.common.util.doLog
|
||||
|
||||
/**
|
||||
* 19 麦 管理器
|
||||
*/
|
||||
class BoosRoomLayoutManager : StaggeredGridLayoutManager {
|
||||
|
||||
var mSpanCount = 5
|
||||
var mAppWidth = -1
|
||||
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
constructor(spanCount: Int = 5): super(spanCount, RecyclerView.VERTICAL){
|
||||
mSpanCount = spanCount
|
||||
}
|
||||
|
||||
constructor(spanCount: Int = 5,appWidth: Int = MyUtil.mAppWidth): super(spanCount, RecyclerView.VERTICAL){
|
||||
mSpanCount = spanCount
|
||||
mAppWidth = appWidth
|
||||
}
|
||||
|
||||
|
||||
// 19 麦布局
|
||||
override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
|
||||
try {
|
||||
detachAndScrapAttachedViews(recycler)
|
||||
"onLayoutChildren 开始绘制 麦位".doLog()
|
||||
|
||||
val appWidth = if (mAppWidth != -1) mAppWidth else MyUtil.mAppWidth
|
||||
val width = (appWidth / mSpanCount).toInt()
|
||||
|
||||
if (itemCount == 0) return
|
||||
|
||||
var offsetX = 0 //横向 X轴的偏移量
|
||||
var offsetY = 0
|
||||
|
||||
|
||||
// 8 17 是特殊
|
||||
|
||||
for (i in 0 until itemCount) {
|
||||
val view = recycler.getViewForPosition(i)
|
||||
addView(view)
|
||||
|
||||
measureChildWithMargins(view, 0, 0)
|
||||
|
||||
val viewWidth = width
|
||||
var viewHeight = getDecoratedMeasuredHeight(view)
|
||||
if (viewHeight == 0) viewHeight = width
|
||||
|
||||
// view.setViewWH(width = viewWidth, isDP = false)
|
||||
|
||||
if (i == 14) {
|
||||
offsetX = 0
|
||||
"新的一行".doLog()
|
||||
}else if (i != 15 && i % mSpanCount == 0) {
|
||||
offsetX = 0
|
||||
"新的一行".doLog()
|
||||
}
|
||||
|
||||
|
||||
|
||||
val row = getRow(i)
|
||||
|
||||
|
||||
offsetY = viewHeight * (row-1)
|
||||
|
||||
"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))
|
||||
}else if (i == 12 || i == 13) {
|
||||
layoutDecorated(view, offsetX+viewWidth, offsetY, offsetX + viewWidth+viewWidth, offsetY+viewHeight)
|
||||
} else {
|
||||
layoutDecorated(view, offsetX, offsetY, offsetX + viewWidth, offsetY+viewHeight)
|
||||
}
|
||||
|
||||
offsetX += viewWidth
|
||||
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"19麦布局管理器 发生严重错误 onLayoutChildren e = ${e.printStackTrace()}"
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
override fun generateDefaultLayoutParams(): RecyclerView.LayoutParams {
|
||||
return RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//横轴排序
|
||||
// override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
|
||||
// detachAndScrapAttachedViews(recycler)
|
||||
//
|
||||
//
|
||||
// if (itemCount == 0) return
|
||||
//
|
||||
// var offsetX = 0 //横向 X轴的偏移量
|
||||
// var offsetY = 0
|
||||
//
|
||||
// for (i in 0 until itemCount) {
|
||||
// val view = recycler.getViewForPosition(i)
|
||||
// addView(view)
|
||||
//
|
||||
// measureChildWithMargins(view, 0, 0)
|
||||
//
|
||||
// val viewWidth = getDecoratedMeasuredWidth(view)
|
||||
// val viewHeight = getDecoratedMeasuredHeight(view)
|
||||
//
|
||||
//
|
||||
// " viewWidth = $viewWidth viewHeight = $viewHeight left = $offsetX top = $offsetY right = ${offsetX + viewWidth} bottom : ${viewHeight*(i+1)} ".doLog()
|
||||
//
|
||||
// layoutDecorated(view, offsetX, offsetY, offsetX + viewWidth, viewHeight*(i+1))
|
||||
//
|
||||
// offsetX += viewWidth + 10
|
||||
// offsetY = viewHeight*(i+1)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
//梯形排序
|
||||
// override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
|
||||
// detachAndScrapAttachedViews(recycler)
|
||||
//
|
||||
//
|
||||
// if (itemCount == 0) return
|
||||
//
|
||||
// var offsetX = 0 //横向 X轴的偏移量
|
||||
// var offsetY = 0
|
||||
//
|
||||
// var itemWidth = 50
|
||||
// var itemHeight = 50
|
||||
//
|
||||
// for (i in 0 until itemCount) {
|
||||
// val view = recycler.getViewForPosition(i)
|
||||
// addView(view)
|
||||
//
|
||||
//
|
||||
// val currentItemWidth = (itemWidth * 1.5).toInt()
|
||||
// val currentItemHeight = (itemHeight * 1.5).toInt()
|
||||
//
|
||||
// val widthSpec = View.MeasureSpec.makeMeasureSpec(currentItemWidth,View.MeasureSpec.EXACTLY)
|
||||
// val heightSpec = View.MeasureSpec.makeMeasureSpec(currentItemHeight,View.MeasureSpec.EXACTLY)
|
||||
//
|
||||
//
|
||||
// measureChildWithMargins(view, widthSpec, heightSpec)
|
||||
//
|
||||
// val viewWidth = currentItemWidth
|
||||
// val viewHeight = currentItemHeight
|
||||
//
|
||||
//
|
||||
// " viewWidth = $viewWidth viewHeight = $viewHeight left = $offsetX top = $offsetY right = ${offsetX + viewWidth} bottom : ${offsetY+viewHeight} ".doLog()
|
||||
//
|
||||
// layoutDecorated(view, offsetX, offsetY, offsetX + viewWidth, offsetY+viewHeight)
|
||||
//
|
||||
// offsetX += viewWidth + 10
|
||||
// offsetY = offsetY+viewHeight
|
||||
//
|
||||
// itemWidth = currentItemWidth
|
||||
// itemHeight = currentItemHeight
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// 网格排序 - 均分
|
||||
// override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
|
||||
// detachAndScrapAttachedViews(recycler)
|
||||
// "onLayoutChildren 开始绘制 麦位".doLog()
|
||||
//
|
||||
// val width = (MyUtil.mAppWidth / mSpanCount).toInt()
|
||||
//
|
||||
// if (itemCount == 0) return
|
||||
//
|
||||
// var offsetX = 0 //横向 X轴的偏移量
|
||||
// var offsetY = 0
|
||||
//
|
||||
//
|
||||
// // 8 17 是特殊
|
||||
//
|
||||
// for (i in 0 until itemCount) {
|
||||
// val view = recycler.getViewForPosition(i)
|
||||
// addView(view)
|
||||
//
|
||||
// measureChildWithMargins(view, 0, 0)
|
||||
//
|
||||
// val viewWidth = width
|
||||
// var viewHeight = getDecoratedMeasuredHeight(view)
|
||||
// if (viewHeight == 0) viewHeight = width
|
||||
//
|
||||
// if (i % mSpanCount == 0) {
|
||||
// offsetX = 0
|
||||
// "新的一行".doLog()
|
||||
// }
|
||||
//
|
||||
// val posRowColumns = MyUtil.getPosRowColumns(i, mSpanCount)
|
||||
// val row = posRowColumns[0]
|
||||
// val col = posRowColumns[1]
|
||||
//
|
||||
// offsetY = viewHeight * (row-1)
|
||||
//
|
||||
// "pos = $i row = $row col = $col viewWidth = $viewWidth viewHeight = $viewHeight left = $offsetX top = $offsetY right = ${offsetX + viewWidth} bottom : ${offsetY+viewHeight} appWidth=${MyUtil.mAppWidth}".doLog()
|
||||
//
|
||||
// layoutDecorated(view, offsetX, offsetY, offsetX + viewWidth, offsetY+viewHeight)
|
||||
//
|
||||
// offsetX += viewWidth
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
// //网格布局 - 不均分
|
||||
// override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
|
||||
// detachAndScrapAttachedViews(recycler)
|
||||
//
|
||||
//
|
||||
// val width = (MyUtil.mAppWidth / mSpanCount).toInt()
|
||||
//
|
||||
// if (itemCount == 0) return
|
||||
//
|
||||
// var offsetX = 0 //横向 X轴的偏移量
|
||||
// var offsetY = 0
|
||||
//
|
||||
// for (i in 0 until itemCount) {
|
||||
// val view = recycler.getViewForPosition(i)
|
||||
// addView(view)
|
||||
//
|
||||
// measureChildWithMargins(view, 0, 0)
|
||||
//
|
||||
// val viewWidth = getDecoratedMeasuredWidth(view)
|
||||
// var viewHeight = getDecoratedMeasuredHeight(view)
|
||||
//
|
||||
// if (i % mSpanCount == 0) {
|
||||
// offsetX = 0
|
||||
// "新的一行".doLog()
|
||||
// }
|
||||
//
|
||||
// val posRowColumns = MyUtil.getPosRowColumns(i, mSpanCount)
|
||||
// val row = posRowColumns[0]
|
||||
// val col = posRowColumns[1]
|
||||
//
|
||||
// offsetY = viewHeight * (row-1)
|
||||
//
|
||||
// "pos = $i row = $row col = $col viewWidth = $viewWidth viewHeight = $viewHeight left = $offsetX top = $offsetY right = ${offsetX + viewWidth} bottom : ${offsetY+viewHeight} ".doLog()
|
||||
//
|
||||
// layoutDecorated(view, offsetX, offsetY, offsetX + viewWidth, offsetY+viewHeight)
|
||||
//
|
||||
// offsetX += viewWidth
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
override fun onScrollStateChanged(state: Int) {
|
||||
try {
|
||||
super.onScrollStateChanged(state)
|
||||
} catch (e: Exception) {
|
||||
"19麦布局管理器 发生严重错误 onScrollStateChanged e = ${e.printStackTrace()}"
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRow(pos:Int) :Int {
|
||||
return if (pos < 5){
|
||||
1
|
||||
} else if (pos == 5 || pos == 6 || pos == 8 || pos == 9) {
|
||||
2
|
||||
} else if (pos == 10 || pos == 11 || pos == 12 || pos == 13) {
|
||||
3
|
||||
}else if (pos>13) {
|
||||
4
|
||||
} else {
|
||||
2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
package com.chwl.app.ui.widget.recyclerview.layoutmanager
|
||||
|
||||
class BossRoomLayoutManager2 {
|
||||
}
|
@@ -31,7 +31,7 @@ import com.tencent.qgame.animplayer.AnimView
|
||||
import com.tencent.qgame.animplayer.inter.IAnimListener
|
||||
import java.io.File
|
||||
import java.util.LinkedList
|
||||
|
||||
//toFix 后续可优化,在队列新建弹窗时 加入复用池,减去重复创建消耗
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object RoomBoomManager {
|
||||
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/ic_room_level_top_bg.png
Normal file
After Width: | Height: | Size: 188 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_10_n.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_10_s.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_15_n.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_15_s.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_19_n.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_19_s.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_20_n.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_20_s.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_9_n.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_room_mic_type_9_s.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_fold_down.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_fold_up.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
18
app/src/main/res/drawable/bar_room_level_progress.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<solid android:color="@color/white_transparent_20"/>
|
||||
<corners android:radius="25dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<solid android:color="@color/white"/>
|
||||
<corners android:radius="25dp"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
@@ -1,6 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingVertical="50dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|top"
|
||||
android:background="@color/black" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:id="@+id/layout"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/black"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
|
||||
</FrameLayout>
|
@@ -6,6 +6,12 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.chwl.app.MainActivity">
|
||||
|
||||
<View
|
||||
android:id="@+id/rootWidth"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/main_fragment"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -1,6 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@color/black">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:layout_margin="5dp"
|
||||
android:background="#ff0000" />
|
||||
|
||||
</FrameLayout>
|
56
app/src/main/res/layout/item_room_mode.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_marginHorizontal="3.5dp"
|
||||
android:layout_marginBottom="7dp"
|
||||
tools:background="@color/black">
|
||||
|
||||
<!-- ff8c03 -->
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:dt_drawableType="shape"
|
||||
app:dt_radius="15dp"
|
||||
app:dt_strikeColor="#1b1b1d"
|
||||
app:dt_soildColor="#1b1b1d"
|
||||
app:dt_strikeWidth="1dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/drees"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:background="@color/red_font">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivType"
|
||||
android:layout_width="88dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="72dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSkins"
|
||||
android:layout_width="50dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="50dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivEffect"
|
||||
android:layout_width="73dp"
|
||||
android:visibility="gone"
|
||||
android:layout_height="73dp"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -1,190 +1,202 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_gravity="center"
|
||||
android:id="@+id/rootView"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
tools:background="@color/blue">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/micro_layout"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:layout_gravity="center"
|
||||
android:clipToPadding="false"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:background="#3c3c3c">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
tools:background="#313131">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_halo"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_gravity="center" />
|
||||
<FrameLayout
|
||||
android:id="@+id/micro_layout"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_66"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:background="#3F51B5">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:background="#FF0"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_up_micro"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lock_image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_lock_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<com.chwl.library.widget.SVGAView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_charm_level_tag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_9" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center">
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_halo"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
tools:layout_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mute_image"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_room_mute_micro"
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:background="#FF0"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/up_image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_room_up_micro"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_kick_guard"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:id="@+id/lock_image"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_kick_guard"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
android:src="@drawable/icon_room_lock_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
<com.chwl.library.widget.SVGAView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_face"
|
||||
android:layout_width="@dimen/dp_75"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_gravity="center" />
|
||||
<ImageView
|
||||
android:id="@+id/iv_charm_level_tag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_9" />
|
||||
|
||||
</FrameLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_pk_mark"
|
||||
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"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_list_item_micro_01"
|
||||
tools:visibility="visible" />
|
||||
<ImageView
|
||||
android:id="@+id/mute_image"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_room_mute_micro"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_kick_guard"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_kick_guard"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
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"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_number"-->
|
||||
<!-- android:layout_width="@dimen/dp_11"-->
|
||||
<!-- android:layout_height="@dimen/dp_11"-->
|
||||
<!-- android:background="@drawable/icon_bg_number_default"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:includeFontPadding="false"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/dp_7"-->
|
||||
<!-- tools:text="1" />-->
|
||||
<ImageView
|
||||
android:id="@+id/iv_face"
|
||||
android:layout_width="@dimen/dp_75"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:id="@+id/tv_pk_mark"
|
||||
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"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_list_item_micro_01"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/dp_2"
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10"
|
||||
tools:text="@string/layout_list_item_micro_02"
|
||||
tools:textColor="@color/white" />
|
||||
android:layout_below="@id/micro_layout"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_number"-->
|
||||
<!-- android:layout_width="@dimen/dp_11"-->
|
||||
<!-- android:layout_height="@dimen/dp_11"-->
|
||||
<!-- android:background="@drawable/icon_bg_number_default"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:includeFontPadding="false"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/dp_7"-->
|
||||
<!-- tools:text="1" />-->
|
||||
|
||||
<LinearLayout
|
||||
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"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:background="@drawable/shape_bg_of_mic_charm"
|
||||
android:paddingStart="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_2">
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="@dimen/dp_2"
|
||||
android:paddingEnd="@dimen/dp_2"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10"
|
||||
tools:text="@string/layout_list_item_micro_02"
|
||||
tools:textColor="@color/white" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_gift_value" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm_value"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_charm_click"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_below="@id/ll_nick"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:background="@drawable/shape_bg_of_mic_charm"
|
||||
android:paddingStart="@dimen/dp_3"
|
||||
android:paddingEnd="@dimen/dp_2">
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_gift_value" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -4,157 +4,228 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F8F8FA">
|
||||
android:background="@color/black">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
<com.chwl.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
<ImageView
|
||||
android:id="@+id/btnMore"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/ic_cp_list_more"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/title_bar" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btnConfirm"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30" />
|
||||
</FrameLayout>
|
||||
android:layout_gravity="top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_selected"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:background="@drawable/ic_room_level_top_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="79dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nick"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="loading..."
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/levelIcon"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintStart_toStartOf="@id/nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/nick"
|
||||
tools:src="@drawable/ic_charm_level" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roomValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="loading..."
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="@id/nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/levelIcon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/roomAdmin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="loading..."
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="@id/nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/roomValue" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/currentLevel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="@id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar"
|
||||
tools:text="LV.91" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nextLevel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="@id/nick"
|
||||
app:layout_constraintTop_toBottomOf="@id/avatar"
|
||||
tools:text="LV.91" />
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/proExp"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:progressDrawable="@drawable/bar_room_level_progress"
|
||||
app:layout_constraintTop_toBottomOf="@id/currentLevel"
|
||||
tools:max="100"
|
||||
tools:progress="50" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nextExp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white_transparent_80"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/proExp" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/room_type"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:text="@string/Mic_Skin"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListSkins"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:text="@string/Mic_Effect"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListEffects"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="12.5dp"
|
||||
android:layout_marginTop="14dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/btnConfirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_type_bg_9"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_bottom_bg"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_title_bar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bottom_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_9" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_9"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_3"
|
||||
android:src="@drawable/room_type_ic_9"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_9"
|
||||
app:layout_constraintDimensionRatio="79:142"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_10"
|
||||
app:layout_constraintHeight_percent="0.17"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_10"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/room_type_ic_10"
|
||||
app:layout_constraintDimensionRatio="79:142"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_15"
|
||||
app:layout_constraintHeight_percent="0.17"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_9"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_9" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_15"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:src="@drawable/room_type_ic_15"
|
||||
app:layout_constraintDimensionRatio="79:142"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_percent="0.17"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_10"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_9" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_9_border"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/room_type_item_selected"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_9"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_9"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_9"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_9"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_10_border"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/room_type_item_selected"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_10"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_10"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_10"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_10"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_15_border"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/room_type_item_selected"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_15"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_15"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_15"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_15"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_25"
|
||||
android:text="@string/room_type_classic"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_submit"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_9"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_9" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/room_type_party"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_10"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_10"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_9" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/room_type_revelry"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_15"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_15"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_9" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_36"
|
||||
android:layout_marginBottom="@dimen/dp_30"
|
||||
android:background="@drawable/base_shape_theme_24dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/room_type_use"
|
||||
android:text="@string/Use"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_17"
|
||||
app:dt_drawableType="shape"
|
||||
app:dt_endColor="#fcc074"
|
||||
app:dt_radius="117dp"
|
||||
app:dt_startColor="#e29030"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -5238,7 +5238,7 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="photo_album_empty_tips">No photos yet</string>
|
||||
<string name="gift_empty_tips">No gifts yet</string>
|
||||
<string name="medal">Medal</string>
|
||||
<string name="room_type">Room type</string>
|
||||
<string name="room_type">Room Type</string>
|
||||
<string name="switch_room_type_tips">After the setting is completed, members who are out of the microphone order will be removed. Do you confirm the setting?</string>
|
||||
<string name="room_type_classic">Klasik</string>
|
||||
<string name="room_type_party">Party</string>
|
||||
@@ -5376,6 +5376,23 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="brvah_load_failed">Loading failed</string>
|
||||
<string name="brvah_loading">Loading…</string>
|
||||
|
||||
|
||||
|
||||
|
||||
<string name="Use">Use</string>
|
||||
<string name="Room_Mode">Room Mode</string>
|
||||
<string name="Room_Value_s">Room Value:%s</string>
|
||||
<string name="Room_Admin_s">Room Admin:%s</string>
|
||||
<string name="Next_LV_EXP_s">Next LV : %s</string>
|
||||
<string name="LV_s">Lv.%s</string>
|
||||
<string name="Mic_Skin">Mic Skin</string>
|
||||
<string name="Mic_Effect">Mic Effect</string>
|
||||
<string name="Classic">Classic</string>
|
||||
<string name="Party">Party</string>
|
||||
<string name="Carnival">Carnival</string>
|
||||
<string name="Celebration">Celebration</string>
|
||||
<string name="Unique">Unique</string>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
|
@@ -1,11 +1,10 @@
|
||||
package com.chwl.app.game.data
|
||||
|
||||
import com.chwl.core.base.BaseModel
|
||||
import com.chwl.core.bean.game.GameConfigBean
|
||||
import com.chwl.core.bean.game.GameRoomInfo
|
||||
import com.chwl.core.base.BaseModel
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.bean.room.BaseRoomInfo
|
||||
import com.chwl.core.home.bean.*
|
||||
import com.chwl.core.pay.PayModel
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.core.utils.net.launchRequest
|
||||
@@ -28,7 +27,7 @@ object GameModel2 : BaseModel() {
|
||||
|
||||
fun getResumeGameRoomInfo(): Single<GameRoomInfo?> {
|
||||
return api.getResumeGameRoom()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleCommon(RxHelper.NullHandle { return@NullHandle GameRoomInfo() }))
|
||||
.compose(RxHelper.handleSchAndExce())
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,5 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public class RoomLevelDressBase {
|
||||
public boolean isSelect;
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomLevelInfo {
|
||||
|
||||
public double currentLevelExp;
|
||||
public int currentLevel;
|
||||
public String currentLevelIcon;
|
||||
|
||||
public List<RoomLevelMicEffects> micEffects;
|
||||
public List<RoomLevelMicSkins> micSkins;
|
||||
|
||||
public double nextLevelExp;
|
||||
public int nextLevel;
|
||||
public double roomVal;
|
||||
public int userMicEffectsId;
|
||||
public int userMicSkinsId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
@@ -813,6 +813,7 @@ public final class AvRoomDataManager {
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
// 添加麦位信息
|
||||
public void addRoomQueueInfo(String micPosition, RoomQueueInfo roomQueueInfo) {
|
||||
if (roomQueueInfo == null || roomQueueInfo.mChatRoomMember == null) return;
|
||||
Integer position = Integer.valueOf(micPosition);
|
||||
@@ -843,6 +844,7 @@ public final class AvRoomDataManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 添加麦位信息
|
||||
public void replaceMicQueue(SparseArray<RoomQueueInfo> queue) {
|
||||
if (queue == null) {
|
||||
return;
|
||||
@@ -1110,6 +1112,12 @@ public final class AvRoomDataManager {
|
||||
public boolean isHomeParty() {
|
||||
return mCurrentRoomInfo != null && mCurrentRoomInfo.getType() == RoomInfo.ROOMTYPE_HOME_PARTY;
|
||||
}
|
||||
public boolean is19Room() {
|
||||
return mCurrentRoomInfo != null && mCurrentRoomInfo.getType() == RoomInfo.ROOMTYPE_19_ROOM;
|
||||
}
|
||||
public boolean is20Room() {
|
||||
return mCurrentRoomInfo != null && mCurrentRoomInfo.getType() == RoomInfo.ROOMTYPE_20_ROOM;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -1,14 +1,15 @@
|
||||
package com.chwl.core.radish;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.base.BaseModel;
|
||||
import com.chwl.core.bean.response.ServiceResult;
|
||||
import com.chwl.core.pay.PayModel;
|
||||
import com.chwl.core.radish.event.RadishWalletInfoUpdateEvent;
|
||||
import com.chwl.core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
import com.chwl.library.net.rxnet.RxNet;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -88,7 +89,7 @@ public class RadishModel extends BaseModel implements IRadishModel {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLoadLoginUserInfoEvent(LoadLoginUserInfoEvent event) {
|
||||
updateRadishWallet().subscribe();
|
||||
PayModel.get().getWalletInfo();
|
||||
}
|
||||
|
||||
interface Api {
|
||||
|
@@ -29,6 +29,8 @@ public class RoomInfo implements Parcelable,Serializable {
|
||||
public static final int ROOMTYPE_GAME = 7;//游戏房
|
||||
public static final int ROOMTYPE_PARTY = 8;//聚会房
|
||||
public static final int ROOMTYPE_REVELRY = 9;//狂欢房
|
||||
public static final int ROOMTYPE_19_ROOM = 19;//19麦位房间
|
||||
public static final int ROOMTYPE_20_ROOM = 20;//20麦位房间
|
||||
|
||||
public static final String DATING_STATE_FLOW = "1";//嘉宾交流
|
||||
public static final String DATING_STATE_SELECT = "2";//心动选人
|
||||
|
23
core/src/main/java/com/chwl/core/utils/MyUtil.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.chwl.core.utils
|
||||
|
||||
import android.view.View
|
||||
|
||||
object MyUtil {
|
||||
var mAppWidth = 0
|
||||
|
||||
|
||||
fun initAppWidth(view: View?) {
|
||||
view?.post {
|
||||
mAppWidth = view.width
|
||||
}
|
||||
}
|
||||
|
||||
fun getPosRowColumns(pos:Int,col:Int) : Array<Int>{
|
||||
val row = pos / col
|
||||
val column = pos % col
|
||||
return arrayOf(row+1,col+1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -3,13 +3,6 @@ package com.chwl.core.utils.net;
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.trello.rxlifecycle3.LifecycleProvider;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.trello.rxlifecycle3.components.RxActivity;
|
||||
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
||||
import com.chwl.core.R;
|
||||
import com.chwl.core.XConstants;
|
||||
import com.chwl.core.bean.response.ServiceResult;
|
||||
@@ -18,6 +11,13 @@ import com.chwl.core.patriarch.exception.PmRoomLimitException;
|
||||
import com.chwl.core.super_admin.model.exception.SAdminCannotGameException;
|
||||
import com.chwl.library.rxbus.RxBus;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.trello.rxlifecycle3.LifecycleProvider;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.trello.rxlifecycle3.components.RxActivity;
|
||||
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -83,6 +83,27 @@ public class RxHelper {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 这里简单对接口脱掉外层,不适合成功情况下没有data字段的接口使用
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> SingleTransformer<ServiceResult<T>, T> handleBeanData3() {
|
||||
return upstream -> upstream
|
||||
.flatMap(result -> {
|
||||
if (result.isSuccess()) {
|
||||
if (result.getData() != null) {
|
||||
return Single.just(result.getData());
|
||||
} else {
|
||||
return Single.error(new ServerException("",500));
|
||||
}
|
||||
} else {
|
||||
return Single.error(new ServerException(getValidMessage(result), result.getCode()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public interface NullHandle<T> {
|
||||
T createT();
|
||||
|
@@ -32,8 +32,8 @@ COMPILE_SDK_VERSION=34
|
||||
MIN_SDK_VERSION=21
|
||||
TARGET_SDK_VERSION=34
|
||||
|
||||
version_name=1.0.17
|
||||
version_code=28
|
||||
version_name=1.0.22
|
||||
version_code=36
|
||||
|
||||
#systemProp.https.proxyHost=127.0.0.1
|
||||
#systemProp.https.proxyPort=7890
|
||||
|
@@ -54,16 +54,18 @@ fun View.setMargin(start:Int?=null,top:Int?=null,end:Int?=null,bottom:Int?=null,
|
||||
|
||||
|
||||
fun View.setViewWH(width:Int?=null, height:Int?=null,isDP:Boolean = true) {
|
||||
val lp = this.layoutParams
|
||||
if (lp != null && lp is ViewGroup.LayoutParams){
|
||||
if (width != null) {
|
||||
lp.width = if (isDP)SizeUtils.dp2px(this.context,width.toFloat()) else width
|
||||
// this.post {
|
||||
val lp = this.layoutParams
|
||||
if (lp != null && lp is ViewGroup.LayoutParams){
|
||||
if (width != null) {
|
||||
lp.width = if (isDP)SizeUtils.dp2px(this.context,width.toFloat()) else width
|
||||
}
|
||||
if (height != null) {
|
||||
lp.height = if (isDP) SizeUtils.dp2px(this.context,height.toFloat()) else height
|
||||
}
|
||||
this.layoutParams = lp
|
||||
}
|
||||
if (height != null) {
|
||||
lp.height = if (isDP) SizeUtils.dp2px(this.context,height.toFloat()) else height
|
||||
}
|
||||
this.layoutParams = lp
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
fun View.setVis(isVis:Boolean,isInVis:Boolean = false) {
|
||||
@@ -137,6 +139,16 @@ fun String?.doLog() {
|
||||
}
|
||||
}
|
||||
}
|
||||
fun String?.doLogW() {
|
||||
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.WARN, "doLog", "$this at ($fileName:$line)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.doToast() {
|
||||
val string = this.getString()
|
||||
|
@@ -95,8 +95,8 @@ fun Int.getDimension(): Float {
|
||||
return AppUtils.getApp().resources.getDimension(this)
|
||||
}
|
||||
|
||||
fun Int.dimToPx(): Float {
|
||||
return AppUtils.getApp().resources.getDimension(this).toDP()
|
||||
fun Int.getDimensionToInt(): Int {
|
||||
return this.getDimension().toInt()
|
||||
}
|
||||
|
||||
/**
|
||||
|
91
mode.json
@@ -1,52 +1,47 @@
|
||||
{
|
||||
"code": 200,
|
||||
"message": "success",
|
||||
"data": [
|
||||
{
|
||||
"id": 6,
|
||||
"name": "Hot",
|
||||
"seq": 1
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"name": "New",
|
||||
"seq": 2
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"name": "ماليزيا",
|
||||
"seq": 3
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"name": "Egypt",
|
||||
"seq": 3
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"name": "Turkey",
|
||||
"seq": 3
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"name": "Azerbaijan",
|
||||
"seq": 4
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"name": "Singapore",
|
||||
"seq": 4
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"name": "Cyprus",
|
||||
"seq": 5
|
||||
},
|
||||
{
|
||||
"id": 24,
|
||||
"name": "تايوان",
|
||||
"seq": 5
|
||||
}
|
||||
],
|
||||
"timestamp": 1734520059020
|
||||
"data": {
|
||||
"roomVal": 60576.5,
|
||||
"currentLevelIcon": "https://image.pekolive.com/63room_lv.png",
|
||||
"currnetLevel": 63,
|
||||
"currentLevelExp": 0,
|
||||
"nextLevel": 0,
|
||||
"nextLevelExp": 0,
|
||||
"micEffects": [
|
||||
{
|
||||
"id": 4,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micEffect1.svga"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micEffect2.svga"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micEffect3.svga"
|
||||
}
|
||||
],
|
||||
"micSkins": [
|
||||
{
|
||||
"id": 1,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micSkin1.png"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micSkin2.png"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"reachLevel": 1,
|
||||
"dressUrl": "https://image.pekolive.com/micSkin3.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timestamp": 1734946769207
|
||||
}
|
||||
|