Krosxx / Android-Auto-Api

安卓无障碍服务Api, 为了简化无障碍服务使用,并使用 Kotlin 以提供简洁的Api。
Apache License 2.0
495 stars 83 forks source link

获取列表(RecyclerView)的child会使用缓存 该如何解决 #32

Closed LxzBUG closed 1 year ago

LxzBUG commented 1 year ago

chatLayout.node.refresh()

还是

chatLayout.node.clearChildrenCache啊

Krosxx commented 1 year ago

ViewNode.refresh()

LxzBUG commented 1 year ago

谢谢

LxzBUG commented 1 year ago

val chatLayout = SF.id("chat_message_list") chatLayout.node?.refresh

node是null😳

然后我再发几条信息 chatLayout.refresh后 chatLayout的child还是1 没变😳😳😳

Krosxx commented 1 year ago

SF.id("chat_message_list").requireFirst().refresh()

LxzBUG commented 1 year ago

SF.id("chat_message_input").findFirst()

为什么有时候 明明在当前页面 有这个view 就是找不到呢

        lifecycleScope.launch {
            delay(onceDelay)
            SF.id("chat_message_input").findFirst()?.let { chat_message_input->
                chat_message_input.text = getHiContent()
                delay(onceDelay)
                Log("发送打招呼信息")
                SF.id("send_btn").findFirst()?.let { btnSend->
                    btnSend.tryClick()
                    delay(onceDelay)
                    Log("发送成功,返回首页")
                    backHome()
                }
            }?:let {
                startJob()
            }
        }
    }