ソースを参照

1.添加测试的网络请求

master
wangwanlei 10ヶ月前
コミット
030599caea
1個のファイルの変更10行の追加1行の削除
  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 ファイルの表示

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

読み込み中…
キャンセル
保存