|
@@ -49,7 +49,6 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
private val officialVm by viewModels<OfficialVm>()
|
|
|
private val homeVm by viewModels<HomeVm>()
|
|
|
private val payVm by viewModels<PayVm>()
|
|
|
- private val userVm by viewModels<UserVm>()
|
|
|
|
|
|
private val listFragment =
|
|
|
arrayListOf(HomeFragment(), MessageFragment(), MineFragment())
|
|
@@ -190,21 +189,12 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
}
|
|
|
|
|
|
override fun initLiveData() {
|
|
|
- homeVm.changeNameChangeFun = {
|
|
|
- userVm.getUserInfo()
|
|
|
- }
|
|
|
-
|
|
|
homeVm.closeAccountFun = {
|
|
|
val currentActivity = ActivityManagerUtil.get().currentActivity()
|
|
|
if (currentActivity is FragmentActivity){
|
|
|
CloseAccountDialog.newInstance().show(currentActivity.supportFragmentManager,"CloseAccountDialog")
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- userVm.userInfoLiveData.observe(this) {
|
|
|
- UserInfo.setUserInfo(it)
|
|
|
- SpUtil.putString("user_info", Gson().toJson(it))
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
override fun onResume() {
|