|
@@ -1,12 +1,15 @@
|
|
package com.swago.home.official
|
|
package com.swago.home.official
|
|
|
|
|
|
|
|
+import android.view.View
|
|
import androidx.activity.viewModels
|
|
import androidx.activity.viewModels
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
import com.swago.baseswago.activity.BaseListActivity
|
|
import com.swago.baseswago.activity.BaseListActivity
|
|
import com.swago.baseswago.cusview.SwagoRecyclerView
|
|
import com.swago.baseswago.cusview.SwagoRecyclerView
|
|
|
|
+import com.swago.baseswago.dialog.InviteBindingDialog
|
|
import com.swago.baseswago.model.home.OfficialMsgModel
|
|
import com.swago.baseswago.model.home.OfficialMsgModel
|
|
|
|
+import com.swago.baseswago.model.im.BindAnchorData
|
|
import com.swago.baseswago.util.AppContext
|
|
import com.swago.baseswago.util.AppContext
|
|
import com.swago.home.R
|
|
import com.swago.home.R
|
|
import com.swago.home.databinding.ActivityOfficialMessageBinding
|
|
import com.swago.home.databinding.ActivityOfficialMessageBinding
|
|
@@ -18,6 +21,7 @@ import com.swago.home.databinding.ActivityOfficialMessageBinding
|
|
class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding, OfficialMsgModel.ListBean>() {
|
|
class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding, OfficialMsgModel.ListBean>() {
|
|
|
|
|
|
private val officialVm by viewModels<OfficialVm>()
|
|
private val officialVm by viewModels<OfficialVm>()
|
|
|
|
+ private lateinit var inviteData: BindAnchorData
|
|
|
|
|
|
override val smartRecyclerView: SwagoRecyclerView<OfficialMsgModel.ListBean> by lazy {
|
|
override val smartRecyclerView: SwagoRecyclerView<OfficialMsgModel.ListBean> by lazy {
|
|
binding.swagoRv as SwagoRecyclerView<OfficialMsgModel.ListBean>
|
|
binding.swagoRv as SwagoRecyclerView<OfficialMsgModel.ListBean>
|
|
@@ -38,6 +42,7 @@ class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding,
|
|
}
|
|
}
|
|
|
|
|
|
override fun initLiveData() {
|
|
override fun initLiveData() {
|
|
|
|
+ officialVm.getInviteLog()
|
|
officialVm.listMsgLiveData.observe(this){
|
|
officialVm.listMsgLiveData.observe(this){
|
|
if (it == null){
|
|
if (it == null){
|
|
smartRecyclerView.onFetchDataError()
|
|
smartRecyclerView.onFetchDataError()
|
|
@@ -45,5 +50,18 @@ class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding,
|
|
smartRecyclerView.onFetchDataFinish(it,true)
|
|
smartRecyclerView.onFetchDataFinish(it,true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ officialVm.inviteLogData.observe(this){
|
|
|
|
+ if (!it.isNullOrEmpty()){
|
|
|
|
+ binding.clHead.visibility = View.VISIBLE
|
|
|
|
+ inviteData = it[0]
|
|
|
|
+ binding.tvContent.text = AppContext.getContext().resources.getString(R.string.invites_you_to_join_his_guild)
|
|
|
|
+ .format(it[0].agentNickName, it[0].agentId, it[0].agentName)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ binding.clHead.setOnClickListener {
|
|
|
|
+ InviteBindingDialog.newInstance(inviteData)
|
|
|
|
+ .show(supportFragmentManager, "InviteBindingDialog")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|