国际化:未被批量替换的简体中文改为繁体

This commit is contained in:
huangjian
2022-10-14 16:17:04 +08:00
parent f5496a3486
commit 59b2374910
35 changed files with 780 additions and 780 deletions

View File

@@ -100,13 +100,13 @@ class DatingMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context)
) {
tvSelectedStatus.text =
if (AvRoomDataManager.get().isDatingVipMic(it.selectMicPosition)
) ResUtil.getString(R.string.avroom_adapter_datingmicroviewadapter_01) else "${it.selectMicPosition + 1}"
) ResUtil.getString(R.string.avroom_adapter_datingmicroviewadapter_01) else "${it.selectMicPosition + 1}"
} else {
tvSelectedStatus.text = "选择"
tvSelectedStatus.text = "選擇"
}
} else {
tvSelectedStatus.isSelected = false
tvSelectedStatus.text = "选择"
tvSelectedStatus.text = "選擇"
}
}
@@ -128,7 +128,7 @@ class DatingMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context)
if (AvRoomDataManager.POSITION_VIP_MIC == position) {
tvNick.text = ""
} else if (position != -1) {
tvNick.text = "${if (manMicro) "男神" else "女神"}"
tvNick.text = "${if (manMicro) "男神" else "女神"}"
}
}

View File

@@ -129,7 +129,7 @@ class RoomPKCreateActivity : BaseViewBindingActivity<ActivityRoomPkCreateBinding
binding.llPkRoom.isVisible = true
ImageLoadUtils.loadImage(this, it.avatar, binding.ivAvatar)
binding.tvRoomTitle.text = it.title.subAndReplaceDot(7)
binding.tvRoomId.text = "Peko:${it.erbanNo}"
binding.tvRoomId.text = "Peko:${it.erbanNo}"
checkCommitEnable()
}
}

View File

@@ -11,9 +11,9 @@ class RoomPKSearchAdapter :
BaseQuickAdapter<SimpleRoomInfo, BaseViewHolder>(R.layout.item_room_pk_search) {
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
.setText(R.id.tv_room_id,"Peko号:${item.erbanNo}")
.setChecked(R.id.check_box,item.checked)
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
.setText(R.id.tv_room_id,"Peko号:${item.erbanNo}")
.setChecked(R.id.check_box,item.checked)
ImageLoadUtils.loadImage(mContext,item.avatar,helper.getView(R.id.iv_avatar))
helper.addOnClickListener(R.id.iv_avatar,R.id.check_box)
}

View File

@@ -37,7 +37,7 @@ class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
@SuppressLint("CheckResult")
override fun init() {
binding.tvNick.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
binding.tvTime.text = "${pkBean.pkDuration}"
binding.tvTime.text = "${pkBean.pkDuration}"
pkBean.pkDesc.ifNotNullOrEmpty {
binding.tvDescTitle.isVisible = true
binding.tvDesc.isVisible = true
@@ -66,7 +66,7 @@ class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
RoomPKModel.acceptRoomPK(accept, AvRoomDataManager.get().roomUid, pkBean.roundId)
.compose(bindToLifecycle())
.subscribe({
//"接受PK邀成功".toast()
//"接受PK邀成功".toast()
dismissAllowingStateLoss()
}, {
it.message.toast()

View File

@@ -121,8 +121,8 @@ import org.greenrobot.eventbus.ThreadMode
/**
* 房间基类,这里实现了一些房间基础功能
* 如消息、公屏、底部按等等...
* 房間基類,這裏實現了一些房間基礎功能
* 如消息、公屏、底部按等等...
*
* @author chenran
* @date 2017/7/26
@@ -148,24 +148,24 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
protected var isDatingMode = false
/**
* 快捷
* 快捷
*/
private var lastSendTime: Long = 0
/**
* 是否开启礼物值
* 是否開啟禮物值
*/
private var showGiftValue = false
private var redPackageSendDialog: RedPackageSendDialog? = null
private val mOnSoftKeyBoardChangeListener: OnSoftKeyBoardChangeListener =
object : OnSoftKeyBoardChangeListener {
override fun keyBoardShow(height: Int) {
/*软键盘显示:执行隐藏title动画,并修改listview高度和装载礼物容器的高度*/
/*軟鍵盤顯示:執行隱藏title動畫,並修改listview高度和裝載禮物容器的高度*/
}
override fun keyBoardHide(height: Int) {
/*软键盘隐藏:藏聊天入框并显示聊天按钮,执行显示title动画,并修改listview高度和装载礼物容器的高度*/
/*軟鍵盤隱藏:藏聊天入框並顯示聊天按鈕,執行顯示title動畫,並修改listview高度和裝載禮物容器的高度*/
inputLayout.visibility = View.GONE
}
}
@@ -225,7 +225,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
@SuppressLint("CheckResult")
@CallSuper
override fun initiate() {
//如果不需要开麦,并且还没有权限的情下,重置状态为需要去打开麦克风
//如果不需要開麥,並且還沒有權限的情下,重置狀態為需要去打開麥克風
myUid = AuthModel.get().currentUid
isCloseScreen = AvRoomDataManager.get().isCloseScreen
isOpenRedPackage = AvRoomDataManager.get().isOpenRedPackage
@@ -245,7 +245,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
mvpPresenter?.chatRoomReConnect(IMNetEaseManager.get().mCacheRoomQueueInfo)
}
// 接收公屏消息点击 可点击房间编辑页查看 事件
// 接收公屏消息點擊 可點擊房間編輯頁查看 事件
RxBus.get().toFlowable(OpenRoomIntroEvent::class.java)
.compose(bindToLifecycle())
.subscribe { showRoomIntroduction(false) }
@@ -260,7 +260,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
.observeOn(AndroidSchedulers.mainThread())
.subscribe { showUserCardDialog(it.uid) }
// 刷新物列表,取房间专属礼物列表
// 刷新物列表,取房間專屬禮物列表
GiftModel.get().refreshGiftList(AvRoomDataManager.get().roomUid.toString()).subscribe()
checkFollowOwner()
mvpPresenter?.loadRoomRank()
@@ -277,19 +277,19 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
val event = roomEvent.event
when (event) {
RoomEvent.ROOM_CHAT_RECONNECTION -> {
// 重新调服务器的userroom/inV2保持座位上有
// 重新調服務器的userroom/inV2保持座位上有
mvpPresenter?.userRoomIn()
//从新获取队列信息
//從新獲取隊列信息
mvpPresenter?.chatRoomReConnect(roomEvent.roomQueueInfo)
//如果用户在麦上的话,会重新上一次,如果不在上,自行更新
//如果用戶在麥上的話,會重新上一次,如果不在上,自行更新
if (RxNetWorkUtils.isAvailable(mContext) && !AvRoomDataManager.get().isOwnerOnMic) {
GiftValueMrg.get().handleReconnect(false)
}
}
RoomEvent.ROOM_EXIT -> {
// 退出房,把标志置为 false
// 退出房,把標誌置為 false
AvRoomDataManager.get().isFromMentoring = false
// 退出房间的时候,要停止倒计时
// 退出房間的時候,要停止倒計時
EventBus.getDefault().post(MentoringStopCountingEvent())
}
RoomEvent.DOWN_CROWDED_MIC -> if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
@@ -349,7 +349,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
AvRoomDataManager.get().removeChatRoomMember(roomEvent.account.toString())
}
// 用户的贵族字段期或者开通贵族,可以实时地监听ext字段化,显示头饰,光
// 用戶的貴族字段期或者開通貴族,可以實時地監聽ext字段化,顯示頭飾,光
RoomEvent.ON_QUEUE_MEMBER_INFO_UPDATE -> microView.adapter.notifyDataSetChanged()
RoomEvent.OTHER_KICK_OUT_ROOM,
RoomEvent.OTHER_ADD_BLACK,
@@ -365,7 +365,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 开启或关闭公屏
* 開啟或關閉公屏
*/
private fun updateScreen() {
if (AvRoomDataManager.get().mCurrentRoomInfo == null ||
@@ -388,14 +388,14 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 嗨聊房切重置公屏消息(绿色公告)
* 嗨聊房切重置公屏消息(色公告)
*/
private fun addMessage(msg: ChatRoomMessage?) {
AvRoomDataManager.get().addChatRoomMessage(msg)
}
/**
* 开启或关闭礼物值
* 開啟或關閉禮物值
*/
private fun openOrCloseGiftValue(isEnterRoom: Boolean) {
if (AvRoomDataManager.get().isOpenKTV || AvRoomDataManager.get().isCpRoom) {
@@ -412,7 +412,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
// 放公屏和上的所有信息信息和动画
// 放公屏和上的所有信息信息和動畫
val roomUid = intent.getLongExtra(Constants.ROOM_UID, 0)
if (roomUid != 0L && roomUid != AvRoomDataManager.get().mCurrentRoomInfo?.uid) {
releaseView()
@@ -426,7 +426,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
) {
if (!ListUtils.isListEmpty(dialogInfo)) {
rollPagerView.visibility = View.VISIBLE
// 只有一个图标,隐藏底部指示器
// 只有一個圖標,隱藏底部指示器
val show = dialogInfo.size > 1
rollPagerView.setHintView(object : ColorPointHintView(
mContext, Color.WHITE, mContext.resources.getColor(
@@ -464,7 +464,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
val bannerAdapter = RoomActAdapter(mContext, dialogInfo)
rollPagerView.adapter = bannerAdapter
rollPagerView.setPlayDelay(3000)
//置透明度
//置透明度
rollPagerView.setAnimationDurtion(500)
bannerAdapter.notifyDataSetChanged()
bannerAdapter.setRoomActClickListener(RoomActClickListener { url ->
@@ -473,7 +473,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
DialogWebViewActivity.start(mContext, url)
})
// 模指示器在viewpager底部效果
// 模指示器在viewpager底部效果
val viewPager = rollPagerView.viewPager
viewPager.offscreenPageLimit = dialogInfo.size
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
@@ -491,12 +491,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
@CallSuper
open fun updateView() {
// 更新底
// 更新底
showBottomViewForDifRole()
}
/**
* 根角色示不同的状态
* 根角色示不同的狀態
*/
@CallSuper
open fun showBottomViewForDifRole() {
@@ -507,7 +507,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
bottomView.showHomePartyDownMicBottom()
}
bottomView.showInputOrIcon(isOnMic)
// 更新筒消息
// 更新筒消息
bottomView.setRemoteMuteOpen(!AudioEngineManager.get().isRemoteMute)
if (isOnMic) {
if (musicPlayerView == null) {
@@ -520,11 +520,11 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 查是否关注房主,然后弹
* 查是否關註房主,然後彈
*/
private fun checkFollowOwner() {
val currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return
//如果当前账号是房主也过滤
//如果當前賬號是房主也過濾
if (AvRoomDataManager.get().isRoomOwner) {
return
}
@@ -545,7 +545,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
) {
//先判坑位是否被闭麦
//先判坑位是否被閉麥
bottomView.setMicBtnEnable(false)
bottomView.setMicBtnOpen(false)
} else {
@@ -553,7 +553,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (AudioEngineManager.get().isMute) {
bottomView.setMicBtnOpen(false)
} else {
//获取当前是否有麦克风权
//獲取當前是否有麥克風權
val isPermission = isHavingMicPermissions
if (!isPermission) {
AudioEngineManager.get().isMute = true
@@ -592,7 +592,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (chatRoomStatusChangeData != null &&
chatRoomStatusChangeData.status == StatusCode.LOGINED
) {
// 重新调服务器的userroom/inV2保持座位上有
// 重新調服務器的userroom/inV2保持座位上有
mvpPresenter?.userRoomIn()
}
}
@@ -663,12 +663,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
return
}
mvpPresenter?.sendTextMsg(msg, atProxy)
messageView.setNeedAutoScroll(true) // 发送后自动滚动公屏列表
messageView.setNeedAutoScroll(true) // 發送後自動滾動公屏列表
inputEdit.setText("")
}
/**
* 软键盘显示与隐藏的监听
* 軟鍵盤顯示與隱藏的監聽
*/
private fun softKeyboardListener() {
SoftKeyBoardListener.setListener(activity, mOnSoftKeyBoardChangeListener)
@@ -702,7 +702,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
.compose(bindUntilEvent(FragmentEvent.DESTROY))
.doOnError {
if (it is VipLevelNotEnoughException) {
dialogManager.showOkDialog("尚未达到赠${giftInfo.giftName}所需族等,所需族等:${giftInfo.giftVipInfo?.vipName}")
dialogManager.showOkDialog("尚未達到贈${giftInfo.giftName}所需族等,所需族等:${giftInfo.giftVipInfo?.vipName}")
}
}
.subscribe { _, throwable ->
@@ -715,7 +715,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.roomcp_gift_open_click, "物面板按")
.onEvent(StatisticsProtocol.roomcp_gift_open_click, "物面板按")
}
}
@@ -738,7 +738,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
showBottomViewForDifRole()
updateMicBtn()
microView.adapter.notifyDataSetChanged()
//下麦时更新最高最低头饰
//下麥時更新最高最低頭飾
GiftValueMrg.get().updateRoomGiftValue(false)
}
@@ -759,7 +759,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
) {
val buttonItems: MutableList<ButtonItem> = ArrayList(4)
val presideMic = AvRoomDataManager.get().isDatingMode && micPosition == -1
val presideText = if (presideMic) "主持人" else ""
val presideText = if (presideMic) "主持人" else ""
val buttonItem1 = ButtonItem(
getString(R.string.embrace_up_mic) + presideText,
object : ButtonItem.OnClickListener {
@@ -805,15 +805,15 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
})
val buttonItem4 =
ButtonItem("") { toUpMicroPhone(micPosition, currentUid.toString() + "", false) }
//别问为什么ui整了
//禁用超管的上和抱TA上
ButtonItem("") { toUpMicroPhone(micPosition, currentUid.toString() + "", false) }
//別問為什麽ui調整了
//禁用超管的上和抱TA上
if (!SuperAdminUtil.isSuperAdmin()) {
//播房有主动上麦功能
//播房有主動上麥功能
if (!AvRoomDataManager.get().isSingleRoom) {
buttonItems.add(buttonItem4)
}
//播房只有房主有抱上功能
//播房只有房主有抱上功能
if ((!AvRoomDataManager.get().isSingleRoom || AvRoomDataManager.get().isRoomOwner) &&
!AvRoomDataManager.get().isDatingVipMic(micPosition)
) {
@@ -821,7 +821,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
}
if (!AvRoomDataManager.get().isOpenPKMode) {
//超管只有锁麦操作
//超管只有鎖麥操作
if (SuperAdminUtil.isSuperAdmin()) {
if (!roomMicInfo.isMicLock && !isQueue) {
buttonItems.add(buttonItem3)
@@ -832,7 +832,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
}
}
//超管只有闭麦操作
//超管只有閉麥操作
if (SuperAdminUtil.isSuperAdmin()) {
if (!roomMicInfo.isMicMute) {
buttonItems.add(buttonItem2)
@@ -906,9 +906,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (isModify) {
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_SET_TOPIC_CLICK, "置房间话题")
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_SET_TOPIC_CLICK, "置房間話題")
} else StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_SET_TOPIC_CLICK, "置房间话题")
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_SET_TOPIC_CLICK, "置房間話題")
RoomTitleEditActivity.startForResult(activity, info.roomDesc, info.introduction)
} else {
val dialogFragment =
@@ -933,7 +933,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
val micPosition = data.extras?.getInt(Constants.KEY_POSITION, Int.MIN_VALUE)
if (micPosition == Int.MIN_VALUE) return
//抱人上
//抱人上
mvpPresenter?.inviteMicroPhone(
BaseInfo(account, nick),
micPosition ?: Int.MIN_VALUE
@@ -963,7 +963,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
}
if (AvRoomDataManager.get().isRoomOwner(account)) {
//前是房主
//前是房主
AvRoomDataManager.get().mRoomCreateMember = null
}
}
@@ -978,7 +978,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 显示资料卡片
* 顯示資料卡片
*/
private fun showUserCardDialog(account: String) {
UserInfoDialog.showNewUserInfoDialog(
@@ -994,7 +994,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
@SuppressLint("CheckResult")
override fun toUpMicroPhone(micPosition: Int, currentUid: String, b: Boolean) {
if (AvRoomDataManager.get().isSelfGamePlaying) {
SingleToastUtil.showToast("游戏中不可以换麦!")
SingleToastUtil.showToast("遊戲中不可以換麥!")
return
}
UserModel.get().cacheLoginUserInfo?.gameStatus = GameStatus.STATUS_NOT_JOIN
@@ -1003,13 +1003,13 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (result) {
mvpPresenter?.upMicroPhone(micPosition, currentUid, b)
} else {
toast("请给予麦克风权限后再试!")
toast("請給予麥克風權限後再試!")
}
}, { throwable: Throwable? -> toast("生一些常,请稍后重试!") })
}, { throwable: Throwable? -> toast("生一些常,請稍後重試!") })
}
/**
* 是否有麦克风权
* 是否有麥克風權
*
* @return
*/
@@ -1091,15 +1091,15 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
sendMsg(phrases[position])
lastSendTime = CurrentTimeUtils.getCurrentTime()
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_ROOM_QUICKCHAT_CLICK, "音房_快捷")
.onEvent(StatisticsProtocol.EVENT_ROOM_QUICKCHAT_CLICK, "音房_快捷")
} else {
val roomInfo =
AvRoomDataManager.get().mCurrentRoomInfo ?: return@setOnItemClickListener
if (roomInfo.isCloseScreen) {
toast("公屏已关闭")
toast("公屏已關閉")
return@setOnItemClickListener
}
SingleToastUtil.showToast("送的太繁啦,请稍后再试")
SingleToastUtil.showToast("送的太繁啦,請稍後再試")
}
}
speedyMessageContainer.findViewById<View>(R.id.iv_close_speedy_message).setOnClickListener {
@@ -1110,12 +1110,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
override fun onFollowSuccess(position: Int) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_FOLLOW_OWNER_FROM_ROOM, "音房-关注房主")
.onEvent(StatisticsProtocol.EVENT_FOLLOW_OWNER_FROM_ROOM, "音房-關註房主")
messageView.changeFollowStatus(position, true)
}
override fun onFollowFail(msg: String?) {
toast("关注失败,请稍后重试")
toast("關註失敗,請稍後重試")
}
override fun updateMicView() {
@@ -1136,7 +1136,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
private fun onSendGiftBtnClick(giftId: Int = 0) {
if (giftDialog == null) {
GiftDialog.GIFT_DIALOG_FROM = ""
GiftDialog.GIFT_DIALOG_FROM = ""
giftDialog = GiftDialog(context, giftId)
giftDialog?.setGiftDialogBtnClickListener(this@BaseRoomFragment)
giftDialog?.setOnDismissListener { giftDialog = null }
@@ -1146,13 +1146,13 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_GIFT_CLICK, "物面板按")
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_GIFT_CLICK, "物面板按")
} else StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_GIFT_CLICK, "物面板按")
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_GIFT_CLICK, "物面板按")
}
/**
* 开启相亲模式管理增加一公屏提示
* 開啟相親模式管理增加一公屏提示
*/
private fun addOpenDatingTips() {
if (AvRoomDataManager.get().isDatingMode && !isDatingMode && AvRoomDataManager.get().isManager) {
@@ -1164,7 +1164,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 用户弹窗点击@Ta
* 用戶彈窗點擊@Ta
*
* @param event
*/
@@ -1185,7 +1185,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
/**
* 底部按钮点击处
* 底部按鈕點擊處
*/
open inner class BaseRoomBottomViewWrapper : BottomViewListenerWrapper() {
@SuppressLint("CheckResult")
@@ -1193,7 +1193,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
val roomQueueInfo = AvRoomDataManager.get()
.getRoomQueueMemberInfoByAccount(AuthModel.get().currentUid.toString())
if (roomQueueInfo?.mRoomMicInfo == null) return
//先判断麦上是否是开麦
//先判斷麥上是否是開麥
if (!roomQueueInfo.mRoomMicInfo.isMicMute && !AudioEngineManager.get().isAudienceRole) {
if (!isHavingMicPermissions) {
val rxPermissions = RxPermissions(this@BaseRoomFragment)
@@ -1204,7 +1204,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER)
updateMicBtn()
} else {
toast("开启权限后才能开麦")
toast("開啟權限後才能開麥")
}
}
return
@@ -1214,7 +1214,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (AudioEngineManager.get().isMute) {
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_MP_ROOM_CLOSE_MIC_CLICK,
"关闭麦克风"
"關閉麥克風"
)
} else if (AvRoomDataManager.get().isOnMic(myUid)) {
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER)
@@ -1225,9 +1225,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
override fun onSendFaceBtnClick() {
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_EMOTICON_CLICK, "表情面板按")
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_EMOTICON_CLICK, "表情面板按")
} else StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_EMOTICON_CLICK, "表情面板按")
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_EMOTICON_CLICK, "表情面板按")
if (AvRoomDataManager.get().isOnMic(myUid) || AvRoomDataManager.get().isRoomOwner) {
if (dynamicFaceDialog == null) {
dynamicFaceDialog = DynamicFaceDialog(context)
@@ -1239,7 +1239,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
dynamicFaceDialog?.show()
}
} else {
toast("才能表情哦!")
toast("才能表情哦!")
}
}
@@ -1250,7 +1250,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
KeyBoardUtils.showKeyBoard(context, inputEdit)
StatisticManager.Instance().onEvent(
BasicConfig.INSTANCE.appContext,
StatisticsProtocol.EVENT_ROOM_INPUT_BOX_CLICK, "底部文字入框点击", null
StatisticsProtocol.EVENT_ROOM_INPUT_BOX_CLICK, "底部文字入框點擊", null
)
}
@@ -1263,9 +1263,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
if (isRemoteMute) {
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_CLOSE_SOUND_CLICK, "关闭声")
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_CLOSE_SOUND_CLICK, "關閉聲")
} else StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_CLOSE_SOUND_CLICK, "关闭声")
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_CLOSE_SOUND_CLICK, "關閉聲")
}
AudioEngineManager.get().isRemoteMute = isRemoteMute
updateRemoteMuteBtn()
@@ -1274,16 +1274,16 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
override fun onMoreBtnClick() {
if (AvRoomDataManager.get().isCpRoom) {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_MORE_CLICK, "更多面板按")
.onEvent(StatisticsProtocol.EVENT_CP_ROOM_MORE_CLICK, "更多面板按")
} else StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_MORE_CLICK, "更多面板按")
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_MORE_CLICK, "更多面板按")
val dialog = RoomOperationDialog(mContext)
dialog.setOnActionListener {
redPackageSendDialog = RedPackageSendDialog()
redPackageSendDialog?.show(activity)
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_ROOM_SENDHONGBAO_CLICK,
"进入发红包页"
"進入發紅包頁"
)
}
dialog.show()
@@ -1291,7 +1291,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
override fun onRoomMessageClick() {
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_ROOM_MESSAGE_CLICK, "音房_消息")
.onEvent(StatisticsProtocol.EVENT_ROOM_MESSAGE_CLICK, "音房_消息")
RoomMsgActivity.start(mContext)
}
}

