diff --git a/app/src/main/kotlin/li/songe/gkd/service/AbExt.kt b/app/src/main/kotlin/li/songe/gkd/service/AbExt.kt index 80c67b1..381f150 100644 --- a/app/src/main/kotlin/li/songe/gkd/service/AbExt.kt +++ b/app/src/main/kotlin/li/songe/gkd/service/AbExt.kt @@ -255,12 +255,28 @@ fun createCacheTransform(): CacheTransform { } } } + var vidCacheNode: AccessibilityNodeInfo? = null + var vidCacheValue: CharSequence? = null val transform = Transform( getAttr = { node, name -> - if (name == "index") { - node.getIndexX() - } else { - getAttr(node, name) + when (name) { + "vid" -> { + if (node === vidCacheNode) { + vidCacheValue + } else { + vidCacheNode = node + vidCacheValue = node.getVid() + vidCacheValue + } + } + + "index" -> { + node.getIndexX() + } + + else -> { + getAttr(node, name) + } } }, getName = { node -> node.className },