|
@@ -4,12 +4,10 @@ import android.text.TextUtils
|
|
|
import android.widget.Toast
|
|
|
import androidx.activity.viewModels
|
|
|
import androidx.fragment.app.FragmentActivity
|
|
|
-import androidx.fragment.app.viewModels
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
import com.android.billingclient.api.Purchase
|
|
|
-import com.google.gson.Gson
|
|
|
import com.swago.baseswago.PayVm
|
|
|
import com.swago.baseswago.SwagoAdapter
|
|
|
import com.swago.baseswago.UserVm
|
|
@@ -17,7 +15,6 @@ import com.swago.baseswago.activity.BaseXActivity
|
|
|
import com.swago.baseswago.constant.ARouteConstant
|
|
|
import com.swago.baseswago.constant.UrlConstant
|
|
|
import com.swago.baseswago.dialog.CloseAccountDialog
|
|
|
-import com.swago.baseswago.dialog.ForceOfflineDialog
|
|
|
import com.swago.baseswago.dialog.InviteBindingDialog
|
|
|
import com.swago.baseswago.dialog.OrderLostDialog
|
|
|
import com.swago.baseswago.im.GroupMsgParser
|
|
@@ -62,7 +59,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
TUIKit.init(this, UrlConstant.getImId(), TUIKitConfigs.getConfigs())
|
|
|
PayManager.init()
|
|
|
IMMessageManager.groupMessageParser.add(GroupMsgParser())
|
|
|
-
|
|
|
+ SpUtil.putInt("isHomeBack" , 1)
|
|
|
//检查版本更新
|
|
|
checkVersionForUpdate()
|
|
|
|
|
@@ -203,6 +200,12 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
CloseAccountDialog.newInstance().show(currentActivity.supportFragmentManager,"CloseAccountDialog")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ homeVm.inviteLogData.observe(this){
|
|
|
+ if (!it.isNullOrEmpty()){
|
|
|
+ InviteBindingDialog.newInstance(it[0]).show(supportFragmentManager,"InviteBindingDialog")
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun onResume() {
|
|
@@ -211,6 +214,11 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
if (!IMUtil.checkIsLogin()) {
|
|
|
IMUtil.joinGroup(loginFun)
|
|
|
}
|
|
|
+ val isHomeBack = SpUtil.readInt("isHomeBack")
|
|
|
+ if (isHomeBack == 1){
|
|
|
+ homeVm.getInviteLog()
|
|
|
+ SpUtil.putInt("isHomeBack" , 0)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun onPause() {
|
|
@@ -269,6 +277,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
|
|
|
override fun toCreateNewOrder(productId: String) {}
|
|
|
|
|
|
override fun onBackPressed() {
|
|
|
+ SpUtil.putInt("isHomeBack" , 1)
|
|
|
moveTaskToBack(true)
|
|
|
}
|
|
|
|