Browse Source

1.添加测试的网络请求

master
wangwanlei 10 months ago
parent
commit
030599caea
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      app/src/main/java/com/xhly/manageapp/ui/MainActivity.kt

+ 10
- 1
app/src/main/java/com/xhly/manageapp/ui/MainActivity.kt View File

15
 import android.widget.TextView
15
 import android.widget.TextView
16
 import android.widget.Toast
16
 import android.widget.Toast
17
 import androidx.activity.addCallback
17
 import androidx.activity.addCallback
18
+import androidx.lifecycle.lifecycleScope
18
 import androidx.recyclerview.widget.GridLayoutManager
19
 import androidx.recyclerview.widget.GridLayoutManager
19
 import com.kongzue.dialogx.dialogs.CustomDialog
20
 import com.kongzue.dialogx.dialogs.CustomDialog
20
 import com.kongzue.dialogx.interfaces.OnBindView
21
 import com.kongzue.dialogx.interfaces.OnBindView
22
 import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
23
 import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
23
 import com.xhly.corelib.bean.AppInfo
24
 import com.xhly.corelib.bean.AppInfo
24
 import com.xhly.corelib.eventbus.UIEvent
25
 import com.xhly.corelib.eventbus.UIEvent
26
+import com.xhly.corelib.network.RetrofitService
25
 import com.xhly.corelib.utils.AppUtils
27
 import com.xhly.corelib.utils.AppUtils
26
 import com.xhly.corelib.utils.LogShow
28
 import com.xhly.corelib.utils.LogShow
27
 import com.xhly.manageapp.AppAdapter
29
 import com.xhly.manageapp.AppAdapter
28
 import com.xhly.manageapp.R
30
 import com.xhly.manageapp.R
31
+import com.xhly.manageapp.bean.LogdOperateBean
29
 import com.xhly.manageapp.broadcastreceiver.AppInstallReceiver
32
 import com.xhly.manageapp.broadcastreceiver.AppInstallReceiver
30
 import com.xhly.manageapp.databinding.ActivityMainBinding
33
 import com.xhly.manageapp.databinding.ActivityMainBinding
34
+import com.xhly.manageapp.network.LogService
31
 import com.xhly.manageapp.service.ManageAccessibilityService
35
 import com.xhly.manageapp.service.ManageAccessibilityService
32
 import com.xhly.manageapp.service.websocket.AppSocketService
36
 import com.xhly.manageapp.service.websocket.AppSocketService
33
 import com.xhly.manageapp.ui.login.activity.LoginActivity
37
 import com.xhly.manageapp.ui.login.activity.LoginActivity
38
+import kotlinx.coroutines.launch
34
 import java.util.Calendar
39
 import java.util.Calendar
35
 
40
 
36
 
41
 
71
     }
76
     }
72
 
77
 
73
     override fun initView() {
78
     override fun initView() {
79
+        var logService = RetrofitService.create<LogService>()
74
         mBinding.loginoutIv.setOnClickListener {
80
         mBinding.loginoutIv.setOnClickListener {
75
-            showEditDialog()
81
+           /* showEditDialog()*/
82
+            lifecycleScope.launch {
83
+                logService.postLogdoperateAdd(LogdOperateBean())
84
+            }
76
         }
85
         }
77
         mBinding.stoptv.setOnClickListener {
86
         mBinding.stoptv.setOnClickListener {
78
             spUtils.setParam(Const.DISABLEAPP, false)
87
             spUtils.setParam(Const.DISABLEAPP, false)

Loading…
Cancel
Save