View File

@@ -45,7 +45,7 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
/**
* 播房
* 播房
*
* @author chenran
* @date 2017/7/26
@@ -135,7 +135,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
if (initInfo.hasFansTeamCurrentRoom) {
if (AvRoomDataManager.get().isRoomOwner) {
gameBinding.tvFansTeamOpt.text = "丝团(${initInfo.anchorFansNum})"
gameBinding.tvFansTeamOpt.text = "絲團(${initInfo.anchorFansNum})"
clickListener = View.OnClickListener {
DialogWebViewActivity.start(
requireContext(),
@@ -145,7 +145,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
} else {
if (initInfo.isAnchorFans) {
gameBinding.tvFansTeamOpt.text =
"LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
"LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
clickListener = View.OnClickListener {
FansTeamJoinedActivity.start(requireContext())
}
@@ -157,7 +157,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
}
} else {
if (AvRoomDataManager.get().isRoomOwner) {
gameBinding.tvFansTeamOpt.text = "通粉丝团"
gameBinding.tvFansTeamOpt.text = "通粉絲團"
clickListener = View.OnClickListener {
CommonWebViewActivity.start(
requireContext(),
@@ -165,7 +165,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
)
}
} else {
gameBinding.tvFansTeamOpt.text = "主播暂未开通粉丝团"
gameBinding.tvFansTeamOpt.text = "主播暫未開通粉絲團"
}
}
gameBinding.flFansTeam.setOnClickListener(clickListener)
@@ -219,7 +219,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
}
}
//显示请求上麦弹
//顯示請求上麥彈
private fun showInviteDialog(userInfo: UserInfo) {
if (!this::upMicDialog.isInitialized) {
upMicDialog = RequestUpMicDialog(requireContext())

View File

@@ -35,17 +35,17 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private var APP_CODE = ""
private val mRoomID = AvRoomDataManager.get().roomUid.toString()
private val mLanguage = "zh-CN" //
private val mLanguage = "zh-TW" //
//调用游戏SDK的接口,成功加载游戏后可用:
//調用遊戲SDK的接口,成功加載遊戲後可用:
private var iSudFSTAPP: ISudFSTAPP? = null
private val gson = Gson()
//小游戏ID
//小遊戲ID
private var mMGID = 0L
//通用状态-游戏,关键词
//通用狀態-遊戲,關鍵詞
private var mKeyWord: String? = null
private val mUid = AuthModel.get().currentUid.toString()
@@ -66,7 +66,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
override fun onLoginSuccess(new_code: String, expire_Date: Long) {
APP_CODE = new_code
Handler(Looper.getMainLooper()).post {
//初始化游戏SDK
//初始化遊戲SDK
initGameSDK(
activity,
AppConfig.APP_ID,
@@ -97,7 +97,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 例如"你我猜"游戏的文字命中
* 例如"你我猜"遊戲的文字命中
*/
fun hitTheMark(msg: String) {
mKeyWord?.let {
@@ -108,8 +108,8 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* "接入方客端"登接口, "接入方服端"得Code
* "接入方服端"是通"服端接入SDK"得Code返回"接入方客端"的
* "接入方客端"登接口, "接入方服端"得Code
* "接入方服端"是通"服端接入SDK"得Code返回"接入方客端"的
* @param listener
*/
@SuppressLint("CheckResult")
@@ -125,12 +125,12 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 1初始化游戏SDK
* 1初始化遊戲SDK
*
* @param context 上下文
* @param appID appID
* @param appKey appKey
* @param isTestEnv 是否是测试环true测试环false正式
* @param isTestEnv 是否是測試環true測試環false正式
*/
private fun initGameSDK(context: Context, appID: String, appKey: String, isTestEnv: Boolean) {
SudMGP.initSDK(context, appID, appKey, isTestEnv, object : ISudListenerInitSDK {
@@ -139,21 +139,21 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
override fun onFailure(code: Int, errInfo: String) {
showToast("初始化游戏SDK失:$code--errInfo:$errInfo")
showToast("初始化遊戲SDK失:$code--errInfo:$errInfo")
}
})
}
/**
* 2载游戏
* 2載遊戲
*
* @param activity 上下文Activity
* @param userID 用ID业务系统保证每个用户拥有唯一ID
* @param roomID 房ID入同一房间内
* @param userID 用ID業務系統保證每個用戶擁有唯一ID
* @param roomID 房ID入同一房間內
* @param code 令牌
* @param mgID 小游戏ID
* @param language 游戏语支持,简体zh-CN 繁zh-TW 英en-US 马来语ms-MY
* @param mgID 小遊戲ID
* @param language 遊戲語支持,簡體zh-CN 繁zh-TW 英en-US 馬來語ms-MY
*/
private fun loadMG(
activity: Activity,
@@ -169,7 +169,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 3将游戏view添加到我的布局
* 3將遊戲view添加到我的布局
*
* @param gameView
*/
@@ -184,7 +184,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
/**
* 通知"文字命中状态"到游戏
* 通知"文字命中狀態"到遊戲
*
* @param iSudFSTAPP
* @param keyWord
@@ -192,16 +192,16 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfTextHit(keyWord: String?, msg: String) {
LogUtils.d("notifySelfTextHit")
try {
//状态名称
//狀態名稱
val state: String = SudMGPAPPState.APP_COMMON_SELF_TEXT_HIT
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("isHit", true) // true 命中false 未命中
jsonObject.put("keyWord", keyWord) // true 命中false 未命中
jsonObject.put("text", msg) // 聊天原始容,这里的值只是一示例,意指内容当中包含关键词则命中,具体按业务规则定。
jsonObject.put("text", msg) // 聊天原始容,這裏的值只是一示例,意指內容當中包含關鍵詞則命中,具體按業務規則定。
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -209,7 +209,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 设置当前关键词
* 設置當前關鍵詞
*
* @param keyWord
*/
@@ -218,7 +218,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 游戏SDK用app的接口
* 遊戲SDK調用app的接口
*/
private val mISudFSMMG: ISudFSMMG = object : ISudFSMMG {
@@ -233,7 +233,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 回此方法,表示令牌期,此需要刷新令牌使用ISudFSMStateHandle回
* 回調此方法,表示令牌期,此需要刷新令牌使用ISudFSMStateHandle回調
* @param handle
* @param dataJson
*/
@@ -260,12 +260,12 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 处理获取游戏视图信息
* 處理獲取遊戲視圖信息
* @param handle
* @param dataJson
*/
override fun onGetGameViewInfo(handle: ISudFSMStateHandle, dataJson: String) {
//拿到游戏View的
//拿到遊戲View的
val gameViewWidth = container.measuredWidth
val gameViewHeight = container.measuredHeight
if (gameViewWidth > 0 && gameViewHeight > 0) {
@@ -273,7 +273,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
return
}
//如果游戏View未加完成,则监听加载完成时回调
//如果遊戲View未加完成,則監聽加載完成時回調
container.viewTreeObserver.addOnGlobalLayoutListener(object : OnGlobalLayoutListener {
override fun onGlobalLayout() {
container.viewTreeObserver.removeOnGlobalLayoutListener(this)
@@ -289,7 +289,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 通知游戏,游戏视图信息
* 通知遊戲,遊戲視圖信息
* @param handle
* @param gameViewWidth
* @param gameViewHeight
@@ -304,13 +304,13 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
jsonObject.put("ret_code", 0)
jsonObject.put("ret_msg", "success")
//游戏View大小
//遊戲View大小
val viewSize = JSONObject()
viewSize.put("width", gameViewWidth)
viewSize.put("height", gameViewHeight)
jsonObject.put("view_size", viewSize)
//游戏安全操作
//遊戲安全操作
val viewGameRect = JSONObject()
viewGameRect.put("left", 0)
viewGameRect.put("top", ScreenUtil.dip2px(200f))
@@ -318,7 +318,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
viewGameRect.put("bottom", ScreenUtil.dip2px(200f))
jsonObject.put("view_game_rect", viewGameRect)
//通知游戏
//通知遊戲
val json = jsonObject.toString()
Log.d(TAG, "notifyGameViewInfo:$json")
handle.success(json)
@@ -328,10 +328,10 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 游戏状态变
* 遊戲狀態變
* @param handle
* @param state 状态
* @param dataJson 状态数据json字符串
* @param state 狀態
* @param dataJson 狀態數據json字符串
*/
override fun onGameStateChange(
handle: ISudFSMStateHandle,
@@ -340,7 +340,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
) {
Log.d(TAG, "onGameStateChange state:$state--dataJson:$dataJson")
when (state) {
//SudMGPMGState.MG_COMMON_PUBLIC_MESSAGE -> showToast("游戏:公屏消息")
//SudMGPMGState.MG_COMMON_PUBLIC_MESSAGE -> showToast("遊戲:公屏消息")
SudMGPMGState.MG_COMMON_KEY_WORD_TO_HIT -> {
if (TextUtils.isEmpty(dataJson)) {
setKeyWord(null)
@@ -377,11 +377,11 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
/**
* 玩家状态变
* 玩家狀態變
* @param handle
* @param userId 玩家用ID
* @param state 状态
* @param dataJson 状态数据json字符串。考文
* @param userId 玩家用ID
* @param state 狀態
* @param dataJson 狀態數據json字符串。考文
*/
override fun onPlayerStateChange(
handle: ISudFSMStateHandle,
@@ -445,7 +445,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
} else if (isJoin) {
val upPosition = AvRoomDataManager.get().findGamePosition()
if (upPosition == Int.MIN_VALUE) {
showToast("当前游戏人数已满!")
showToast("當前遊戲人數已滿!")
} else {
UserModel.get().cacheLoginUserInfo?.gameStatus = 1
homePartyModel.upMicroPhone(upPosition,
@@ -532,18 +532,18 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
if (!isIn) {
notifySelfReadyState(false)
}
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_IN
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("isIn", isIn) // true 加入游戏false 退出游戏
jsonObject.put("isIn", isIn) // true 加入遊戲false 退出遊戲
if (seatIndex != -1) {
jsonObject.put("seatIndex", seatIndex)
}
jsonObject.put("teamId", 1) //哪一伍(2v2,4v4)
jsonObject.put("teamId", 1) //哪一伍(2v2,4v4)
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -552,15 +552,15 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfReadyState(isReady: Boolean) {
try {
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_READY
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("isReady", isReady) // true 准备false 取消准备
jsonObject.put("isReady", isReady) // true 準備false 取消準備
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -569,15 +569,15 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfPlayingState(isPlaying: Boolean) {
try {
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_PLAYING
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("isPlaying", isPlaying) // true 开始游戏false 结束游戏
jsonObject.put("isPlaying", isPlaying) // true 開始遊戲false 結束遊戲
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -586,15 +586,15 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfCaptainState(uid: String) {
try {
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_CAPTAIN
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("curCaptainUID", uid) // 必填,指定队长uid
jsonObject.put("curCaptainUID", uid) // 必填,指定隊長uid
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -603,15 +603,15 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfKickState(uid: String) {
try {
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_KICK
//状态数据
//狀態數據
val jsonObject = JSONObject()
jsonObject.put("kickedUID", uid) // 被踢用uid
jsonObject.put("kickedUID", uid) // 被踢用uid
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -620,14 +620,14 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
private fun notifySelfEndState() {
try {
//状态名称
//狀態名稱
val state = SudMGPAPPState.APP_COMMON_SELF_END
//状态数据
//狀態數據
val jsonObject = JSONObject()
val dataJson = jsonObject.toString()
//用接口
//調用接口
iSudFSTAPP?.notifyStateChange(state, dataJson, null)
} catch (e: Exception) {
e.printStackTrace()
@@ -635,19 +635,19 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
fun onStart() {
iSudFSTAPP?.startMG() //启动游戏
iSudFSTAPP?.startMG() //啟動遊戲
}
fun onResume() {
iSudFSTAPP?.playMG() //开始游戏
iSudFSTAPP?.playMG() //開始遊戲
}
fun onPause() {
iSudFSTAPP?.pauseMG() //暂停游戏
iSudFSTAPP?.pauseMG() //暫停遊戲
}
fun onStop() {
iSudFSTAPP?.stopMG() //停止游戏
iSudFSTAPP?.stopMG() //停止遊戲
}
fun onDestroy() {
@@ -659,14 +659,14 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
internal interface AppLoginListener {
/**
* App Server 登陆失败, App Server 不能返回CODE
* App Server 登陸失敗, App Server 不能返回CODE
*/
fun onLoginFailure(err: String?)
/**
* App Server 登成功, App Server用服端接入SDK的API取Code 返回 App
* App 就要用CODE和自己生成的UserID去用SDK的初始化函,登陆小游戏
* 小游戏登陆成功其UserID就是App的UserID
* App Server 登成功, App Server調用服端接入SDK的API取Code 返回 App
* App 就要用CODE和自己生成的UserID去調用SDK的初始化函,登陸小遊戲
* 小遊戲登陸成功其UserID就是App的UserID
*/
fun onLoginSuccess(new_code: String, expire_Date: Long)
}

View File

@@ -57,7 +57,7 @@ class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftB
@SuppressLint("CheckResult")
override fun init() {
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什
//這裏的height用MATCH_PARENT狀態欄會被頂上去,不知道什
val height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, height)
window.setGravity(Gravity.CENTER)
@@ -77,7 +77,7 @@ class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftB
mapOf("charge_money" to "${it.chargeMoney}")
)
} ?: run {
"请选择充值品!".toast()
"請選擇充值品!".toast()
}
}
@@ -107,7 +107,7 @@ class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftB
val closeClick = View.OnClickListener {
finish()
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_NUGIFT_POP_CLOSE_CLICK, "新人专享礼物弹窗关闭点击")
.onEvent(StatisticsProtocol.EVENT_NUGIFT_POP_CLOSE_CLICK, "新人專享禮物彈窗關閉點擊")
}
binding.root.setOnClickListener(closeClick)
binding.ivClose.setOnClickListener(closeClick)
@@ -156,7 +156,7 @@ class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftB
finish()
} else {
binding.tvTime.text =
"${TimeUtil.getElapseTimeForNewUserCharge(residueTime)}"
"${TimeUtil.getElapseTimeForNewUserCharge(residueTime)}"
}
}, {
it.printStackTrace()

View File

@@ -67,7 +67,7 @@ import io.reactivex.functions.Consumer;
public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter<V> {
/**
* 显示关注房主的时间
* 顯示關註房主的時間
*/
public static final int SHOW_FOLLOW_TIME = 3 * 60 * 1000;
public final Gson gson = new Gson();
@@ -75,7 +75,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
public final AvRoomModel mAvRoomModel;
public final SuperAdminModel mSuperAdminModel;
/**
* 判所坑服端是否响应回来
* 判所坑服端是否響應回來
*/
private boolean mIsLockMicPosResultSuccess = true;
private boolean mIsUnLockMicPosResultSuccess = true;
@@ -87,10 +87,10 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
/**
* 麦坑点击处理,麦上没人的
* 麥坑點擊處理,麥上沒人的
*
* @param micPosition 序位置
* @param chatRoomMember 坑上的用
* @param micPosition 序位置
* @param chatRoomMember 坑上的用
*/
@SuppressLint("CheckResult")
public void microPhonePositionClick(final int micPosition, MicMemberInfo chatRoomMember) {
@@ -150,7 +150,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
}
//发送云信消息,求上
//發送雲信消息,求上
private void requestUpMic(UserInfo userInfo) {
RequestUpmicAttachment attachment = new RequestUpmicAttachment(0);
attachment.setUserInfo(userInfo);
@@ -182,11 +182,11 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
final String currentUid = String.valueOf(currentRoom.getUid());
mHomePartyMode.lockMicroPhone(micPosition, currentUid, AuthModel.get().getTicket())
.doOnSuccess(data -> {
Logger.i("%1$s坑成功: %2$s", String.valueOf(currentUid), data);
Logger.i("%1$s坑成功: %2$s", String.valueOf(currentUid), data);
mIsLockMicPosResultSuccess = true;
})
.doOnError(throwable -> {
Logger.i("%1$s坑失: %2$s", String.valueOf(currentUid),
Logger.i("%1$s坑失: %2$s", String.valueOf(currentUid),
RxHelper.getNotEmptyError(throwable));
mIsLockMicPosResultSuccess = true;
})
@@ -194,7 +194,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
/**
* 坑位释放锁
* 坑位釋放鎖
*/
public void unLockMicroPhone(int micPosition) {
if (!mIsUnLockMicPosResultSuccess) {
@@ -211,13 +211,13 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
.subscribe(new Consumer<String>() {
@Override
public void accept(String data) throws Exception {
Logger.i("%1$s解成功: %2$s", String.valueOf(currentUid), data);
Logger.i("%1$s解成功: %2$s", String.valueOf(currentUid), data);
mIsUnLockMicPosResultSuccess = true;
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Logger.i("%1$s解麦失败: %2$s", String.valueOf(currentUid), throwable.getMessage());
Logger.i("%1$s解麥失敗: %2$s", String.valueOf(currentUid), throwable.getMessage());
mIsUnLockMicPosResultSuccess = true;
}
});
@@ -225,10 +225,10 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
/**
* 下
* 下
*
* @param micPosition
* @param isKick 是否是主
* @param isKick 是否是主
*/
public void downMicroPhone(int micPosition, final boolean isKick) {
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
@@ -239,7 +239,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
mHomePartyMode.downMicroPhone(micPosition, new CallBack<String>() {
@Override
public void onSuccess(String data) {
Logger.i("%1$s下成功:%2$s", currentUid, data);
Logger.i("%1$s下成功:%2$s", currentUid, data);
if (!isKick) {
//被踢了
if (getMvpView() != null) {
@@ -250,18 +250,18 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
@Override
public void onFail(int code, String error) {
Logger.i("%1$s下麦失败%2$s----", currentUid, error);
Logger.i("%1$s下麥失敗%2$s----", currentUid, error);
}
});
}
/**
* 上
* 上
*
* @param micPosition
* @param uId
* @param isInviteUpMic 是否是主false
* @param isReconnect 是否需要清除物值,普通情下上麦传false断网重连传ture
* @param isInviteUpMic 是否是主false
* @param isReconnect 是否需要清除物值,普通情下上麥傳false斷網重連傳ture
*/
public void upMicroPhone(final int micPosition, final String uId, boolean isInviteUpMic, boolean isReconnect) {
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
@@ -286,7 +286,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
isInviteUpMic, new CallBack<String>() {
@Override
public void onSuccess(String data) {
Logger.i("%1$s上成功:%2$s", uId, data);
Logger.i("%1$s上成功:%2$s", uId, data);
if (!isReconnect) {
GiftValueMrg.get().requestUpMic(micPosition, uId);
} else {
@@ -301,15 +301,15 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
getMvpView().updateMicView();
}
}
Logger.i("%1$s上麦失败%2$s----", uId, error);
Logger.i("%1$s上麥失敗%2$s----", uId, error);
}
});
}
/**
* 邀请用户上麦
* 邀請用戶上麥
*
* @param micInfo 要邀的用
* @param micInfo 要邀的用
* @param position 坑位
*/
public void inviteMicroPhone(final BaseInfo micInfo, final int position) {
@@ -317,7 +317,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
if (AvRoomDataManager.get().isOnMic(micUid)) {
return;
}
//如果点击的就是自己,那这里就是自己上
//如果點擊的就是自己,那這裏就是自己上
if (AvRoomDataManager.get().isOwner(micUid)) {
upMicroPhone(position, String.valueOf(micUid), true);
return;
@@ -329,16 +329,16 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
public void accept(ChatRoomMessage chatRoomMessage,
Throwable throwable) throws Exception {
if (throwable != null) {
Logger.i("请用户%d上麦失败!!!" + micUid);
Logger.i("請用戶%d上麥失敗!!!" + micUid);
} else
Logger.i("请用户%d上成功!!!" + micUid);
Logger.i("請用戶%d上成功!!!" + micUid);
}
});
}
/**
* 开麦
* 開麥
*
* @param micPosition
*/
@@ -353,16 +353,16 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
public void accept(String data, String error) {
super.accept(data, error);
if (error != null) {
Logger.i("%1$s开麦失败: %2$s", String.valueOf(roomInfo.getUid()), error);
Logger.i("%1$s開麥失敗: %2$s", String.valueOf(roomInfo.getUid()), error);
} else {
Logger.i("%1$s开麦成功: %2$s", String.valueOf(roomInfo.getUid()), data);
Logger.i("%1$s開麥成功: %2$s", String.valueOf(roomInfo.getUid()), data);
}
}
});
}
/**
* 闭麦
* 閉麥
*
* @param micPosition
*/
@@ -373,10 +373,10 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
mHomePartyMode.closeMicroPhone(micPosition, roomInfo.getUid())
.doOnSuccess(data -> {
Logger.i("%1$s闭麦成功: %2$s", String.valueOf(roomInfo.getUid()), data);
Logger.i("%1$s閉麥成功: %2$s", String.valueOf(roomInfo.getUid()), data);
})
.doOnError(throwable -> {
Logger.i("%1$s闭麦失败: %2$s", String.valueOf(roomInfo.getUid()),
Logger.i("%1$s閉麥失敗: %2$s", String.valueOf(roomInfo.getUid()),
RxHelper.getNotEmptyError(throwable));
})
.subscribe();
@@ -410,31 +410,31 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
}
} else {
//上都有人
//上都有人
AvRoomDataManager.get().resetMicMembers();
}
if (getMvpView() != null)
getMvpView().chatRoomReConnectView();
//之前在
//之前在
if (queueInfo != null && queueInfo.mChatRoomMember != null && queueInfo.mRoomMicInfo != null) {
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get()
.getRoomQueueMemberInfoByMicPosition(queueInfo.mRoomMicInfo.getPosition());
//麦上没
//麥上沒
String account = queueInfo.mChatRoomMember.getAccount();
if (roomQueueInfo != null && (roomQueueInfo.mChatRoomMember == null ||
Objects.equals(account, roomQueueInfo.mChatRoomMember.getAccount()))) {
roomQueueInfo.mChatRoomMember = null;
//断网重连,不要清除上的物值
//斷網重連,不要清除上的物值
upMicroPhone(queueInfo.mRoomMicInfo.getPosition(), account, true, true);
}
}
IMNetEaseManager.get().mCacheRoomQueueInfo = null;
Logger.i("断网重连获取队列信息成功...." + entries);
Logger.i("斷網重連獲取隊列信息成功...." + entries);
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
Logger.i("断网重连获取队列信息失....");
Logger.i("斷網重連獲取隊列信息失....");
}
});
}
@@ -454,12 +454,12 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
ChatRoomMessage firstMsg = IMNetEaseManager.get().getFirstMessageContent();
IMNetEaseManager.get().addCloseScreenMessages(firstMsg);
if (AvRoomDataManager.get().closeScreenBySAdmin()) {
contentText = "统检测涉嫌违规,予以关闭公屏消息警告";
contentText = "統檢測涉嫌違規,予以關閉公屏消息警告";
} else {
contentText = "管理员已关闭聊天公屏";
contentText = "管理員已關閉聊天公屏";
}
} else {
contentText = "管理员已开启聊天公屏";
contentText = "管理員已開啟聊天公屏";
}
RoomInfoAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN);
@@ -473,7 +473,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
/**
* 查是否关注了这个用户
* 查是否關註了這個用戶
*
* @param uid
*/
@@ -485,7 +485,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
.toObservable()
.takeWhile(aBoolean -> !aBoolean && getMvpView() != null)
.doOnNext(aBoolean -> getMvpView().noFollow())
//人主播房新加的关注提醒窗,以后还会不会有呢???
//人主播房新加的關註提醒窗,以後還會不會有呢???
.takeWhile(aBoolean -> !AvRoomDataManager.get().isSingleRoom())
.delay(4, TimeUnit.MINUTES)
.single(false)
@@ -502,7 +502,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
/**
* 关注房主
* 關註房主
*
* @param position
* @param ownerUid
@@ -539,7 +539,7 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
}
/***
* 送房消息
* 送房消息
* @param message
*/
@SuppressLint("CheckResult")
@@ -555,12 +555,12 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
if (throwable instanceof AntiSpamHitException) {
Log.e("sendTextMsg", throwable.getMessage());
} else {
Logger.i("送房信息失:" + throwable.getMessage());
Logger.i("送房信息失:" + throwable.getMessage());
}
} else {
getMvpView().onSendMsgSuccess(message);
IMNetEaseManager.get().addMessagesImmediately(chatRoomMessage);
Logger.i("送房信息成功:" + chatRoomMessage.getUuid());
Logger.i("送房信息成功:" + chatRoomMessage.getUuid());
}
}
});

View File

@@ -78,12 +78,12 @@ class RedPackageOpenDialog : BaseDialog<DialogRedPackageOpenBinding>() {
@SuppressLint("CheckResult")
private fun startRedPacketAnim(v: View) {
RedPackageModel.openRedPackage(redPackageNotifyInfo.redEnvelopeId)
.subscribe({
redPackageInfo = it
if (mObjectAnimator?.isRunning == false) {
openRedPackage()
}
.subscribe({
redPackageInfo = it
if (mObjectAnimator?.isRunning == false) {
openRedPackage()
}
}
, {
binding.ivOpen.isEnabled = true
mObjectAnimator?.cancel()
@@ -136,10 +136,10 @@ class RedPackageOpenDialog : BaseDialog<DialogRedPackageOpenBinding>() {
adapter.setNewData(this)
binding.tvTips.setTextColor(Color.WHITE)
binding.tvTips.text = MessageView.SpannableBuilder(binding.tvTips)
.append(ResUtil.getString(R.string.avroom_redpackage_redpackageopendialog_03))
.append(it.amount, ForegroundColorSpan(Color.parseColor("#FDCD00")))
.append(ResUtil.getString(R.string.avroom_redpackage_redpackageopendialog_04))
.build()
.append(ResUtil.getString(R.string.avroom_redpackage_redpackageopendialog_03))
.append(it.amount, ForegroundColorSpan(Color.parseColor("#FDCD00")))
.append(ResUtil.getString(R.string.avroom_redpackage_redpackageopendialog_04))
.build()
}
}
binding.tvDiamondNum.text = it.amount.substringBefore(".")
@@ -147,10 +147,10 @@ class RedPackageOpenDialog : BaseDialog<DialogRedPackageOpenBinding>() {
if (!AvRoomDataManager.get().isRoomFans){
AvRoomDataManager.get().roomUid?.let {
CollectionRoomModel.get().followRoom("1", it)
.subscribe { _: String? ->
AvRoomDataManager.get().isRoomFans = true
EventBus.getDefault().post(FollowRoomEvent())
}
.subscribe { _: String? ->
AvRoomDataManager.get().isRoomFans = true
EventBus.getDefault().post(FollowRoomEvent())
}
}
}
}
@@ -161,7 +161,7 @@ class RedPackageOpenDialog : BaseDialog<DialogRedPackageOpenBinding>() {
binding.tvNoGet.visibility = View.VISIBLE
}
}
binding.tvRedNum.text = "${pickNum}/${totalNum}"
binding.tvRedNum.text = "${pickNum}/${totalNum}"
if (type == ALL_GIFT || type == ALL_DIAMOND) {
DemoCache.saveRedPackage(id)
}

View File

@@ -69,7 +69,7 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
val initInfo = InitialModel.get().cacheInitInfo ?: InitInfo()
/**
* 厅内
* 廳內
*/
fun changeToNotAll() {
isAll = false
@@ -77,7 +77,7 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
binding.tvRoomRed.alpha = 1f
binding.indicatorAllRed.visibility = View.GONE
binding.indicatorRoomRed.visibility = View.VISIBLE
binding.tvGoldNumHint.text = "红包总金额不低${initInfo.redEnvelopeConfig.roomRedEnvelopeMinAmount}石,且必须为10的倍"
binding.tvGoldNumHint.text = "紅包總金額不低${initInfo.redEnvelopeConfig.roomRedEnvelopeMinAmount}石,且必須為10的倍"
binding.editRedNum.hint = "${initInfo.redEnvelopeConfig.roomRedEnvelopeMinNum}-${initInfo.redEnvelopeConfig.roomRedEnvelopeMaxNum}"
}
@@ -90,7 +90,7 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
binding.tvRoomRed.alpha = 0.5f
binding.indicatorAllRed.visibility = View.VISIBLE
binding.indicatorRoomRed.visibility = View.GONE
binding.tvGoldNumHint.text = "红包总金额不低${initInfo.redEnvelopeConfig.serverRedEnvelopeMinAmount}石,且必须为100的倍"
binding.tvGoldNumHint.text = "紅包總金額不低${initInfo.redEnvelopeConfig.serverRedEnvelopeMinAmount}石,且必須為100的倍"
binding.editRedNum.hint = "${initInfo.redEnvelopeConfig.serverRedEnvelopeMinNum}-${initInfo.redEnvelopeConfig.serverRedEnvelopeMaxNum}"
}
@@ -105,15 +105,15 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
binding.tvChangeType.setOnClickListener {
if (isGift) {
isGift = false
binding.tvRedTypeHint.text = "当前为手气红包,"
binding.tvChangeType.text = "为礼物红"
binding.tvRedTypeHint.text = "當前為手氣紅包,"
binding.tvChangeType.text = "為禮物紅"
} else {
isGift = true
binding.tvRedTypeHint.text = "当前为礼物红包,"
binding.tvChangeType.text = "为手气红"
binding.tvRedTypeHint.text = "當前為禮物紅包,"
binding.tvChangeType.text = "為手氣紅"
}
}
//默就已是手气红包,如果后台配置为了礼物红包就在这里改下
//默就已是手氣紅包,如果後臺配置為了禮物紅包就在這裏改下
if (initInfo.redEnvelopeType == 2 && !isGift) {
binding.tvChangeType.callOnClick()
}
@@ -143,33 +143,33 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
val redNum = binding.editRedNum.text.toString().toIntOrDef()
if (redNum < minNum || redNum > maxNum) {
SingleToastUtil.showToast("红包数量不能小${minNum}或大${maxNum}!")
SingleToastUtil.showToast("紅包數量不能小${minNum}或大${maxNum}!")
return@setOnClickListener
}
val goldNum = binding.editGoldNum.text.toString().toIntOrDef()
if (isAll) {
if (goldNum % 100 != 0) {
SingleToastUtil.showToast("钻石数必须为100的倍!")
SingleToastUtil.showToast("鉆石數必須為100的倍!")
return@setOnClickListener
}
} else {
if (goldNum % 10 != 0) {
SingleToastUtil.showToast("钻石数必须为10的倍!")
SingleToastUtil.showToast("鉆石數必須為10的倍!")
return@setOnClickListener
}
}
if (goldNum < minGold || goldNum > maxGold) {
SingleToastUtil.showToast("钻石数量不能小${minGold}或大${maxGold}!")
SingleToastUtil.showToast("鉆石數量不能小${minGold}或大${maxGold}!")
return@setOnClickListener
}
if (isGift && goldNum.toFloat() / redNum < 1) {//单个礼物红包价值不低于1钻
SingleToastUtil.showToast("单个红包金额过")
if (isGift && goldNum.toFloat() / redNum < 1) {//單個禮物紅包價值不低於1鉆
SingleToastUtil.showToast("單個紅包金額過")
return@setOnClickListener
}
if (!isGift && goldNum.toFloat() / redNum * rate < 0.1) {//单个手气红包价值不低0.1水晶
SingleToastUtil.showToast("单个红包金额过")
if (!isGift && goldNum.toFloat() / redNum * rate < 0.1) {//單個手氣紅包價值不低0.1水晶
SingleToastUtil.showToast("單個紅包金額過")
return@setOnClickListener
}
GiveGoldPassWordFragment.newInstance(requireFragmentManager(), binding.editGoldNum.text.toString()).apply {
@@ -191,7 +191,7 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
event.keyCode == KeyEvent.KEYCODE_ENTER
}
// StatUtil.onEvent("room_sendhongbao", "进入发红包页面")
// StatUtil.onEvent("room_sendhongbao", "進入發紅包頁面")
}
private fun getRedType(): Int {
@@ -214,30 +214,30 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
if (password.length == 6) {
dialogManager.showProgressDialog(context)
RedPackageModel.sendRedPackage(binding.editGoldNum.text.toString(),
binding.editRedText.text.toString().ifEmpty { "恭喜发财,大吉大利!" },
binding.editRedNum.text.toString(),
AvRoomDataManager.get().mCurrentRoomInfo?.uid.toString(), getRedType(), DESUtils.DESAndBase64(password))
.doOnError {
dialogManager.dismissDialog()
SingleToastUtil.showToast(it.message)
passWordFragment?.password?.clearPassword()
}
.subscribe { _ ->
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
dialogManager.dismissDialog()
SingleToastUtil.showToast("送成功")
passWordFragment?.dismissAllowingStateLoss()
dismissAllowingStateLoss()
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SENDHONGBAO_SUCCESS,
"发红包成功")
}
binding.editRedText.text.toString().ifEmpty { "恭喜發財,大吉大利!" },
binding.editRedNum.text.toString(),
AvRoomDataManager.get().mCurrentRoomInfo?.uid.toString(), getRedType(), DESUtils.DESAndBase64(password))
.doOnError {
dialogManager.dismissDialog()
SingleToastUtil.showToast(it.message)
passWordFragment?.password?.clearPassword()
}
.subscribe { _ ->
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
dialogManager.dismissDialog()
SingleToastUtil.showToast("送成功")
passWordFragment?.dismissAllowingStateLoss()
dismissAllowingStateLoss()
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SENDHONGBAO_SUCCESS,
"發紅包成功")
}
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
binding.tvBalanceNum.text = PayModel.get().currentWalletInfo?.diamondNum?.toString()
?: "0"
?: "0"
}
override fun onDestroy() {

View File

@@ -129,7 +129,7 @@ class SingleRoomPKCreateActivity : BaseViewBindingActivity<ActivitySingleRoomPkC
binding.llPkRoom.isVisible = true
ImageLoadUtils.loadImage(this, it.avatar, binding.ivAvatar)
binding.tvRoomTitle.text = it.title.subAndReplaceDot(7)
binding.tvRoomId.text = "Peko:${it.erbanNo}"
binding.tvRoomId.text = "Peko:${it.erbanNo}"
checkCommitEnable()
}
}

View File

@@ -15,19 +15,19 @@ class SingleRoomPKSearchAdapter :
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
helper.setText(R.id.tv_room_title, item.nick.subAndReplaceDot(7))
.setText(R.id.tv_room_id, "Peko:${item.erbanNo}")
.setText(R.id.tv_room_id, "Peko:${item.erbanNo}")
ImageLoadUtils.loadImage(mContext, item.avatar, helper.getView(R.id.iv_avatar))
helper.addOnClickListener(R.id.iv_avatar, R.id.tv_select)
val tvSelect = helper.getView<TextView>(R.id.tv_select)
tvSelect.isEnabled = !item.crossPking && item.valid
if (!item.valid) {
tvSelect.text = "离线"
tvSelect.text = "離線"
tvSelect.setTextColor("#80C6C6E9".toColorInt())
} else if (item.crossPking) {
tvSelect.text = "PK中"
tvSelect.setTextColor("#80C6C6E9".toColorInt())
} else {
tvSelect.text = "选择"
tvSelect.text = "選擇"
tvSelect.setTextColor(Color.WHITE)
}
}

View File

@@ -71,7 +71,7 @@ class SingleRoomPkFinishDialog : BaseDialog<DialogSingleRoomPkFinishBinding>() {
.observeOn(AndroidSchedulers.mainThread())
.doOnComplete { dismissAllowingStateLoss() }
.subscribe {
binding.tvClose.text = "关闭(${5 - it})"
binding.tvClose.text = "關閉(${5 - it})"
}
when (roomPkBean.winUid) {

View File

@@ -37,7 +37,7 @@ class SingleRoomPkReceivedDialog : BaseDialog<DialogSingleRoomPkReceivedBinding>
@SuppressLint("CheckResult")
override fun init() {
binding.tvNick.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
binding.tvTime.text = "${pkBean.pkDuration}"
binding.tvTime.text = "${pkBean.pkDuration}"
pkBean.pkDesc.ifNotNullOrEmpty {
binding.tvDescTitle.isVisible = true
binding.tvDesc.isVisible = true
@@ -66,7 +66,7 @@ class SingleRoomPkReceivedDialog : BaseDialog<DialogSingleRoomPkReceivedBinding>
SingleRoomPKModel.acceptRoomPK(accept, AvRoomDataManager.get().roomUid, pkBean.roundId)
.compose(bindToLifecycle())
.subscribe({
//"接受PK邀成功".toast()
//"接受PK邀成功".toast()
dismissAllowingStateLoss()
}, {
it.message.toast()

View File

@@ -180,15 +180,15 @@ import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
/**
* 直播消息界面
* 直播消息界面
*
* @author xiaoyu
*/
public class MessageView extends FrameLayout {
private static final String TAG = "MessageView";
private final static int MAX_MESSAGE_SIZE = 2000;//公屏最多展示条数
private final static int BLOCK_MAX_MESSAGE_SIZE = MAX_MESSAGE_SIZE * 3 / 2;//在查看消息停住的候 最多消息条数.
private final static int MAX_MESSAGE_SIZE = 2000;//公屏最多展示條數
private final static int BLOCK_MAX_MESSAGE_SIZE = MAX_MESSAGE_SIZE * 3 / 2;//在查看消息停住的候 最多消息條數.
private static final int LOAD_MESSAGE_COUNT = 10;
private final int textColor = 0x80ffffff;
private final List<ChatRoomMessage> atMessages = new ArrayList<>();
@@ -213,7 +213,7 @@ public class MessageView extends FrameLayout {
private int expLevelWidth;
private int expLevelHeight;
private int giftLength;
private volatile boolean needAutoScroll = true;//是否自动滚动到底部
private volatile boolean needAutoScroll = true;//是否自動滾動到底部
private Consumer<String> clickConsumer;
private OnClick onClick;
@@ -275,11 +275,11 @@ public class MessageView extends FrameLayout {
sysIconHeight = Utils.dip2px(context, 14);
smallFace = Utils.dip2px(context, 22);
bigFace = Utils.dip2px(context, 30);
//经验等级图片后台已经更换尺寸了公屏同步下尺寸是26:20
//經驗等級圖片後臺已經更換尺寸了公屏同步下尺寸是26:20
expLevelHeight = Utils.dip2px(context, 20);
expLevelWidth = expLevelHeight * 26 / 20;//expLevelHeight * 114 / 45
giftLength = Utils.dip2px(context, 35);
// 内容区
// 內容區
layoutManger = new LinearLayoutManager(context, RecyclerView.VERTICAL, false);
FrameLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
messageListView = new RecyclerViewNoViewpagerScroll(context);
@@ -385,7 +385,7 @@ public class MessageView extends FrameLayout {
// + " mMessageAdapter.getItemCount()-1:" + (recyclerView.getAdapter().getItemCount()-1)
// + " dis:"+ (lastVisibleItemPosition-(recyclerView.getAdapter().getItemCount()-1)));
if (lastVisibleItemPosition >= recyclerView.getAdapter().getItemCount() - 3) {
//最后一个显示出
//最後一個顯示出
// Logger.e(TAG, ResUtil.getString(R.string.avroom_widget_messageview_01));
needAutoScroll = true;
tvBottomTip.setVisibility(GONE);
@@ -410,7 +410,7 @@ public class MessageView extends FrameLayout {
}
/**
* 添加公屏消息使用 {@link AvRoomDataManager#addChatRoomMessage(ChatRoomMessage)}
* 添加公屏消息使用 {@link AvRoomDataManager#addChatRoomMessage(ChatRoomMessage)}
*/
private void addMessages(ChatRoomMessage msg) {
if (msg == null) return;
@@ -453,7 +453,7 @@ public class MessageView extends FrameLayout {
if (!ListUtils.isListEmpty(atUids) && !ListUtils.isListEmpty(atNames)) {
for (int i = 0; i < atUids.size(); i++) {
String uid = atUids.get(i);
// 只有被 @ 人的数组中包含自己的候才会去变
// 只有被 @ 人的數組中包含自己的候才會去變
if (Objects.equals(uid, String.valueOf(AuthModel.get().getCurrentUid()))) {
Map<String, Long> atMap = DemoCache.readAtMsgUuid();
if (atMap == null || !atMap.containsKey(msg.getUuid())) {
@@ -471,7 +471,7 @@ public class MessageView extends FrameLayout {
private void showTipsOrScrollToBottom() {
if (!needAutoScroll) {
tvBottomTip.setVisibility(VISIBLE);
//超某值后自动滚动下去
//超某值後自動滾動下去
if (mMessageAdapter.getItemCount() > BLOCK_MAX_MESSAGE_SIZE) {
messageListView.smoothScrollToPosition(mMessageAdapter.getItemCount() - 1);
}
@@ -486,7 +486,7 @@ public class MessageView extends FrameLayout {
/**
* 修改关注状态
* 修改關註狀態
*
* @param position
* @param b
@@ -503,7 +503,7 @@ public class MessageView extends FrameLayout {
}
/**
* 修改加入话题的状态
* 修改加入話題的狀態
*
* @param position
* @param b
@@ -535,7 +535,7 @@ public class MessageView extends FrameLayout {
public interface OnClick {
/**
* 点击关注
* 點擊關註
*
* @param position
*/
@@ -561,7 +561,7 @@ public class MessageView extends FrameLayout {
/**
* @param text 文字
* @return -返回一spannableStringBuilder
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder append(CharSequence text) {
if (TextUtils.isEmpty(text)) return this;
@@ -571,7 +571,7 @@ public class MessageView extends FrameLayout {
/**
* @param drawable -icon url
* @return -返回一spannableStringBuilder
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder appendImg(String drawable) {
if (TextUtils.isEmpty(drawable)) return this;
@@ -584,9 +584,9 @@ public class MessageView extends FrameLayout {
/**
* @param drawable -icon url
* @param width
* @param width
* @param height 高
* @return -返回一spannableStringBuilder
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder append(String drawable, int width, int height) {
if (TextUtils.isEmpty(drawable)) return this;
@@ -598,7 +598,7 @@ public class MessageView extends FrameLayout {
}
/**
* 文本和背景分的情
* 文本和背景分的情
*/
public SpannableBuilder appendBgAndContent(String drawable, String content) {
if (TextUtils.isEmpty(drawable)) return this;
@@ -611,9 +611,9 @@ public class MessageView extends FrameLayout {
/**
* @param drawable -icon
* @param width
* @param width
* @param height 高
* @return -返回一spannableStringBuilder
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder append(Drawable drawable, int width, int height) {
if (drawable == null) return this;
@@ -627,7 +627,7 @@ public class MessageView extends FrameLayout {
/**
* @param imgUrl -icon url
* @param height 高
* @return -返回一spannableStringBuilder,自适应宽
* @return -返回一spannableStringBuilder,自適應寬
*/
public SpannableBuilder append(String imgUrl, int height) {
if (TextUtils.isEmpty(imgUrl)) return this;
@@ -640,9 +640,9 @@ public class MessageView extends FrameLayout {
/**
* @param drawable -icon
* @param width
* @param width
* @param height 高
* @return -返回一spannableStringBuilder
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder append(Drawable drawable, int width, int height, Object... whats) {
if (drawable == null) return this;
@@ -664,8 +664,8 @@ public class MessageView extends FrameLayout {
/**
* @param text -文字
* @param what -span
* @return -返回一spannableStringBuilder
* @param what -span
* @return -返回一spannableStringBuilder
*/
public SpannableBuilder append(CharSequence text, Object what) {
if (TextUtils.isEmpty(text)) return this;
@@ -676,7 +676,7 @@ public class MessageView extends FrameLayout {
}
/**
* 支持多spannable 同一段文字修改
* 支持多spannable 同一段文字修改
*
* @param text
* @param what
@@ -742,7 +742,7 @@ public class MessageView extends FrameLayout {
try {
if (chatRoomMessage.getMsgType() == MsgTypeEnum.tip) {
String contentText = chatRoomMessage.getContent();
// 房通告
// 房通告
if (ResUtil.getString(R.string.avroom_widget_messageview_03).equals(contentText)) {
setUpdateGiftEffectMsg(tvContent);
} else if (XChatConstants.ROOM_INTRODUCTION.equals(contentText) || contentText.contains(IMNetEaseManager.ROOM_INTRO_TAG)) {
@@ -752,7 +752,7 @@ public class MessageView extends FrameLayout {
contentText.contains(XChatConstants.DATING_TIPS_IN) ||
contentText.contains(XChatConstants.DATING_TIPS_NEW) ||
contentText.contains(XChatConstants.DATING_TIPS_PUBLIC)) {
//相模式提示文案用特殊的
//相模式提示文案用特殊的
tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.color_fe5d7f));
tvContent.setText(contentText);
} else {
@@ -763,7 +763,7 @@ public class MessageView extends FrameLayout {
setMsgText(chatRoomMessage, tvContent);
setVIPMessageBackground(chatRoomMessage, tvContent);
} else if (chatRoomMessage.getMsgType() == MsgTypeEnum.notification) {
// 加上
// 加上
setMsgNotification(chatRoomMessage, tvContent, baseViewHolder.getAdapterPosition());
setVIPMessageBackground(chatRoomMessage, tvContent);
} else if (chatRoomMessage.getMsgType() == MsgTypeEnum.custom) {
@@ -777,17 +777,17 @@ public class MessageView extends FrameLayout {
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT) {
setVIPMessageBackground(chatRoomMessage, tvContent);
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_GIFT) {
// 加上
// 加上
setMsgHeaderGift(tvContent, (GiftAttachment) attachment, chatRoomMessage);
} else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {
setMsgBatchLuckyBagGift(tvContent, (MultiLuckyGiftAttachment) attachment, chatRoomMessage);
}
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT) {
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_MULTI_GIFT) {
// 加上
// 加上
setMsgMultiGift(tvContent, (MultiGiftAttachment) attachment, chatRoomMessage);
} else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_ALL_MIC_LUCKY_GIFT) {
//福袋物公屏
//福袋物公屏
setMsgAllMicLuckyBagGift(tvContent, (MultiLuckyGiftAttachment) attachment, chatRoomMessage);
} else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT) {
setMsgBatchGift(tvContent, (GiftBatchAttachment) attachment, chatRoomMessage);
@@ -797,14 +797,14 @@ public class MessageView extends FrameLayout {
setVIPMessageBackground(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_FACE) {
tvContent.setLineSpacing(Utils.dip2px(mContext, 6), 1);
// 加上
// 加上
setMsgFace(tvContent, (FaceAttachment) attachment, chatRoomMessage);
// 设置贵族气
// 設置貴族氣
List<FaceReceiveInfo> faceReceiveInfos = ((FaceAttachment) attachment).getFaceReceiveInfos();
if (faceReceiveInfos.size() == 1 && chatRoomMessage.getFromAccount().equals(String.valueOf(faceReceiveInfos.get(0).getUid())))
setVIPMessageBackground(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MESS_HEAD_NOBLE) {
// 通或续费贵族通知
// 通或續費貴族通知
setMsgNobleOpenOrRenewText(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_SEND_MAGIC) {
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_SINGLE_MAGIC) {
@@ -920,7 +920,7 @@ public class MessageView extends FrameLayout {
}
} else if (first == CustomAttachment.CUSTOM_MSG_SIGN_IN
&& second == CustomAttachment.CUSTOM_MSG_SUB_CARVE_UP_GOLD_SECOND_LEVEL) {
//二瓜分
//二瓜分
setCarveUpGoldMsg(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_MINI_WORLD) {
switch (second) {
@@ -944,12 +944,12 @@ public class MessageView extends FrameLayout {
}
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_PUBLIC_SCREEN) {
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_PUBLIC_SCREEN_WELCOME) {
//上用户对你的欢迎语
//上用戶對你的歡迎語
setMicWelcomeContent(chatRoomMessage, tvContent, baseViewHolder.getAdapterPosition());
}
} else if (first == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_FOLLOW_ROOM) {
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_FOLLOW_ROOM_SUCCESS) {
//收藏了房
//收藏了房
setFollowRoomTip(tvContent, (RoomTipAttachment) attachment, chatRoomMessage);
setVIPMessageBackground(chatRoomMessage, tvContent);
}
@@ -1218,7 +1218,7 @@ public class MessageView extends FrameLayout {
}
/**
* 提示已加入的话题的通知
* 提示已加入的話題的通知
*
* @param adapterPosition
* @param chatRoomMessage
@@ -1300,7 +1300,7 @@ public class MessageView extends FrameLayout {
}
/**
* 提示加入话题
* 提示加入話題
*
* @param adapterPosition
* @param chatRoomMessage
@@ -1320,7 +1320,7 @@ public class MessageView extends FrameLayout {
}
/**
* 房公屏提示关注房主
* 房公屏提示關註房主
*
* @param chatRoomMessage
* @param tvContent
@@ -1365,7 +1365,7 @@ public class MessageView extends FrameLayout {
}
/**
* 房公屏提示关注房主
* 房公屏提示關註房主
*
* @param chatRoomMessage
* @param tvContent
@@ -1390,7 +1390,7 @@ public class MessageView extends FrameLayout {
Iterator<Map.Entry<String, RoomPKInvitedUpMicMember>> iterator = micMemberMap.entrySet().iterator();
while (iterator.hasNext()) {
RoomPKInvitedUpMicMember value = iterator.next().getValue();
//没有队伍的不提示
//沒有隊伍的不提示
if (value.getGroupType() == PKTeamInfo.TEAM_NONE) {
continue;
}
@@ -1662,7 +1662,7 @@ public class MessageView extends FrameLayout {
msg = msg + (integer + 1 - faceInfoById.getResultIndexStart()) + ",";
}
msg = msg.substring(0, msg.length() - 1);
//
//
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(extension == null ? ResUtil.getString(R.string.avroom_widget_messageview_091) : RegexUtil.getPrintableString(extension.getSenderNick()), new ForegroundColorSpan(Color.WHITE),
new OriginalDrawStatusClickSpan() {
@@ -1684,7 +1684,7 @@ public class MessageView extends FrameLayout {
private void setBoxMeMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
RoomBoxPrizeAttachment attachment = (RoomBoxPrizeAttachment) chatRoomMessage.getAttachment();
//
//
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(ResUtil.getString(R.string.avroom_widget_messageview_093), new ForegroundColorSpan(greyColor))
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
@@ -1701,7 +1701,7 @@ public class MessageView extends FrameLayout {
private void setRadishMeMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
RoomBoxPrizeAttachment attachment = (RoomBoxPrizeAttachment) chatRoomMessage.getAttachment();
//
//
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(ResUtil.getString(R.string.avroom_widget_messageview_097), new ForegroundColorSpan(greyColor))
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
@@ -1745,7 +1745,7 @@ public class MessageView extends FrameLayout {
private void setCleanScreenMsg(TextView tvContent, IMMessage message) {
CleanScreenAttachment attachment = (CleanScreenAttachment) message.getAttachment();
//
//
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(attachment.getRoleType() == 1 ? ResUtil.getString(R.string.avroom_widget_messageview_0105) : ResUtil.getString(R.string.avroom_widget_messageview_0106), new ForegroundColorSpan(Color.WHITE))
.append("(" + attachment.getNick() + ") ", new ForegroundColorSpan(roomTipColor),
@@ -1771,8 +1771,8 @@ public class MessageView extends FrameLayout {
}
/**
* 排模式中,用被管理抱上
* 格式:管理/房主{用户昵称}抱上
* 排模式中,用被管理抱上
* 格式:管理/房主{用戶昵稱}抱上
*
* @param tvContent
* @param attachment
@@ -1876,7 +1876,7 @@ public class MessageView extends FrameLayout {
private void clearBackground(TextView textView) {
// 清除文字
textView.setText("");
// 清除聊天
// 清除聊天
textView.setBackgroundResource(R.drawable.shape_room_message_bg);
textView.setPadding(paddingWidth, paddingHeight, paddingWidth, paddingHeight);
}
@@ -1889,7 +1889,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}{level}xxx: 文字
* {badge}{level}xxx: 文字
*
* @param chatRoomMessage -
* @param tvContent -
@@ -1907,7 +1907,7 @@ public class MessageView extends FrameLayout {
for (int i = 0; i < atUids.size(); i++) {
String name = atNames.get(i);
String uid = atUids.get(i);
// 只有被 @ 人的数组中包含自己的候才会去变
// 只有被 @ 人的數組中包含自己的候才會去變
if (Objects.equals(uid, String.valueOf(AuthModel.get().getCurrentUid()))) {
Pattern pattern = Pattern.compile(Pattern.quote(name));
Matcher matcher = pattern.matcher(text.build().toString());
@@ -1948,7 +1948,7 @@ public class MessageView extends FrameLayout {
R.drawable.ic_room_super_admin, null) : null,
SizeUtils.dp2px(tvContent.getContext(), 23), expLevelHeight);
// 官方主播认证
// 官方主播認證
String tvOfficialMask = NobleUtil.getLevel(UserInfo.OAC_NAME, chatRoomMessage).trim();
String ivOfficialMask = NobleUtil.getLevel(UserInfo.OAC_ICON, chatRoomMessage);
if (!TextUtils.isEmpty(tvOfficialMask) && !TextUtils.isEmpty(ivOfficialMask) && extension != null) { // extension != null 表示自己
@@ -1956,9 +1956,9 @@ public class MessageView extends FrameLayout {
} else if (!TextUtils.isEmpty(ivOfficialMask)) {
builder.append(ivOfficialMask, SizeUtils.dp2px(tvContent.getContext(), 62), expLevelHeight);
}
//等
//等
builder.append(userLevel, expLevelWidth, expLevelHeight);
//
//
String tvNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_WORD, chatRoomMessage).trim();
String ivNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_PIC, chatRoomMessage);
if (!TextUtils.isEmpty(tvNamePlate) && !TextUtils.isEmpty(ivNamePlate)) { // extension != null 表示自己
@@ -1969,7 +1969,7 @@ public class MessageView extends FrameLayout {
}
/**
* 暂时已抛弃
* 暫時已拋棄
*
* @param chatRoomMessage -
* @param tvContent -
@@ -1999,8 +1999,8 @@ public class MessageView extends FrameLayout {
}
/**
* xxx 分享了房
* xxx 关注了房主
* xxx 分享了房
* xxx 關註了房主
*
* @param tvContent -
* @param roomTipAttachment -
@@ -2016,7 +2016,7 @@ public class MessageView extends FrameLayout {
}
/**
* xxx 收藏了房
* xxx 收藏了房
*
* @param tvContent -
* @param roomTipAttachment -
@@ -2031,7 +2031,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}{level} xxx 出 运气表情
* {badge}{level} xxx 出 運氣表情
* <p>
* {badge}{level} xxx 出
* 表情1 表情2 表情3 表情4 表情5
@@ -2060,7 +2060,7 @@ public class MessageView extends FrameLayout {
// 骰子
if (faceInfo.getId() == 17 || "shaizi".equals(faceInfo.getENName()))
height = (int) (width / 1.36F);
//
//
if (faceInfo.getId() == 24 || "pukepai".equals(faceInfo.getENName())) {
width = smallFace;
height = (int) (width / 0.7F);
@@ -2073,7 +2073,7 @@ public class MessageView extends FrameLayout {
}
/**
* xxx 全送出 {物} X
* xxx 全送出 {物} X
*
* @param tvContent -
* @param giftAttachment -
@@ -2102,8 +2102,8 @@ public class MessageView extends FrameLayout {
}
/**
* 全福袋
* xxx 全送出 {物} X
* 全福袋
* xxx 全送出 {物} X
*
* @param tvContent -
* @param giftAttachment -
@@ -2157,8 +2157,8 @@ public class MessageView extends FrameLayout {
}
/**
* 送多人福袋
* xxx 全送出 {物} X
* 送多人福袋
* xxx 全送出 {物} X
*
* @param tvContent -
* @param giftAttachment -
@@ -2214,7 +2214,7 @@ public class MessageView extends FrameLayout {
}
/**
* xxx 送xxx,xxx,xxx... {物} X
* xxx 送xxx,xxx,xxx... {物} X
*
* @param tvContent
* @param attachment
@@ -2258,7 +2258,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}xxx给全麦施魔法{魔法}
* {badge}xxx給全麥施魔法{魔法}
*
* @param tvContent -
* @param magicAllMicAttachment -
@@ -2290,7 +2290,7 @@ public class MessageView extends FrameLayout {
}
/**
* xxx 送xxx,xxx,xxx... {魔法} X
* xxx 送xxx,xxx,xxx... {魔法} X
*
* @param tvContent -
* @param magicBatchAttachment -
@@ -2343,7 +2343,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}xxx{badge}xxx施魔法{魔法}
* {badge}xxx{badge}xxx施魔法{魔法}
*
* @param tvContent -
* @param magicAttachment -
@@ -2387,7 +2387,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}xxx送{badge}xxx {物} X
* {badge}xxx送{badge}xxx {物} X
*
* @param tvContent -
* @param giftAttachment -
@@ -2428,7 +2428,7 @@ public class MessageView extends FrameLayout {
}
/**
* {badge}xxx
* {badge}xxx
*
* @param chatRoomMessage -
* @param tvContent -
@@ -2450,7 +2450,7 @@ public class MessageView extends FrameLayout {
senderNick = RegexUtil.getPrintableString(attachment.getTargetNicks().get(0));
if (attachment.getType() != NotificationType.ChatRoomMemberIn) return;
// 座
// 座
String carName = NobleUtil.getCarName(CarInfo.CAR_NAME, chatRoomMessage);
carName = TextUtils.isEmpty(carName) ? "" : "\"" + carName + "\"";
@@ -2505,7 +2505,7 @@ public class MessageView extends FrameLayout {
text.append(enterText, new ForegroundColorSpan(whiteColor));
//如果自己在上,增加一个欢迎ta的按钮,并且这条消息不是自己的
//如果自己在上,增加一個歡迎ta的按鈕,並且這條消息不是自己的
if (AvRoomDataManager.get().isOwnerOnMic()
&& !UserModel.get().isMyseft(chatRoomMessage.getFromAccount())
&& !ExtensionUtil.isWelcomeLocal(chatRoomMessage)) {
@@ -2563,7 +2563,7 @@ public class MessageView extends FrameLayout {
}
/**
* 恭喜 xxx 在房间内 续费/开通 "皇帝"
* 恭喜 xxx 在房間內 續費/開通 "皇帝"
*
* @param chatRoomMessage -
* @param tvContent -
@@ -2579,21 +2579,21 @@ public class MessageView extends FrameLayout {
&& second != CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE)
return;
String senderNick = RegexUtil.getPrintableString(attachment.nick);
// 系通知icon
// 系通知icon
Drawable icNotification = mContext.getResources().getDrawable(R.drawable.ic_system_notification);
int width = (int) (icNotification.getIntrinsicWidth() / (icNotification.getIntrinsicHeight() + 0.F) * sysIconHeight);
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(icNotification, width, sysIconHeight)
.append(" 恭喜 ", new ForegroundColorSpan(greyColor))
.append(senderNick, new ForegroundColorSpan(roomTipColor))
.append(" 在房间内" + (second == CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE ? "续费" : "") + "\"", new ForegroundColorSpan(greyColor))
.append(" 在房間內" + (second == CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE ? "續費" : "") + "\"", new ForegroundColorSpan(greyColor))
.append(nobleInfo.getName(), new ForegroundColorSpan(roomTipColor))
.append("\"");
tvContent.setText(text.build());
}
/**
* 瓜分石的消息,二和三都有
* 瓜分石的消息,二和三都有
*
* @param chatRoomMessage
* @param tvContent
@@ -2603,18 +2603,18 @@ public class MessageView extends FrameLayout {
return;
}
CarveUpGoldAttachment attachment = (CarveUpGoldAttachment) chatRoomMessage.getAttachment();
//
//
SpannableBuilder text = new SpannableBuilder(tvContent)
.append("到瓜分百】哇塞,恭喜 ", new ForegroundColorSpan(greyColor))
.append("到瓜分百】哇塞,恭喜 ", new ForegroundColorSpan(greyColor))
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
.append("签到获", new ForegroundColorSpan(greyColor))
.append(attachment.getGoldNum() + "", new ForegroundColorSpan(roomTipColor))
.append("簽到獲", new ForegroundColorSpan(greyColor))
.append(attachment.getGoldNum() + "", new ForegroundColorSpan(roomTipColor))
.append("", new ForegroundColorSpan(greyColor));
tvContent.setText(text.build());
}
/**
* 上用户对你的欢迎语
* 上用戶對你的歡迎語
*/
private void setMicWelcomeContent(ChatRoomMessage chatRoomMessage, TextView tvContent, int position) {
tvContent.setOnClickListener(null);
@@ -2628,7 +2628,7 @@ public class MessageView extends FrameLayout {
return;
}
ChatRoomMessageExtension extension = chatRoomMessage.getChatRoomMessageExtension();
//
//
String fromAccount = chatRoomMessage.getFromAccount();
SpannableBuilder text = new SpannableBuilder(tvContent);
addCommonTag(chatRoomMessage, text, tvContent);
@@ -2652,8 +2652,8 @@ public class MessageView extends FrameLayout {
})
.append(welcomeInfo.getNextContent(), new ForegroundColorSpan(whiteColor));
//自己的消息不显示关注按钮
//被迎人必是自己
//自己的消息不顯示關註按鈕
//被迎人必是自己
if (!UserModel.get().isMyseft(fromAccount) && UserModel.get().isMyseft(welcomeInfo.getTargetUid())) {
if (!welcomeInfo.isFans()) {
text.append(" ").append(
@@ -2669,10 +2669,10 @@ public class MessageView extends FrameLayout {
}
StatisticManager.Instance().onEvent(
StatisticsProtocol.EVENT_ROOM_FOLLOW_HIM, "关注TA");
StatisticsProtocol.EVENT_ROOM_FOLLOW_HIM, "關註TA");
welcomeInfo.setConnecting(true);
//关注
//關註
PraiseModel.get().praise(JavaUtil.str2long(chatRoomMessage.getFromAccount()), true)
.compose(RxHelper.bindContext(mContext))
.subscribe(new DontWarnObserver<String>() {
@@ -2739,7 +2739,7 @@ public class MessageView extends FrameLayout {
if (handleUid > 0) {
account = ((RoomQueueMsgAttachment) attachment).handleUid + "";
} else {
//ios用handleUid致iOS的自定消息拿不到uid
//ios用handleUid致iOS的自定消息拿不到uid
account = chatRoomMessage.getFromAccount();
}
} else if (attachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING) {
@@ -2750,7 +2750,7 @@ public class MessageView extends FrameLayout {
if (!Objects.equals(mCurrentRoomInfo.getUid(), dataBean.getAppearRoomUid())) {
AVRoomActivity.start(getContext(), dataBean.getAppearRoomUid());
} else {
SingleToastUtil.showToast("你已在怪兽房间内");
SingleToastUtil.showToast("你已在怪獸房間內");
}
break;

View File

@@ -62,7 +62,7 @@ import java.net.URL
import java.util.concurrent.TimeUnit
/**
* 房特效View(座,心动场景,屏等)
* 房特效View(座,心動場景,屏等)
*/
class RoomEffectView @JvmOverloads constructor(
private val mContext: Context,
@@ -71,10 +71,10 @@ class RoomEffectView @JvmOverloads constructor(
) : FrameLayout(mContext, attrs, defStyleAttr) {
private val mCarEffectList: MutableList<CarInfo?> by lazy { ArrayList() }
//顶部飘屏总展示时间
//頂部飄屏總展示時間
private val SHOW_TIME = 3500
//顶部飘屏周期
//頂部飄屏周期
private val PERIOD = 1000
private val binding: LayoutRoomEffectBinding =
LayoutRoomEffectBinding.inflate(LayoutInflater.from(mContext), this, true)
@@ -157,10 +157,10 @@ class RoomEffectView @JvmOverloads constructor(
RoomEvent.RADISH_NOTIFY_SVGA -> addRadishNotify(roomEvent.chatRoomMessage)
RoomEvent.ROOM_GIFT_COMPOUND -> addGiftCompoundNotify(roomEvent.chatRoomMessage)
RoomEvent.RECEIVE_ROOM_LUCKY_BAG_NOTICE, RoomEvent.RECEIVE_SERVICE_LUCKY_BAG_NOTICE -> //全服福袋
//厅内福袋
//廳內福袋
addLuckyBagNotify(roomEvent.chatRoomMessage)
RoomEvent.DATING_PUBLISH_RESULT -> showHandAnim((roomEvent.chatRoomMessage.attachment as DatingAttachment).datingNotifyInfo)
RoomEvent.RECEIVE_MEMBER_IN_NOTICE -> //入房
RoomEvent.RECEIVE_MEMBER_IN_NOTICE -> //入房
addMemberInNotify(roomEvent.chatRoomMessage)
RoomEvent.RECEIVE_EXPER_LEVEL_UP_NOTICE -> addLevelUpNotify(roomEvent.chatRoomMessage)
RoomEvent.ENTER_ROOM -> if (!SuperAdminUtil.isSuperAdmin()) {
@@ -214,7 +214,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 幸运池飘
* 幸運池飄
*
* @param chatRoomMessage
*/
@@ -239,7 +239,7 @@ class RoomEffectView @JvmOverloads constructor(
val attachment = chatRoomMessage.attachment as DatingAllNotifyAttachment
val (_, _, oneUserNick, anotherUserNick, roomUid, roomTitle, backgroundUrl, joinHandLevel, _, sweetWords) = attachment.datingAllNotifyInfo
?: return
//自己房不需要
//自己房不需要
if (AvRoomDataManager.get().roomUid == roomUid) return
val textView = LayoutInflater.from(mContext)
.inflate(R.layout.layout_room_dating_all_notify, null) as TextView
@@ -285,7 +285,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 福袋
* 福袋
*
* @param chatRoomMessage
*/
@@ -341,8 +341,8 @@ class RoomEffectView @JvmOverloads constructor(
binding.flLuckyGiftNotify.addView(svgaImageView)
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 24f //字大小
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 24f //字大小
dynamicEntity.setDynamicText(
StaticLayout(
text.build(),
@@ -360,7 +360,7 @@ class RoomEffectView @JvmOverloads constructor(
dynamicEntity.setHidden(true, "img_206")
} else {
svgaImageView.setOnClickListener {
//跳转房间要移除监听,不然可能NPE
//跳轉房間要移除監聽,不然可能NPE
svgaImageView.callback = null
AVRoomActivity.start(mContext, noticeInfo.roomUid)
}
@@ -382,7 +382,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 幸运池飘
* 幸運池飄
*
* @param chatRoomMessage
*/
@@ -432,7 +432,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 幸运池飘屏 五 SVGA背景的
* 幸運池飄屏 五 SVGA背景的
*
* @param chatRoomMessage
*/
@@ -484,8 +484,8 @@ class RoomEffectView @JvmOverloads constructor(
override fun onComplete(videoItem: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 24f //字大小
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 24f //字大小
dynamicEntity.setDynamicText(
StaticLayout(
text.build(),
@@ -509,7 +509,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 幸运池飘
* 幸運池飄
*
* @param chatRoomMessage
*/
@@ -560,8 +560,8 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 添加跑马灯
* 以及反射一些参数影响跑马灯
* 添加跑馬燈
* 以及反射一些參數影響跑馬燈
*/
private fun setupRoomTitleMarquee(textView: TextView) {
try {
@@ -581,7 +581,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 幸运池飘屏 五 SVGA背景的
* 幸運池飄屏 五 SVGA背景的
*
* @param chatRoomMessage
*/
@@ -635,8 +635,8 @@ class RoomEffectView @JvmOverloads constructor(
override fun onComplete(videoItem: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 24f //字大小
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 24f //字大小
dynamicEntity.setDynamicText(
StaticLayout(
text.build(),
@@ -661,7 +661,7 @@ class RoomEffectView @JvmOverloads constructor(
/**
* 物合成,SVGA背景的消息
* 物合成,SVGA背景的消息
*
* @param chatRoomMessage
*/
@@ -713,8 +713,8 @@ class RoomEffectView @JvmOverloads constructor(
override fun onComplete(videoItem: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 24f //字大小
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 24f //字大小
dynamicEntity.setDynamicText(
StaticLayout(
text.build(),
@@ -740,7 +740,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 成员进入飘
* 成員進入飄
*
* @param chatRoomMessage
*/
@@ -770,7 +770,7 @@ class RoomEffectView @JvmOverloads constructor(
val fromNick = remoteExtension["fromNick"] as String?
val textView = LayoutInflater.from(mContext)
.inflate(R.layout.layout_member_in_notify, null) as SuperTextView
//
//
val text = MessageView.SpannableBuilder(textView)
.append(targetNicks[0], ForegroundColorSpan(Color.WHITE))
var enterText = ResUtil.getString(R.string.avroom_widget_roomeffectview_018)
@@ -847,8 +847,8 @@ class RoomEffectView @JvmOverloads constructor(
binding.roomMenberInSvga.clearsAfterStop = true
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 22f //字大小
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 22f //字大小
dynamicEntity.setDynamicText(
StaticLayout(
text,
@@ -868,7 +868,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 升级飘
* 升級飄
*
* @param chatRoomMessage
*/
@@ -906,9 +906,9 @@ class RoomEffectView @JvmOverloads constructor(
binding.roomLevelUpSvga.clearsAfterStop = true
val dynamicEntity = SVGADynamicEntity()
val textPaint = TextPaint()
textPaint.color = Color.WHITE //字体颜
textPaint.textSize = 22f //字大小 Util.dip2px(mContext,11)
// textPaint.setShadowLayer(3, 2, 2, 0xff000000);//字体阴影,不需要可以不用
textPaint.color = Color.WHITE //字體顏
textPaint.textSize = 22f //字大小 Util.dip2px(mContext,11)
// textPaint.setShadowLayer(3, 2, 2, 0xff000000);//字體陰影,不需要可以不用
dynamicEntity.setDynamicText(message, textPaint, "y_yhname")
val drawable = SVGADrawable(videoItem, dynamicEntity)
binding.roomLevelUpSvga.setImageDrawable(drawable)
@@ -1038,7 +1038,7 @@ class RoomEffectView @JvmOverloads constructor(
.subscribe { aLong: Long ->
val residueTime = datingNotifyInfo.svgaSecond - aLong
binding.tvDatingSecond.text = residueTime.toString() + "S"
if (residueTime == 5L) { //剩余5秒开始显示倒计时
if (residueTime == 5L) { //剩余5秒開始顯示倒計時
binding.llDatingSvgaTime.visibility = VISIBLE
}
}
@@ -1059,12 +1059,12 @@ class RoomEffectView @JvmOverloads constructor(
if (isSendMsg) {
UserModel.get().getUserInfoFromServer(account?.toLong() ?: 0)
.subscribe { userInfo: UserInfo? ->
//播放座驾动
//播放座駕動
if (userInfo != null && userInfo.carInfo != null && userInfo.carInfo.isUsing
&& userInfo.carInfo.getStatus() == CarInfo.STATUS_USER_CAN_USE
) {
// 族人,要先判是否
// 族人,要先判是否
if (userInfo.userVipInfoVO == null || !userInfo.userVipInfoVO.enterHide) {
if (AvRoomDataManager.get().mIsNeedGiftEffect &&
!AvRoomDataManager.get().isSelfGamePlaying &&
@@ -1072,12 +1072,12 @@ class RoomEffectView @JvmOverloads constructor(
) {
mCarEffectList.add(userInfo.carInfo)
if (!binding.roomCarSvga.isAnimating && !isSvgaPlaying) {
// 播放座驾动画
// 播放座駕動畫
playCarAnim(userInfo.carInfo)
}
}
// 公屏入房的提示
// 公屏入房的提示
IMNetEaseManager.get()
.sendCarPlayRoomMsgBySdk(
userInfo.carInfo,
@@ -1112,7 +1112,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 真播放svga
* 真播放svga
*
* @param effect
*/
@@ -1149,7 +1149,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 真播放vap
* 真播放vap
*
* @param viewUrl
*/
@@ -1166,7 +1166,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 跨房PK
* 跨房PK
*
* @param chatRoomMessage
*/
@@ -1212,7 +1212,7 @@ class RoomEffectView @JvmOverloads constructor(
}
/**
* 播跨房PK
* 播跨房PK
*
* @param chatRoomMessage
*/
@@ -1289,7 +1289,7 @@ class RoomEffectView @JvmOverloads constructor(
val textView = rootView.findViewById<TextView>(R.id.tv_content)
val text = MessageView.SpannableBuilder(textView)
.append(ResUtil.getString(R.string.avroom_widget_roomeffectview_025), ForegroundColorSpan(Color.WHITE))
.append("${msgBean.title}」房", ForegroundColorSpan(Color.parseColor("#FFFC4C")))
.append("${msgBean.title}」房", ForegroundColorSpan(Color.parseColor("#FFFC4C")))
.append(msgBean.desc, ForegroundColorSpan(Color.WHITE))
.append("TOP1", ForegroundColorSpan(Color.parseColor("#FFFC4C")))
textView.text = text.build()

View File

@@ -51,7 +51,7 @@ public class DialogManager {
private boolean mReCreate = true;
private TextView mCancel;
/**
* 新增的一种弹框类型,支持只一次
* 新增的一種彈框類型,支持只一次
*/
private Switch switchTips;
private int mProgressMax = 0;
@@ -88,7 +88,7 @@ public class DialogManager {
}
/**
* 注释 见 {@link DialogManager#showOkCancelDialog(
* 註釋 見 {@link DialogManager#showOkCancelDialog(
*CharSequence, CharSequence, CharSequence, CharSequence, boolean,
* boolean, boolean, OkCancelDialogListener, OnKeyBackListener, boolean)}
*/
@@ -101,7 +101,7 @@ public class DialogManager {
Window window = dialog.getWindow();
window.setContentView(R.layout.layout_common_ok_cancel_dialog);
//标题
//標題
TextView tvTilte = window.findViewById(R.id.tv_title);
if (tvTilte != null) {
if (!TextUtils.isEmpty(title)) {
@@ -111,7 +111,7 @@ public class DialogManager {
tvTilte.setVisibility(View.GONE);
}
}
//
//
TextView tip = window.findViewById(R.id.message);
tip.setText(message);
@@ -159,7 +159,7 @@ public class DialogManager {
}
/**
* 注释 见 {@link DialogManager#showOkCancelDialog(
* 註釋 見 {@link DialogManager#showOkCancelDialog(
*CharSequence, CharSequence, CharSequence, CharSequence, boolean,
* boolean, boolean, OkCancelDialogListener, OnKeyBackListener, boolean)}
*/
@@ -172,7 +172,7 @@ public class DialogManager {
Window window = dialog.getWindow();
window.setContentView(R.layout.layout_newbie_hello_dialog);
//
//
RoundedImageView ivAvatar = window.findViewById(R.id.iv_avatar);
if (ivAvatar != null) {
if (!TextUtils.isEmpty(avatar)) {
@@ -188,10 +188,10 @@ public class DialogManager {
}
}
//性
//性
ImageView ivGender = window.findViewById(R.id.iv_gender);
ivGender.setImageDrawable(gender == 1 ? context.getResources().getDrawable(R.drawable.ic_gender_male) : context.getResources().getDrawable(R.drawable.ic_gender_female));
//标题
//標題
TextView tvTilte = window.findViewById(R.id.tv_title);
if (tvTilte != null) {
if (!TextUtils.isEmpty(title)) {
@@ -201,7 +201,7 @@ public class DialogManager {
tvTilte.setVisibility(View.GONE);
}
}
//
//
TextView tip = window.findViewById(R.id.message);
tip.setText(message);
@@ -280,19 +280,19 @@ public class DialogManager {
}
public void dismissDialog() {
//注释这个判断,因不保留活动情况下,((Activity)mContext).isDestroyed() true 致不行dismiss一dialog
//而mDialog.getWindow()不null是可以dismiss一dialog的。
//註釋這個判斷,因不保留活動情況下,((Activity)mContext).isDestroyed() true 致不行dismiss一dialog
//而mDialog.getWindow()不null是可以dismiss一dialog的。
// if(!checkActivityValid())
// return;
//加上一try行吞
//加上一try行吞
try {
if (mContext != null && mDialog != null && mDialog.getWindow() != null) {
if (mContext instanceof Activity) {
Activity activity = (Activity) mContext;
if (!activity.isFinishing()) {
//如果dialog在延比如handler。postDelay中用,
// 而activity.已destory,
// 会报异常java.lang.IllegalArgumentException:
//如果dialog在延比如handler。postDelay中調用,
// 而activity.已destory,
// 會報異常java.lang.IllegalArgumentException:
// View not attached to window manager
mDialog.dismiss();
}
@@ -321,8 +321,8 @@ public class DialogManager {
}
/**
* 只有定按
* 带标题
* 只有定按
* 帶標題
*/
public void showOkWithTitleDialog(CharSequence title, CharSequence message,
CharSequence okLabel, boolean isCanCancel, OkCancelDialogListener l) {
@@ -556,20 +556,20 @@ public class DialogManager {
}
/**
* 1、Peko通用的dialog置,以后尽量所有的dialog都引到这个方法,方便以改版
* 2、如果UI要求框是完全自定的,再重新写过
* 1、Peko通用的dialog置,以後盡量所有的dialog都引到這個方法,方便以改版
* 2、如果UI要求框是完全自定的,再重新寫過
*
* @param title 标题,空则隐藏 (ui,有些弹框带标题,有些不带,两种情况共存)
* @param message 容,不能空,配合{@link com.yizhuan.erban.utils.SpannableBuilder} 色使用
* @param okLabel ok按,不能藏,默认为 text="定"
* @param cancelLabel 取消按,空则隐藏,一般在都用text="取消"
* @param l 点击监听
* @param isCanCancel 点击返回是否可以取消,默=falsedialog初始化的候,false
* (uiture和false根据情况而定,一般自己根理解选择)
* @param canceledOnTouchOutside ture的话,点击背景消失
* @param isAutoHide 默ture点击按钮的时候,自动隐藏dialog(暂时用不到性,放先)
* @param backListener 窗返回键的监听
* @param dismissAfterBack 点击返回是否自dismiss
* @param title 標題,空則隱藏 (ui,有些彈框帶標題,有些不帶,兩種情況共存)
* @param message 容,不能空,配合{@link com.yizhuan.erban.utils.SpannableBuilder} 色使用
* @param okLabel ok按,不能藏,默認為 text="定"
* @param cancelLabel 取消按,空則隱藏,一般在都用text="取消"
* @param l 點擊監聽
* @param isCanCancel 點擊返回是否可以取消,默=falsedialog初始化的候,false
* (uiture和false根據情況而定,一般自己根理解選擇)
* @param canceledOnTouchOutside ture的話,點擊背景消失
* @param isAutoHide 默ture點擊按鈕的時候,自動隱藏dialog(暫時用不到性,放先)
* @param backListener 窗返回鍵的監聽
* @param dismissAfterBack 點擊返回是否自dismiss
*/
public void showOkCancelDialog(CharSequence title, CharSequence message, CharSequence okLabel,
CharSequence cancelLabel, boolean isCanCancel, boolean canceledOnTouchOutside,
@@ -616,7 +616,7 @@ public class DialogManager {
public void showOkCancelDialog(CharSequence title, CharSequence message, CharSequence okLabel,
CharSequence cancelLabel, boolean isCanCancel,
final boolean isAutoHide, final OkCancelDialogListener l) {
//一般情况,点击背景和返回一起
//一般情況,點擊背景和返回一起
showOkCancelDialog(title, message, okLabel, cancelLabel, isCanCancel, isCanCancel,
isAutoHide, l, null, false);
}
@@ -633,8 +633,8 @@ public class DialogManager {
}
/**
* @param title 不需要则传
* @param messages 黑色文字和主色文字轮着来的一字符串数组
* @param title 不需要則傳
* @param messages 黑色文字和主色文字輪著來的一字符串數組
*/
public void showOkCancelDialog(CharSequence title, CharSequence[] messages,
CharSequence okLable, CharSequence cancelLable,
@@ -654,7 +654,7 @@ public class DialogManager {
}
/**
* @param messages 黑色文字和主色文字轮着来的一字符串数组
* @param messages 黑色文字和主色文字輪著來的一字符串數組
*/
public void showOkCancelWithTitleDialog(CharSequence[] messages,
final OkCancelDialogListener l) {
@@ -890,11 +890,11 @@ public class DialogManager {
}
public void showProgressDialog(Context context) {
showProgressDialog(context, "请稍后...", mCanceledOnClickBackKey);
showProgressDialog(context, "請稍後...", mCanceledOnClickBackKey);
}
public void showProgressDialog(Context context, boolean cancelable) {
showProgressDialog(context, "请稍后...", cancelable);
showProgressDialog(context, "請稍後...", cancelable);
}
public void showProgressDialog(Context context, String msg) {
@@ -920,8 +920,8 @@ public class DialogManager {
/**
* @param context
* @param msg
* @param cancelable 点击返回是否可取消
* @param outSideCancelable 点击对话框外部是否可取消
* @param cancelable 點擊返回是否可取消
* @param outSideCancelable 點擊對話框外部是否可取消
* @param listener
*/
public void showProgressDialog(Context context, String msg, boolean cancelable, boolean outSideCancelable, DialogInterface.OnDismissListener listener) {
@@ -973,7 +973,7 @@ public class DialogManager {
}
/**
* 加好友或群验证码的对话
* 加好友或群驗證碼的對話
*/
public void showInputPwdDialog(String title, String okLabel, String cancelLabel, final String resultCode, final InputPwdDialogListener listener) {
@@ -997,9 +997,9 @@ public class DialogManager {
mDialog.setCancelable(false);
mDialog.setCanceledOnTouchOutside(false);
//只用下面一行弹出对话框时需要点击输入框才能弹出软键盘
//只用下面一行彈出對話框時需要點擊輸入框才能彈出軟鍵盤
window.clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
//加上下面一行弹出对话框时软键盘随之弹
//加上下面一行彈出對話框時軟鍵盤隨之彈
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
if (!TextUtils.isEmpty(title))
titleView.setText(title);
@@ -1062,7 +1062,7 @@ public class DialogManager {
public interface OkCancelDialogListener {
default void onCancel() {
//默认空实现
//默認空實現
}
void onOk();

View File

@@ -88,14 +88,14 @@ class FansTeamJoinActivity : BaseViewBindingActivity<ActivityFansTeamJoinBinding
.compose(bindToLifecycle())
.handleBeanData()
.subscribe({
"加入粉丝团成功!".toast()
"加入粉絲團成功!".toast()
finish()
}, { t ->
t.message.toast()
})
} ?: run {
"数据初始化中,请稍后~".toast()
"數據初始化中,請稍後~".toast()
}
}
}

View File

@@ -76,7 +76,7 @@ class FansTeamJoinedActivity : BaseViewBindingActivity<ActivityFansTeamJoinedBin
binding.tvFansTeamFansNum.text = "${it.teamNum}"
binding.ivMeAvatar.load(it.memberAvatar)
binding.tvValue.text = "密值Lv.${it.levelSeq}"
binding.tvValue.text = "密值Lv.${it.levelSeq}"
binding.tvCurrValue.text = "${it.levelExper}/${it.nextLevelExper}"
binding.pbValue.max = it.nextLevelExper
binding.pbValue.progress = it.levelExper
@@ -90,7 +90,7 @@ class FansTeamJoinedActivity : BaseViewBindingActivity<ActivityFansTeamJoinedBin
fansTeamViewModel.exitFansTeamLiveData.observe(this) {
if (it == true) {
"退出粉丝团成功!".toast()
"退出粉絲團成功!".toast()
finish()
}
}
@@ -116,7 +116,7 @@ class FansTeamJoinedActivity : BaseViewBindingActivity<ActivityFansTeamJoinedBin
popupWindow.dismiss()
}
contentView.findViewById<View>(R.id.tv_exit).setOnClickListener {
dialogManager.showOkCancelDialog("退出后粉丝团后24小时内不能再次加入,定退出?", true) {
dialogManager.showOkCancelDialog("退出後粉絲團後24小時內不能再次加入,定退出?", true) {
popupWindow.dismiss()
fansTeamViewModel.exitFansTeam()
}

View File

@@ -218,7 +218,7 @@ class AnchorCardView @JvmOverloads constructor(
binding.ivAudioControl.setImageResource(R.drawable.ic_skill_play)
AudioPlayerHelper.get().playInThread(url, object : OnPlayListener {
override fun onError(error: String) {
SingleToastUtil.showToast("播放出错,请重试")
SingleToastUtil.showToast("播放出錯,請重試")
stopAudio()
}
@@ -230,7 +230,7 @@ class AnchorCardView @JvmOverloads constructor(
})
StatisticManager.Instance()
.onEvent(StatisticsProtocol.EVENT_PERSONALSHOW_TOP_CARD_VOICE_CLICK, "播展示卡片播放语音点击")
.onEvent(StatisticsProtocol.EVENT_PERSONALSHOW_TOP_CARD_VOICE_CLICK, "播展示卡片播放語音點擊")
}
private fun stopAudio() {

View File

@@ -24,8 +24,8 @@ class GiveGoldSuccessActivity : BaseActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_give_gold_success)
initTitleBar(ResUtil.getString(R.string.pay_activity_givegoldsuccessactivity_01))
tvNickname.text = "转赠给:${intent.getStringExtra("nickname")}"
tvGold.text = "${intent.getStringExtra("gold")?.toInt()}"
tvNickname.text = "轉贈給:${intent.getStringExtra("nickname")}"
tvGold.text = "${intent.getStringExtra("gold")?.toInt()}"
tvSure.setOnClickListener { finish() }
}

View File

@@ -56,11 +56,11 @@ class GiveGoldToUserActivity : BaseActivity(), GridPasswordView.OnPasswordChange
return@setOnClickListener
}
var rateGold = gold * initInfo.redEnvelopeConfig.rate / 100
GiveGoldPassWordFragment.newInstance(supportFragmentManager, gold.toString(), nick, if (rateGold == 0.0) "" else "续费:(${initInfo.redEnvelopeConfig.rate.toInt()}%): ${rateGold}")
.apply {
passWordFragment = this
setListener(this@GiveGoldToUserActivity)
}
GiveGoldPassWordFragment.newInstance(supportFragmentManager, gold.toString(), nick, if (rateGold == 0.0) "" else "續費:(${initInfo.redEnvelopeConfig.rate.toInt()}%): ${rateGold}")
.apply {
passWordFragment = this
setListener(this@GiveGoldToUserActivity)
}
}
}
tvCoin.text = PayModel.get().currentWalletInfo?.canGiveGoldNum?.toString() ?: "0"
@@ -77,18 +77,18 @@ class GiveGoldToUserActivity : BaseActivity(), GridPasswordView.OnPasswordChange
userInfo?.apply {
dialogManager.showProgressDialog(context)
PayModel.get().giveGold(uid, editGold.text.toString(), password)
.compose(bindToLifecycle())
.doOnError {
toast(it.message)
passWordFragment?.password?.clearPassword()
dialogManager.dismissDialog()
}
.subscribe { _ ->
passWordFragment?.dismissAllowingStateLoss()
dialogManager.dismissDialog()
finish()
GiveGoldSuccessActivity.start(context, editGold.text.toString(), nick)
}
.compose(bindToLifecycle())
.doOnError {
toast(it.message)
passWordFragment?.password?.clearPassword()
dialogManager.dismissDialog()
}
.subscribe { _ ->
passWordFragment?.dismissAllowingStateLoss()
dialogManager.dismissDialog()
finish()
GiveGoldSuccessActivity.start(context, editGold.text.toString(), nick)
}
}
}
}

View File

@@ -41,7 +41,7 @@ object CpViewHelper {
}
fun setInviteTimeRemain(time: String, tv: TextView) {
val s = "${time}内决定,期自失效!"
val s = "${time}內決定,期自失效!"
tv.text = getColorSpan(s, Color.parseColor("#FB466A"), 2, time.length + 2)
}
@@ -106,6 +106,6 @@ object CpViewHelper {
message.length,
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
)
DialogManager(context).showOkCancelDialog(title, builder, "", "取消", true, listener)
DialogManager(context).showOkCancelDialog(title, builder, "", "取消", true, listener)
}
}

View File

@@ -30,7 +30,7 @@ import org.greenrobot.eventbus.ThreadMode
class CpInviteRecordActivity : BaseBindingActivity<ActivityCpInviteRecordBinding>() {
private val vm: CpViewModel by viewModels()
private lateinit var adapter: InviteRecordAdapter
private val type = 1// 1-别人给我发的邀2-我给别人发的邀
private val type = 1// 1-別人給我發的邀2-我給別人發的邀
override fun init() {
initTitleBar(ResUtil.getString(R.string.cp_activity_cpinviterecordactivity_01))
@@ -107,12 +107,12 @@ class CpInviteRecordActivity : BaseBindingActivity<ActivityCpInviteRecordBinding
private fun showConfirmDialog(item: CpInviteDetailEntity, isAgree: Boolean) {
val shb = CpViewHelper.getColorSpan(
"是否${if (isAgree) "同意" else "拒"}${item.inviteNick}CP\n",
"是否${if (isAgree) "同意" else "拒"}${item.inviteNick}CP\n",
Color.parseColor("#4C5AF1"),
5, 5 + item.inviteNick.length
)
if (isAgree) {
val str = "(同意将自动拒绝其他邀"
val str = "(同意將自動拒絕其他邀"
val append = CpViewHelper.getSizeSpan(str, 12f, 0, str.length)
shb.append(append)
}

View File

@@ -42,7 +42,7 @@ class CpInviteReplyDialog(context: Context) :
private fun setPage(data: CpInviteDetailEntity) {
binding.tvDialogTitle.text = getColorSpan(
"${data.inviteNick}请你达成CP系,是否同意?",
"${data.inviteNick}請你達成CP系,是否同意?",
Color.parseColor("#4C5AF1"),
0,
data.inviteNick.length
@@ -128,6 +128,6 @@ class CpInviteReplyDialog(context: Context) :
interface ReplyListener {
fun onAgree()
fun onRefuse()
fun onTimeOut()//计时过
fun onTimeOut()//計時過
}
}

View File

@@ -32,14 +32,14 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
}
/**
* 邀好友组队
* 邀好友組隊
*/
fun inviteCp(uid: Long) {
cpViewModel.getCpInvitePageData(uid)
}
/**
* 示邀请弹窗 ,填写邀请CP所需的信息
* 示邀請彈窗 ,填寫邀請CP所需的信息
*/
private fun showInvitePageDialog(info: CpInvitePageEntity) {
@@ -51,7 +51,7 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
}
/**
* 显示发送邀请确认弹
* 顯示發送邀請確認彈
*/
private fun showSentTipDialog(
cpInvitePageEntity: CpInvitePageEntity,
@@ -59,8 +59,8 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
) {
CpViewHelper.showInviteTipDialog(
fragment.requireContext(),
"定送出${cpInvitePageEntity.propsName}礼物与Ta成CP关系吗",
"(若方拒接或24小未同意,钻石将会返还"
"定送出${cpInvitePageEntity.propsName}禮物與Ta成CP關系嗎",
"(若方拒接或24小未同意,鉆石將會返還"
) {
cpViewModel.makeCpInvite(
cpInvitePageEntity.acceptUid,
@@ -68,7 +68,7 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
cpInvitePageEntity.propsId
) {
DialogManager(fragment.context).showOkCancelDialog(
"石余不足,前去充值!"
"石余不足,前去充值!"
) { ChargeActivity.start(fragment.requireContext()) }
}
}

View File

@@ -100,11 +100,11 @@ public class ExchangeGoldActivity extends BaseActivity {
if (walletNum != null) {
long value = (long) (walletNum.getDiamondNum() - walletNum.getDiamondNum() % 10);
int result = (int) (value * SharedPreferenceUtils.getExchangeGoldRate());
exchangeJewNumber.setHint(String.format("请输入兑换的钻石数量 (最多可兑换%1$s)", result + ""));
exchangeJewNumber.setHint(String.format("請輸入兌換的鉆石數量 (最多可兌換%1$s)", result + ""));
jewNumber.setText(getString(R.string.jewel_format, FormatUtils.formatBigDecimal(walletNum.getDiamondNum())));
goldNumber.setText(getString(R.string.gold_format, FormatUtils.formatBigDecimal(walletNum.getDiamondNum())));
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
changeResultNumStyle();
PayModel.get().setCurrentWalletInfo(walletNum);
}
@@ -131,8 +131,8 @@ public class ExchangeGoldActivity extends BaseActivity {
Long value = Long.parseLong(str);
if (isTenMultiple(value)) {
int result = (int) (value * SharedPreferenceUtils.getExchangeGoldRate());
exchangeGoldNumber.setText(result + "");
// tvExchangeHammarNum.setText((result/1000*2) + "子");
exchangeGoldNumber.setText(result + "");
// tvExchangeHammarNum.setText((result/1000*2) + "子");
changeResultNumStyle();
if (walletInfo != null && value <= walletInfo.getDiamondNum()) {
btnEnable = true;
@@ -140,15 +140,15 @@ public class ExchangeGoldActivity extends BaseActivity {
tvInputTip.setVisibility(View.GONE);
exchangeJewNumber.setTextColor(getResources().getColor(R.color.text_tertiary));
} else {
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
changeResultNumStyle();
tvInputTip.setVisibility(View.VISIBLE);
exchangeJewNumber.setTextColor(getResources().getColor(R.color.color_FF3852));
}
} else {
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
exchangeGoldNumber.setText("0");
// tvExchangeHammarNum.setText("0子");
changeResultNumStyle();
tvInputTip.setVisibility(View.GONE);
exchangeJewNumber.setTextColor(getResources().getColor(R.color.text_tertiary));
@@ -180,12 +180,12 @@ public class ExchangeGoldActivity extends BaseActivity {
}
private void changeResultNumStyle() {
// if("0子".equals(tvExchangeHammarNum.getText().toString())){
// if("0子".equals(tvExchangeHammarNum.getText().toString())){
// tvExchangeHammarNum.setTextColor(getResources().getColor(R.color.text_color_secondary));
// } else {
// tvExchangeHammarNum.setTextColor(getResources().getColor(R.color.text_color_primary));
// }
if ("0".equals(exchangeGoldNumber.getText().toString())) {
if ("0".equals(exchangeGoldNumber.getText().toString())) {
exchangeGoldNumber.setTextColor(getResources().getColor(R.color.text_color_secondary));
} else {
exchangeGoldNumber.setTextColor(getResources().getColor(R.color.text_color_primary));
@@ -194,7 +194,7 @@ public class ExchangeGoldActivity extends BaseActivity {
public void onExchangeGold(WalletInfo walletInfo) {
getDialogManager().dismissDialog();
toast("兑换成功");
toast("兌換成功");
exchangeJewNumber.setText("");
if (walletInfo == null) {
return;
@@ -209,7 +209,7 @@ public class ExchangeGoldActivity extends BaseActivity {
}
public void commit(long value, int hammerNum, String pwd) {
getDialogManager().showProgressDialog(ExchangeGoldActivity.this, "请稍后...");
getDialogManager().showProgressDialog(ExchangeGoldActivity.this, "請稍後...");
PayModel.get().exchangeGold((int) value, hammerNum, DESAndBase64(pwd))
.subscribe(new BeanObserver<WalletInfo>() {
@Override

View File

@@ -64,7 +64,7 @@ class VipBroadcastDialog : BaseDialog<DialogVipBroadcastBinding>() {
if (beanResult.isSuccess) {
beanResult.data?.let {
binding.clRoot.isVisible = true
binding.tvSendLimit.text = "剩余次${it.remainCount}/${it.totalCount}"
binding.tvSendLimit.text = "剩余次${it.remainCount}/${it.totalCount}"
disposable?.dispose()
disposable = Observable.interval(0, 1, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
@@ -72,12 +72,12 @@ class VipBroadcastDialog : BaseDialog<DialogVipBroadcastBinding>() {
val remainTime =
(CurrentTimeUtils.getCurrentTime() - it.lastSendTime) / 1000
if (remainTime > 60) {
binding.tvSendTip.text = "发布后1分钟内不可使用小喇叭~"
binding.tvSendTip.text = "發布後1分鐘內不可使用小喇叭~"
binding.ivSend.isEnabled = true
disposable?.dispose()
} else {
binding.ivSend.isEnabled = false
binding.tvSendTip.text = "${60 - remainTime}可再次使用喇叭喊~"
binding.tvSendTip.text = "${60 - remainTime}可再次使用喇叭喊~"
}
}
}

View File

@@ -66,6 +66,6 @@ class VipUpgradeDialog : BaseDialog<DialogVipUpgradeBinding>() {
} catch (e: MalformedURLException) {
}
binding.tvLevelDesc.text = "恭喜你成${vipInfo.vipName}」!前已自佩戴该等级装扮,是否保留原有扮?"
binding.tvLevelDesc.text = "恭喜你成${vipInfo.vipName}」!前已自佩戴該等級裝扮,是否保留原有扮?"
}
}

View File

@@ -45,7 +45,7 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
if (view.id == R.id.tv_set) {
adminAdapter.getItem(position)?.let {
dialogManager.showOkCancelDialog(
"定要添加用 ${it.nick} (PekoID:${it.erbanNo})为公会超级管理员吗?",
"定要添加用 ${it.nick} (PekoID:${it.erbanNo})為公會超級管理員嗎?",
true
) {
SuperAdminRoomSetActivity.start(this, clanId, it.uid)
@@ -58,7 +58,7 @@ class SuperAdminAddActivity : BaseViewBindingActivity<ActivitySuperAdminAddBindi
binding.tvSearch.setOnClickListener {
val id = binding.searchEdit.text?.toString()?.toLongOrNull()
if (id == null) {
"请输入Peko!".toast()
"請輸入Peko!".toast()
} else {
searchId = id
loadData()

View File

@@ -96,7 +96,7 @@ class SuperAdminManageActivity : BaseViewBindingActivity<ActivitySuperAdminManeg
popupWindow.dismiss()
}
contentView.findViewById<View>(R.id.tv_remove).setOnClickListener {
dialogManager.showOkCancelDialog("定要移除 ${superAdminInfo.nick} 的公会超级管理身份?",true) {
dialogManager.showOkCancelDialog("定要移除 ${superAdminInfo.nick} 的公會超級管理身份?",true) {
popupWindow.dismiss()
HallModel.get().removeSuperAdmin(superAdminInfo.uid)
.compose(bindToLifecycle())

View File

@@ -18,7 +18,7 @@ class ManageSuperAdminAdapter :
ImageLoadUtils.loadAvatar(item.avatar, helper.getView(R.id.iv_avatar))
helper.setText(R.id.tv_nickname,item.nick)
.setText(R.id.tv_id,"Peko:${item.erbanNo}")
.setText(R.id.tv_id,"Peko:${item.erbanNo}")
.addOnClickListener(R.id.iv_more)
val rvRoom = helper.getView<RecyclerView>(R.id.rv_room)
@@ -32,7 +32,7 @@ class ManageSuperAdminAdapter :
)
)
.setRecyclerView(rvRoom)
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暂无管理的房"))
.setEmptyView(EmptyViewHelper.createEmptyView(mContext, "暫無管理的房"))
.setAdapter(ManageRoomAdapter())
.build()
}

View File

@@ -34,7 +34,7 @@ import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
/**
* <p> 趴房model层:数据获取 </p>
* <p> 趴房model層:數據獲取 </p>
*
* @author jiahui
* @date 2017/12/8
@@ -47,12 +47,12 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
*
*
*/
@Override
public Single<String> lockMicroPhone(int micPosition, String roomUid, String ticker) {
return mHomePartyService.lockMicroPhone(micPosition, "1", roomUid, ticker,
AuthModel.get().getCurrentUid())
AuthModel.get().getCurrentUid())
.compose(RxHelper.handleCommon(() -> ""))
.doOnSuccess(s -> {
if (SuperAdminUtil.isSuperAdmin()) {
@@ -68,19 +68,19 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
* 释放该麦坑的
* 釋放該麥坑的
*
* @param micPosition
*/
@Override
public Single<String> unLockMicroPhone(int micPosition, String roomUid, String ticker) {
return mHomePartyService.lockMicroPhone(micPosition, "0", roomUid, ticker,
AuthModel.get().getCurrentUid())
AuthModel.get().getCurrentUid())
.compose(RxHelper.handleCommon(() -> ""));
}
/**
* 更新
* 更新
*/
@Override
public void updateMicQueue(final String roomId, final String key, String value) {
@@ -89,14 +89,14 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
.setCallback(new RequestCallbackWrapper<Void>() {
@Override
public void onResult(int i, Void aVoid, Throwable throwable) {
Logger.i("%1$s房更新序%2$s成功", roomId, key);
Logger.i("%1$s房更新序%2$s成功", roomId, key);
}
});
}
/**
* 取固定成员(创建者,管理,普通用,受限用
* 取固定成員(創建者,管理,普通用,受限用
*
* @param roomId
* @param time
@@ -140,7 +140,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
* 开麦
* 開麥
*
* @param micPosition
* @param roomUid
@@ -151,7 +151,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
* 闭麦
* 閉麥
*
* @param micPosition
* @param roomUid
@@ -164,7 +164,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
String resource = (String) NobleUtil.getResource(NobleResourceType.KEY_LEVEL, roomQueueInfo.mChatRoomMember);
if (!TextUtils.isEmpty(resource)) {
if (!NobleUtil.canKickMicroOrNot(Integer.valueOf(resource))) {
String tips = "不能禁" + NobleUtil.getNobleName(Integer.valueOf(resource)) + "陛下哦";
String tips = "不能禁" + NobleUtil.getNobleName(Integer.valueOf(resource)) + "陛下哦";
SingleToastUtil.showToastShort(tips);
return Single.error(new Throwable(tips));
}
@@ -174,20 +174,20 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
* 开闭麦接口
* 開閉麥接口
*
* @param micPosition
* @param state 1:闭麦0开麦
* @param state 1:閉麥0開麥
* @param roomUid
* @param ticket
*/
@Override
public Single<String> openOrCloseMicroPhone(int micPosition, int state, long roomUid, String ticket) {
return mHomePartyService.openMicroPhone(micPosition, state, roomUid, ticket,
AuthModel.get().getCurrentUid())
AuthModel.get().getCurrentUid())
.compose(RxHelper.handleCommon(() -> ""))
.doOnSuccess(s -> {
//如果是闭麦,并且是超管操作,需要公屏
//如果是閉麥,並且是超管操作,需要公屏
if (state == 1 && SuperAdminUtil.isSuperAdmin()) {
IMNetEaseManager.get()
.sendChatRoomMessage(
@@ -231,16 +231,16 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
}
/**
* 趴房间服务器相接口
* 趴房間服務器相接口
*/
private interface HomePartyService {
/**
* 坑,坑操作
* 坑,坑操作
*
* @param micPosition
* @param state 10
* @param roomUid 房主或管理id
* @param state 10
* @param roomUid 房主或管理id
* @param ticket
* @return
*/
@@ -254,10 +254,10 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
/**
* 锁麦,开麦操作
* 鎖麥,開麥操作
*
* @param micPosition
* @param state 1:闭麦0开麦
* @param state 1:閉麥0開麥
* @param roomUid
* @param ticket
* @return
@@ -265,15 +265,15 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
@FormUrlEncoded
@POST("room/mic/lockmic")
Single<ServiceResult<String>> openMicroPhone(@Field("position") int micPosition,
@Field("state") int state,
@Field("roomUid") long roomUid,
@Field("ticket") String ticket,
@Field("uid") long uid);
@Field("state") int state,
@Field("roomUid") long roomUid,
@Field("ticket") String ticket,
@Field("uid") long uid);
/**
* 开启相亲模式
* 開啟相親模式
*
* @return
*/
@@ -282,7 +282,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
Single<ServiceResult<String>> datingOpen(@Field("roomUid") long roomUid);
/**
* 关闭相亲模式
* 關閉相親模式
*
* @return
*/
@@ -291,7 +291,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
Single<ServiceResult<String>> datingClose(@Field("roomUid") long roomUid);
/**
* 相亲开始下一步
* 相親開始下一步
*
* @return
*/
@@ -300,7 +300,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
Single<ServiceResult<String>> datingNext(@Field("roomUserId") long roomUserId);
/**
* 相亲选
* 相親選
*
* @return
*/