fix bugs.1 72
This commit is contained in:
@@ -81,11 +81,7 @@ open class Application : CommonAppContext() {
|
||||
|
||||
override fun onNext(t: IndexRecommendRoom) {
|
||||
if (!t.room_id.isNullOrEmpty()) {
|
||||
inviteDialog = activity?.let { InviteDialog(it, t) }
|
||||
if (inviteDialog?.isShowing == false) {
|
||||
inviteDialog?.setData(t)
|
||||
inviteDialog?.show()
|
||||
}
|
||||
showInviteDialog(activity, t)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -98,6 +94,13 @@ open class Application : CommonAppContext() {
|
||||
})
|
||||
}
|
||||
|
||||
fun showInviteDialog(activity: Activity?,t: IndexRecommendRoom) {
|
||||
if (inviteDialog == null) {
|
||||
inviteDialog = activity?.let { InviteDialog(it, t) }
|
||||
}
|
||||
inviteDialog?.setData(t)
|
||||
}
|
||||
|
||||
private fun initLogUtils() {
|
||||
LogUtils.getConfig()
|
||||
.setLogSwitch(true) // 全局开关
|
||||
|
||||
@@ -892,11 +892,8 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
|
||||
@Override
|
||||
public void index_recommend_room(IndexRecommendRoom indexRecommendRoom) {
|
||||
|
||||
if (indexRecommendRoom != null && !Objects.requireNonNull(indexRecommendRoom.getRoom_id()).isEmpty()) {
|
||||
inviteDialog = new InviteDialog(this, indexRecommendRoom);
|
||||
inviteDialog.setData(indexRecommendRoom);
|
||||
inviteDialog.show();
|
||||
Application.Companion.getInstance().showInviteDialog(this,indexRecommendRoom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ class InviteDialog(context: Context, data: IndexRecommendRoom?) :
|
||||
}
|
||||
|
||||
fun setData(data: IndexRecommendRoom?) {
|
||||
|
||||
this.data = data
|
||||
// 设置房间数据
|
||||
data?.let { roomData ->
|
||||
@@ -86,6 +87,12 @@ class InviteDialog(context: Context, data: IndexRecommendRoom?) :
|
||||
// 仍然启动倒计时,让用户可以关闭对话框
|
||||
startCountDown()
|
||||
}
|
||||
|
||||
if (isShowing){
|
||||
return
|
||||
}
|
||||
|
||||
super.show()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user