Commit 0a22420e authored by liuyang's avatar liuyang

增加程序前台判断逻辑,修复启动问题

parent 0dbc9c45
...@@ -71,6 +71,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback { ...@@ -71,6 +71,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
requestAppList() requestAppList()
refreshBtn.isEnabled = true
refreshBtn.setOnClickListener{ refreshBtn.setOnClickListener{
this.appInfoAdapter.clear() this.appInfoAdapter.clear()
requestAppList() requestAppList()
...@@ -86,6 +87,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback { ...@@ -86,6 +87,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
startBtn.postDelayed({ startBtn.postDelayed({
startBtn.isEnabled = true startBtn.isEnabled = true
startBtn.text = "启动" startBtn.text = "启动"
refreshBtn.isEnabled = true
}, 3000) }, 3000)
} }
else { else {
...@@ -94,7 +96,8 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback { ...@@ -94,7 +96,8 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
startBtn.postDelayed({ startBtn.postDelayed({
startBtn.isEnabled = true startBtn.isEnabled = true
startBtn.text = "停止" startBtn.text = "停止"
}, 3000) refreshBtn.isEnabled = false
}, 2000)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment