update 获取机器人配置

This commit is contained in:
gallonyin
2023-01-09 18:44:26 +08:00
parent 1321c0387e
commit 23a5a657b0
3 changed files with 15 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ class ListenActivity : AppCompatActivity() {
initView()
initAccessibility()
initOverlays()
HttpUtil.checkUpdate()
initData()
PermissionUtils.permission("android.permission.READ_EXTERNAL_STORAGE").request()
registerReceiver(openWsReceiver, IntentFilter(Constant.WEWORK_NOTIFY))
}
@@ -74,6 +74,7 @@ class ListenActivity : AppCompatActivity() {
sendBroadcast(Intent(Constant.WEWORK_NOTIFY).apply {
putExtra("type", "modify_channel")
})
HttpUtil.getMyConfig(toast = false)
MobclickAgent.onProfileSignIn(channel)
}
tv_host.text = Constant.host
@@ -154,6 +155,11 @@ class ListenActivity : AppCompatActivity() {
}
}
private fun initData() {
HttpUtil.checkUpdate()
HttpUtil.getMyConfig(toast = false)
}
private fun showSelectHostDialog() {
val hostList = SPUtils.getInstance().getStringSet("host_list", mutableSetOf(Constant.host))
if (hostList.isNotEmpty()) {

View File

@@ -170,6 +170,10 @@ object AccessibilityUtil {
} else {
textChanged = true
LogUtils.v("未滚动到顶部 $index")
if (listener != null && listener.onScroll()) {
LogUtils.d("提前终止滚动")
return true
}
}
}
if (tryUseGesture) {

View File

@@ -63,9 +63,11 @@ object HttpUtil {
})
}
fun getMyConfig() {
fun getMyConfig(toast: Boolean = true) {
if (Constant.robotId.isBlank()) {
if (toast) {
ToastUtils.showLong("请先填写机器人ID")
}
return
}
OkGo.get<String>(Constant.getMyConfig())