|
@@ -72,13 +72,13 @@ class PKInviteDialog : BaseXDFragment<DialogPkInviteBinding>(), RoomTimer.TimeTi
|
|
}
|
|
}
|
|
|
|
|
|
override fun initLiveData() {
|
|
override fun initLiveData() {
|
|
- pkVm.inviteSuccessLiveData.observe(this){
|
|
|
|
|
|
+ pkVm.inviteSuccessLiveData.observe(viewLifecycleOwner){
|
|
timeCount = 30
|
|
timeCount = 30
|
|
binding.tvTimeCount.visibility = View.VISIBLE
|
|
binding.tvTimeCount.visibility = View.VISIBLE
|
|
binding.tvTimeCount.text = AppContext.getContext().resources.getString(R.string.inviting_time).format(timeCount)
|
|
binding.tvTimeCount.text = AppContext.getContext().resources.getString(R.string.inviting_time).format(timeCount)
|
|
}
|
|
}
|
|
|
|
|
|
- pkVm.cancelPKSuccessLiveData.observe(this){
|
|
|
|
|
|
+ pkVm.cancelPKSuccessLiveData.observe(viewLifecycleOwner){
|
|
binding.tvInvite.visibility = View.VISIBLE
|
|
binding.tvInvite.visibility = View.VISIBLE
|
|
binding.tvCancel.visibility = View.GONE
|
|
binding.tvCancel.visibility = View.GONE
|
|
binding.tvTimeCount.visibility = View.GONE
|
|
binding.tvTimeCount.visibility = View.GONE
|
|
@@ -88,6 +88,8 @@ class PKInviteDialog : BaseXDFragment<DialogPkInviteBinding>(), RoomTimer.TimeTi
|
|
override fun onDestroyView() {
|
|
override fun onDestroyView() {
|
|
PKStateManager.removePKListener(this)
|
|
PKStateManager.removePKListener(this)
|
|
RoomTimer.timeTickList.remove(this)
|
|
RoomTimer.timeTickList.remove(this)
|
|
|
|
+ pkVm.inviteSuccessLiveData.removeObservers(viewLifecycleOwner)
|
|
|
|
+ pkVm.cancelPKSuccessLiveData.removeObservers(viewLifecycleOwner)
|
|
super.onDestroyView()
|
|
super.onDestroyView()
|
|
}
|
|
}
|
|
|
|
|