|
@@ -42,7 +42,6 @@ import com.xhly.manageapp.broadcastreceiver.AppInstallReceiver
|
42
|
42
|
import com.xhly.manageapp.databinding.ActivityMainBinding
|
43
|
43
|
import com.xhly.manageapp.service.ManageAccessibilityService
|
44
|
44
|
import com.xhly.manageapp.service.websocket.AppSocket
|
45
|
|
-import com.xhly.manageapp.service.websocket.AppSocketService
|
46
|
45
|
import com.xhly.manageapp.ui.ManageActivity
|
47
|
46
|
import com.xhly.manageapp.ui.login.activity.LoginActivity
|
48
|
47
|
import com.xhly.manageapp.ui.main.viewmodel.MainViewModel
|
|
@@ -63,10 +62,10 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
63
|
62
|
|
64
|
63
|
override fun initData() {
|
65
|
64
|
val json = spUtils.getFromJson(Const.USERINFO, UserBean().javaClass)
|
66
|
|
- if (json==null){
|
|
65
|
+ if (json == null) {
|
67
|
66
|
loginOut()
|
68
|
67
|
return
|
69
|
|
- }else{
|
|
68
|
+ } else {
|
70
|
69
|
userBean = json as UserBean
|
71
|
70
|
}
|
72
|
71
|
val getAppList1 = AppUtils.GetAppList(this)
|
|
@@ -122,7 +121,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
122
|
121
|
|
123
|
122
|
override fun initView() {
|
124
|
123
|
userBean?.let {
|
125
|
|
- mBinding.usernameTv.text=it.username
|
|
124
|
+ mBinding.usernameTv.text = it.username
|
126
|
125
|
|
127
|
126
|
}
|
128
|
127
|
mBinding.loginoutIv.setOnClickListener {
|
|
@@ -308,7 +307,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
308
|
307
|
}
|
309
|
308
|
|
310
|
309
|
Const.CODE2001.toString() -> {
|
311
|
|
-
|
|
310
|
+ val message = uiEvent.message
|
|
311
|
+ showNoticeDialog(message)
|
312
|
312
|
}
|
313
|
313
|
|
314
|
314
|
Const.CODE2002.toString() -> {
|
|
@@ -497,18 +497,17 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
|
497
|
497
|
}
|
498
|
498
|
cancelTv.setOnClickListener {
|
499
|
499
|
dialog.dismiss()
|
500
|
|
- showNoticeDialog()
|
501
|
500
|
}
|
502
|
501
|
}
|
503
|
502
|
}).setCancelable(false).setMaskColor(Color.parseColor("#66000000"))
|
504
|
503
|
.setAlign(CustomDialog.ALIGN.CENTER).show()
|
505
|
504
|
}
|
506
|
505
|
|
507
|
|
- private fun showNoticeDialog() {
|
|
506
|
+ private fun showNoticeDialog(msg: String) {
|
508
|
507
|
CustomDialog.build()
|
509
|
508
|
.setCustomView(object : OnBindView<CustomDialog>(R.layout.layout_notice_dialog) {
|
510
|
509
|
override fun onBind(dialog: CustomDialog, v: View) {
|
511
|
|
- var closeBtn = v.findViewById<Button>(R.id.dialog_close_btn)
|
|
510
|
+ val closeBtn = v.findViewById<Button>(R.id.dialog_close_btn)
|
512
|
511
|
closeBtn.setOnClickListener {
|
513
|
512
|
dialog.dismiss()
|
514
|
513
|
|