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