|
@@ -27,6 +27,7 @@ import com.xhly.corelib.eventbus.UIEvent
|
27
|
27
|
import com.xhly.corelib.utils.AppUtils
|
28
|
28
|
import com.xhly.corelib.utils.GsonUtils
|
29
|
29
|
import com.xhly.corelib.utils.LogShow
|
|
30
|
+import com.xhly.corelib.utils.NetworkUtils
|
30
|
31
|
import com.xhly.corelib.utils.SystemUtil
|
31
|
32
|
import com.xhly.manageapp.ManageApplication
|
32
|
33
|
import com.xhly.manageapp.bean.EventLog
|
|
@@ -53,6 +54,7 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
|
53
|
54
|
//如果次数大于10则可以打开设置页面
|
54
|
55
|
private var showSettingNum=0
|
55
|
56
|
private var waitDialog:WaitDialog?=null
|
|
57
|
+ private var tipsDialog:CustomDialog?=null
|
56
|
58
|
override fun getBinding() = ActivityLoginBinding.inflate(layoutInflater)
|
57
|
59
|
|
58
|
60
|
override fun initData() {
|
|
@@ -271,6 +273,9 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
|
271
|
273
|
|
272
|
274
|
override fun onResume() {
|
273
|
275
|
super.onResume()
|
|
276
|
+ if (!NetworkUtils.isAvailable(this)){
|
|
277
|
+ showTipsDialog(getString(R.string.checknettips))
|
|
278
|
+ }
|
274
|
279
|
useTimeStrategy()
|
275
|
280
|
}
|
276
|
281
|
|
|
@@ -403,6 +408,24 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
|
403
|
408
|
|
404
|
409
|
}
|
405
|
410
|
|
|
411
|
+ private fun showTipsDialog(msg: String) {
|
|
412
|
+ tipsDialog?.dismiss()
|
|
413
|
+ tipsDialog=CustomDialog.build()
|
|
414
|
+ .setCustomView(object : OnBindView<CustomDialog>(R.layout.layout_notice_dialog) {
|
|
415
|
+ override fun onBind(dialog: CustomDialog, v: View) {
|
|
416
|
+ val closeBtn = v.findViewById<Button>(R.id.dialog_close_btn)
|
|
417
|
+ val titleTv = v.findViewById<TextView>(R.id.dialog_title_tv)
|
|
418
|
+ val contentTv = v.findViewById<TextView>(R.id.dialog_content_tv)
|
|
419
|
+ contentTv.text=msg
|
|
420
|
+ titleTv.text="通知"
|
|
421
|
+ closeBtn.setOnClickListener {
|
|
422
|
+ dialog.dismiss()
|
|
423
|
+ }
|
|
424
|
+ }
|
|
425
|
+ }).setCancelable(false).setMaskColor(Color.parseColor("#66000000"))
|
|
426
|
+ .setAlign(CustomDialog.ALIGN.CENTER).show()
|
|
427
|
+ }
|
|
428
|
+
|
406
|
429
|
private fun postLogPush(pushType:Int){
|
407
|
430
|
val pushBean=LogPushBean()
|
408
|
431
|
pushBean.pushType=pushType
|