mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 11:42:22 +08:00
perf: 优化无障碍弹窗创建提示
This commit is contained in:
parent
c9bfa5aa49
commit
9934221823
|
@ -12,6 +12,7 @@ import android.view.WindowManager
|
|||
import android.view.accessibility.AccessibilityEvent
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ServiceUtils
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.statement.bodyAsText
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -302,7 +303,12 @@ class GkdAbService : CompositionAbService({
|
|||
height = 1
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
wm.addView(aliveView, lp)
|
||||
try {
|
||||
wm.addView(aliveView, lp)
|
||||
} catch (e: Exception) {
|
||||
LogUtils.d(e)
|
||||
ToastUtils.showShort("创建无障碍悬浮窗失败!")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
aliveView = null
|
||||
|
|
Loading…
Reference in New Issue
Block a user