Added contentDescriptions for the keys and a new string resource

This commit is contained in:
merkost
2023-06-07 14:04:05 +10:00
parent 9901cfbc10
commit 52836b8e5f
4 changed files with 39 additions and 2 deletions

View File

@ -147,7 +147,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
override fun onPopulateNodeForVirtualView(virtualViewId: Int, node: AccessibilityNodeInfoCompat) {
node.className = MyKeyboardView::class.simpleName
val key = mKeyboard?.mKeys?.get(virtualViewId)
node.contentDescription = key?.label ?: "keyboard key"
node.contentDescription = key?.getContentDescription(context)
val bounds = updateBoundsForInterval(virtualViewId)
node.setBoundsInParent(bounds)
}