feat:完善全服红包跳转逻辑
This commit is contained in:
@@ -67,7 +67,7 @@ import com.yizhuan.erban.avroom.fragment.HomePartyFragment;
|
||||
import com.yizhuan.erban.avroom.fragment.InputPwdDialogFragment;
|
||||
import com.yizhuan.erban.avroom.presenter.AvRoomPresenter;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageOpenDialog;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageHandler;
|
||||
import com.yizhuan.erban.avroom.view.IAvRoomView;
|
||||
import com.yizhuan.erban.avroom.widget.VerticalViewPagerAdapter;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
@@ -130,7 +130,6 @@ import com.yizhuan.xchat_android_core.patriarch.event.CloseMinRoomEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.PmDismissAllLimitDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.exception.PmRoomLimitException;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
@@ -164,9 +163,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -221,7 +218,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private RoomInfo mRoomInfo;
|
||||
private ImageView ivHeadWear;
|
||||
private MonsterDialog monsterDialog;
|
||||
private List<RedPackageOpenDialog> openDialogs;
|
||||
private ViewPager2 viewpager;
|
||||
private VerticalViewPagerAdapter mAdapter;
|
||||
/*********************************显示全服礼物***************************************/
|
||||
@@ -514,7 +510,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
if (giftList != null) {
|
||||
giftList.clear();
|
||||
}
|
||||
if (!isResume) showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
isResume = true;
|
||||
}
|
||||
|
||||
@@ -619,9 +614,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
case RoomEvent.MY_SELF_KICK_OUT_ROOM_BY_S_ADMIN:
|
||||
toBack(true);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_RED_PACKAGE:
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -683,6 +675,17 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
RxBus.get().post(new ShowGiftDialogEvent().setGiftId(giftId));
|
||||
giftId = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 临时方案:后续逐步完善整个房间的RoomContext替换计划
|
||||
* PS:目前房间进入的逻辑有些凌乱,没有明确的生命周期,看代码逻辑,无论是第一次还是再次进入都会走这里,所以在这里绑定View
|
||||
*/
|
||||
getRoomContext().onViewAttach(this);
|
||||
|
||||
/**
|
||||
* 每次View重新创建(意味着可能在房间外点了红包),就重新尝试加载红包并展示
|
||||
*/
|
||||
tryShowSourceRedPackage();
|
||||
}
|
||||
|
||||
private void showLiveFinishView(long uid) {
|
||||
@@ -719,42 +722,25 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
AvRoomDataManager.get().release();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void showRedPackage(RoomInfo roomInfo) {
|
||||
// if (roomInfo == null) return;
|
||||
// RedPackageNotifyInfo inRoomNotifyInfo = (RedPackageNotifyInfo) getIntent().getSerializableExtra("notifyInfo");
|
||||
// Map<String, Long> redMap = DemoCache.readRedPackage();
|
||||
// RedPackageModel.INSTANCE.getRedPackage(roomInfo.getUid())
|
||||
// .compose(bindToLifecycle())
|
||||
// .doFinally(() -> {
|
||||
// if (inRoomNotifyInfo != null && (redMap == null || !redMap.containsKey(inRoomNotifyInfo.getRedEnvelopeId()))) {
|
||||
// showRedPackageOpenDialog(inRoomNotifyInfo);
|
||||
// }
|
||||
// })
|
||||
// .filter(notifyInfo -> inRoomNotifyInfo == null || !notifyInfo.getRedEnvelopeId().equals(inRoomNotifyInfo.getRedEnvelopeId()))
|
||||
// .subscribe(this::showRedPackageOpenDialog);
|
||||
}
|
||||
|
||||
private void showRedPackageOpenDialog(RedPackageNotifyInfo notifyInfo) {
|
||||
if (!isResume) return;
|
||||
if (openDialogs == null) {
|
||||
openDialogs = new ArrayList<>();
|
||||
}
|
||||
RedPackageOpenDialog openDialog = RedPackageOpenDialog.Companion.newInstance(notifyInfo);
|
||||
openDialog.show(this);
|
||||
if (openDialog.getDialog() != null) {
|
||||
openDialog.getDialog().setOnDismissListener(dialog -> openDialogs.remove(openDialog));
|
||||
}
|
||||
openDialogs.add(openDialog);
|
||||
if (openDialogs.size() >= SHOW_RED_DIALOG_MAX) {
|
||||
openDialogs.get(SHOW_RED_DIALOG_MAX - 1).dismissAllowingStateLoss();
|
||||
/**
|
||||
* 尝试展示来源红包(在房间外点击红包入口进入房间时)
|
||||
*/
|
||||
private void tryShowSourceRedPackage() {
|
||||
try {
|
||||
RedPackageNotifyInfo inRoomNotifyInfo = (RedPackageNotifyInfo) getIntent().getSerializableExtra("notifyInfo");
|
||||
if (inRoomNotifyInfo != null) {
|
||||
RedPackageHandler handler = getRoomContext().findAbility(RedPackageHandler.class.getSimpleName());
|
||||
if (handler != null) {
|
||||
long id = Long.parseLong(inRoomNotifyInfo.getRedEnvelopeId());
|
||||
handler.tryShowRedPackage(id);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void dismissRedPackageDialog() {
|
||||
if (openDialogs != null) {
|
||||
openDialogs.clear();
|
||||
}
|
||||
if (mCurrentFragment != null) {
|
||||
mCurrentFragment.dismissSendRedPackageDialog();
|
||||
}
|
||||
@@ -1065,8 +1051,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
@Override
|
||||
public void enterRoomSuccess() {
|
||||
showRoomFragment(false);
|
||||
// TODO 临时方案:后续逐步完善整个房间的RoomContext替换计划
|
||||
getRoomContext().onViewAttach(this);
|
||||
//获取管理员
|
||||
getMvpPresenter().getNormalChatMember();
|
||||
getMvpPresenter().getSuperAdminList();
|
||||
@@ -1081,7 +1065,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
DemoCache.readNewUserChargeGift() == 0) {
|
||||
DemoCache.saveNewUserChargeGift(1);
|
||||
}
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,6 @@ import com.yizhuan.xchat_android_core.redpackage.RedPackageModel
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageNotifyInfo
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomContext
|
||||
import com.yizhuan.xchat_android_core.support.room.RoomHandler
|
||||
import com.yizhuan.xchat_android_core.support.room.lifecycle.RoomLifecycle
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/10/26 11:26
|
||||
@@ -34,6 +33,22 @@ class RedPackageHandler : RoomHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试展示红包
|
||||
* PS:目前这个方法仅为了解决:通过房间外的红包入口进入房间后,需要查询该红包,展示出来。
|
||||
*/
|
||||
fun tryShowRedPackage(redPackageId: Long) {
|
||||
val disposable = RedPackageModel.getRedPackage(redPackageId)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({ item ->
|
||||
if (item.state != 3 && item.state != 6 && item.state != 4) {
|
||||
roomView?.getActivity().let {
|
||||
RedPackageOpenDialog2.newInstance(item).show(it)
|
||||
}
|
||||
}
|
||||
}, {})
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听房间信令
|
||||
*/
|
||||
@@ -48,7 +63,7 @@ class RedPackageHandler : RoomHandler() {
|
||||
(it.chatRoomMessage.attachment as RedPackageAttachment).getRedPackageNotifyInfo()
|
||||
}
|
||||
.subscribe { data: RedPackageNotifyInfo ->
|
||||
handleRoomRedPackage(data)
|
||||
handleRoomRedPackage(data, true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,39 +78,48 @@ class RedPackageHandler : RoomHandler() {
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({ data ->
|
||||
logD("requestLatestRoomRedPackage() data:$data")
|
||||
handleRoomRedPackage(data)
|
||||
}, {
|
||||
|
||||
})
|
||||
handleRoomRedPackage(data, false)
|
||||
}, {})
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理厅内红包,非全服红包
|
||||
* @param isSignaling 是否来自信令?
|
||||
*/
|
||||
private fun handleRoomRedPackage(data: RedPackageNotifyInfo) {
|
||||
if (data.kind == 0 || (data.kind == 1 && data.validityType == 0)) {
|
||||
//【旧版本-厅内红包:kind=0】、【新版本-厅内无门槛-立即生效红包:kind=1&validityType=0】
|
||||
tryShowOpenDialog(data)
|
||||
}
|
||||
private fun handleRoomRedPackage(data: RedPackageNotifyInfo, isSignaling: Boolean) {
|
||||
tryShowOpenDialog(data, isSignaling)
|
||||
updateIcon(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新红包入口图标
|
||||
*/
|
||||
private fun updateIcon(data: RedPackageNotifyInfo) {
|
||||
private fun updateIcon(data: RedPackageNotifyInfo?) {
|
||||
iconLiveData.postValue(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试展示红包领取弹窗
|
||||
*/
|
||||
private fun tryShowOpenDialog(data: RedPackageNotifyInfo) {
|
||||
private fun tryShowOpenDialog(data: RedPackageNotifyInfo, isSignaling: Boolean) {
|
||||
val activity = roomView?.getActivity() ?: return
|
||||
if (activity.isFinishing) {
|
||||
return
|
||||
}
|
||||
logD("tryShowOpenDialog() data:$data")
|
||||
RedPackageOpenDialog2().show(activity)
|
||||
if (!isSignaling) {
|
||||
return
|
||||
}
|
||||
if (data.kind == 0 || (data.kind == 1 && data.validityType == 0)) {
|
||||
//【旧版本-厅内红包:kind=0】、【新版本-厅内无门槛-立即生效红包:kind=1&validityType=0】
|
||||
RedPackageOpenDialog2.newInstance(data).show(activity)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求刷新Icon(数据已过期)
|
||||
*/
|
||||
fun requestRefreshIcon() {
|
||||
updateIcon(null)
|
||||
requestLatestRoomRedPackage()
|
||||
}
|
||||
}
|
@@ -38,6 +38,9 @@ class RedPackageWidget : ConstraintLayout, RoomWidget {
|
||||
private var numView: TextView? = null
|
||||
private var countDownDisposable: Disposable? = null
|
||||
private var data: RedPackageNotifyInfo? = null
|
||||
private val redPackageHandler: RedPackageHandler?
|
||||
get() = RoomContext.get()
|
||||
?.findAbility<RedPackageHandler>(RedPackageHandler::class.java.simpleName)
|
||||
|
||||
// 临时这样实现,后续优化进度弹窗
|
||||
private var dialogManager: DialogManager? = null
|
||||
@@ -150,11 +153,8 @@ class RedPackageWidget : ConstraintLayout, RoomWidget {
|
||||
}
|
||||
|
||||
private fun init(roomView: RoomView) {
|
||||
val context = roomView.getRoomContext()
|
||||
val lifecycleOwner = roomView.getLifecycleOwner()
|
||||
val handler =
|
||||
context?.findAbility<RedPackageHandler>(RedPackageHandler::class.java.simpleName)
|
||||
handler?.iconLiveData?.observe(lifecycleOwner) {
|
||||
redPackageHandler?.iconLiveData?.observe(lifecycleOwner) {
|
||||
loadData(it)
|
||||
}
|
||||
}
|
||||
@@ -202,8 +202,22 @@ class RedPackageWidget : ConstraintLayout, RoomWidget {
|
||||
val disposable = RedPackageModel.getRedPackage(data.redEnvelopeId.toLongOrDefault(0))
|
||||
.subscribe({ item ->
|
||||
dialogManager?.dismissDialog()
|
||||
roomView?.getActivity().let {
|
||||
RedPackageOpenDialog2.newInstance(item).show(it)
|
||||
when (item.state) {
|
||||
3 -> {
|
||||
redPackageHandler?.requestRefreshIcon()
|
||||
SingleToastUtil.showToast(R.string.red_package_result_empty_tips)
|
||||
}
|
||||
|
||||
6 -> {
|
||||
redPackageHandler?.requestRefreshIcon()
|
||||
SingleToastUtil.showToast(R.string.red_package_disabled_tips)
|
||||
}
|
||||
|
||||
else -> {
|
||||
roomView?.getActivity().let {
|
||||
RedPackageOpenDialog2.newInstance(item).show(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
SingleToastUtil.showToast(it.message)
|
||||
|
@@ -76,6 +76,43 @@ class RedPackageOpenDialog2 : BaseDialog<RedPackageOpenDialogBinding>() {
|
||||
private var opening = false
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 此入口来源仅限:【全服红包信令】、【厅内无门槛-立即生效红包信令】
|
||||
*/
|
||||
fun newInstance(data: RedPackageNotifyInfo): RedPackageOpenDialog2 {
|
||||
/**
|
||||
* 收到这两种信令直接展示即可,无需再次请求接口查询状态,
|
||||
* 但由于信令和接口查询的数据格式不一致,所以这里做下转换,达到逻辑共用
|
||||
*/
|
||||
val item = RedPackageData(
|
||||
amount = null,
|
||||
avatar = data.sendUserAvatar,
|
||||
beginTime = data.beginTime,
|
||||
commissionAmount = null,
|
||||
createTime = null,
|
||||
duration = null,
|
||||
endTime = null,
|
||||
finish = true,
|
||||
id = data.redEnvelopeId.toLongOrNull(),
|
||||
kind = data.kind,
|
||||
message = data.redEnvelopeMessage,
|
||||
nick = data.sendUserNick,
|
||||
num = null,
|
||||
originalAmount = null,
|
||||
position = null,
|
||||
roomTitle = null,
|
||||
roomUid = data.roomUid,
|
||||
//红包状态 1 开抢中 2 过时 3 抢光了 4 抢到了 5 将要开始 6 超时已退还
|
||||
state = null,
|
||||
type = null,
|
||||
updateTime = null,
|
||||
userId = null,
|
||||
validityType = data.validityType,
|
||||
result = null
|
||||
)
|
||||
return newInstance(item)
|
||||
}
|
||||
|
||||
fun newInstance(data: RedPackageData): RedPackageOpenDialog2 {
|
||||
return RedPackageOpenDialog2().apply {
|
||||
arguments = Bundle().apply {
|
||||
@@ -106,10 +143,6 @@ class RedPackageOpenDialog2 : BaseDialog<RedPackageOpenDialogBinding>() {
|
||||
binding.layoutBtn.singleClick {
|
||||
btnRunnable?.invoke()
|
||||
}
|
||||
|
||||
binding.ivSendAvatar.singleClick {
|
||||
showUserDialog(data.userId)
|
||||
}
|
||||
loadData(data)
|
||||
}
|
||||
|
||||
@@ -117,7 +150,19 @@ class RedPackageOpenDialog2 : BaseDialog<RedPackageOpenDialogBinding>() {
|
||||
* 加载红包数据
|
||||
*/
|
||||
private fun loadData(data: RedPackageData) {
|
||||
// 默认不可见先
|
||||
//红包状态 1 开抢中 2 过时 3 抢光了 4 抢到了 5 将要开始 6 超时已退还
|
||||
if (data.state == 4) {
|
||||
loadResult(data.result)
|
||||
} else {
|
||||
// else简单理解为可领取状态,正常情况下在RedPackageWidget点击时有异常状态过滤
|
||||
loadOpen(data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载可领取数据
|
||||
*/
|
||||
private fun loadOpen(data: RedPackageData) {
|
||||
binding.groupOpen.isVisible = true
|
||||
binding.groupResult.isVisible = false
|
||||
binding.ivSendAvatar.loadAvatar(data.avatar)
|
||||
@@ -300,66 +345,70 @@ class RedPackageOpenDialog2 : BaseDialog<RedPackageOpenDialogBinding>() {
|
||||
opening = true
|
||||
openResultRunnable = null
|
||||
startRedPacketAnim(binding.layoutBtn)
|
||||
RedPackageModel.openRedPackage(data.id ?: 0)
|
||||
val d = RedPackageModel.openRedPackage(data.id ?: 0)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).subscribe({
|
||||
if (isValidOfBtnAnimator) {
|
||||
btnAnimator?.cancel()
|
||||
openSuccess(it)
|
||||
onOpenSuccess(it)
|
||||
} else {
|
||||
openResultRunnable = {
|
||||
openSuccess(it)
|
||||
onOpenSuccess(it)
|
||||
}
|
||||
}
|
||||
}, {
|
||||
if (isValidOfBtnAnimator) {
|
||||
btnAnimator?.cancel()
|
||||
openFail(it)
|
||||
onOpenFail(it)
|
||||
} else {
|
||||
openResultRunnable = {
|
||||
openFail(it)
|
||||
onOpenFail(it)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开红包响应成功
|
||||
* @param data 结果
|
||||
* 加载结果
|
||||
*/
|
||||
private fun openSuccess(data: RedPackageInfo) {
|
||||
private fun loadResult(data: RedPackageInfo?) {
|
||||
binding.layoutContent.setBackgroundResource(R.drawable.red_package_result_bg)
|
||||
binding.groupOpen.isVisible = false
|
||||
binding.groupResult.isVisible = true
|
||||
binding.groupResultMoney.isVisible = false
|
||||
binding.tvResultEmptyTips.isVisible = false
|
||||
binding.ivResultSendAvatar.singleClick {
|
||||
showUserDialog(data.redEnvelopeVO?.userVO?.uid)
|
||||
}
|
||||
binding.ivResultSendAvatar.loadAvatar(data.redEnvelopeVO?.userVO?.avatar)
|
||||
binding.tvResultSendName.text = data.redEnvelopeVO?.userVO?.nick ?: ""
|
||||
val name = data.redEnvelopeVO?.userVO?.nick ?: ""
|
||||
binding.tvResultSendName.text = name.take(8) + "..的紅包"
|
||||
binding.tvMessage.text = data.redEnvelopeVO?.message
|
||||
binding.ivResultSendAvatar.loadAvatar(data?.redEnvelopeVO?.userVO?.avatar)
|
||||
binding.tvResultSendName.text = data?.redEnvelopeVO?.userVO?.nick ?: ""
|
||||
val name = data?.redEnvelopeVO?.userVO?.nick ?: ""
|
||||
binding.tvResultSendName.text = name?.take(8) + "..的紅包"
|
||||
binding.tvMessage.text = data?.redEnvelopeVO?.message
|
||||
binding.tvCount.text = R.string.red_package_result_count_format.toStringRes()
|
||||
.format(data.redEnvelopeVO?.pickNum ?: 0, data.redEnvelopeVO?.totalNum ?: 0)
|
||||
.format(data?.redEnvelopeVO?.pickNum ?: 0, data?.redEnvelopeVO?.totalNum ?: 0)
|
||||
|
||||
val adapter = RedPackageResultAdapter()
|
||||
adapter.setOnItemChildClickListener { _, view, position ->
|
||||
if (view.id == R.id.iv_avatar) {
|
||||
adapter.data.getOrNull(position)?.let {
|
||||
showUserDialog(it.userVO.uid)
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.recyclerView.adapter = adapter
|
||||
adapter.setNewData(data.redEnvelopeItemVOs)
|
||||
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||
adapter.setNewData(data?.redEnvelopeItemVOs)
|
||||
|
||||
when (data.redEnvelopeState) {
|
||||
when (data?.redEnvelopeState) {
|
||||
RedEnvelopeState.SUCCESS -> {
|
||||
binding.tvMoney.text = data.currentUserAmount.toString().substringBefore(".")
|
||||
binding.groupResultMoney.isVisible = true
|
||||
}
|
||||
|
||||
// 下面是延续老代码保留的
|
||||
RedEnvelopeState.TIME_OUT, RedEnvelopeState.REMAIN_ZERO, RedEnvelopeState.TIME_OUT_BACK -> {
|
||||
binding.tvResultEmptyTips.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开红包响应成功
|
||||
* @param data 结果
|
||||
*/
|
||||
private fun onOpenSuccess(data: RedPackageInfo) {
|
||||
loadResult(data)
|
||||
when (data.redEnvelopeState) {
|
||||
RedEnvelopeState.SUCCESS -> {
|
||||
// 下面这段是延续老代码保留的
|
||||
if (!AvRoomDataManager.get().isRoomFans) {
|
||||
AvRoomDataManager.get().roomUid.let {
|
||||
CollectionRoomModel.get().followRoom("1", it)
|
||||
@@ -370,19 +419,15 @@ class RedPackageOpenDialog2 : BaseDialog<RedPackageOpenDialogBinding>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RedEnvelopeState.TIME_OUT, RedEnvelopeState.REMAIN_ZERO, RedEnvelopeState.TIME_OUT_BACK -> {
|
||||
binding.groupResultMoney.isVisible = false
|
||||
binding.tvResultEmptyTips.isVisible = true
|
||||
}
|
||||
}
|
||||
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||
opening = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开红包响应失败
|
||||
*/
|
||||
private fun openFail(throwable: Throwable) {
|
||||
private fun onOpenFail(throwable: Throwable) {
|
||||
switchToOpenState()
|
||||
btnAnimator?.cancel()
|
||||
SingleToastUtil.showToast(throwable.message)
|
||||
|
@@ -26,12 +26,6 @@ class RedPackageResultAdapter :
|
||||
Locale.CHINA
|
||||
)
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
return super.onCreateViewHolder(parent, viewType).apply {
|
||||
this.addOnClickListener(R.id.iv_avatar)
|
||||
}
|
||||
}
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: RedEnvelopeItemVO) {
|
||||
helper.getView<ImageView>(R.id.iv_avatar).loadAvatar(item.userVO.avatar)
|
||||
val isSelf = item.userVO.uid == UserUtils.getUserUid()
|
||||
|
@@ -70,6 +70,7 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageGoRoomDialog;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageOpenDialog;
|
||||
import com.yizhuan.erban.avroom.redpackage.open.RedPackageOpenDialog2;
|
||||
import com.yizhuan.erban.common.LoadingFragment;
|
||||
import com.yizhuan.erban.common.NetworkErrorFragment;
|
||||
import com.yizhuan.erban.common.NoDataFragment;
|
||||
@@ -958,7 +959,7 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
RedPackageNotifyInfo notifyInfo = new Gson().fromJson(String.valueOf(baseProtocol.getData()), RedPackageNotifyInfo.class);
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && roomInfo.getUid() == notifyInfo.getRoomUid() && context instanceof AVRoomActivity) {
|
||||
RedPackageOpenDialog.Companion.newInstance(notifyInfo).show(BaseActivity.this);
|
||||
RedPackageOpenDialog2.Companion.newInstance(notifyInfo).show(BaseActivity.this);
|
||||
} else {
|
||||
RedPackageGoRoomDialog.Companion.newInstance(notifyInfo).show(this);
|
||||
}
|
||||
|
@@ -5180,6 +5180,7 @@
|
||||
<string name="red_package_open_tips_msg1">發送彈幕</string>
|
||||
<string name="red_package_open_tips_msg_end">可搶紅包</string>
|
||||
<string name="red_package_result_empty_tips">搶完了,下次早點來哦~</string>
|
||||
|
||||
<string name="red_package_disabled_tips">該紅包已失效</string>
|
||||
”
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user