Merge "Put all text content in the node's text" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5d0e1903b6
@@ -385,6 +385,11 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
super.onInitializeAccessibilityNodeInfo(info)
|
super.onInitializeAccessibilityNodeInfo(info)
|
||||||
// Clear selected state so it is not announce by talkback.
|
// Clear selected state so it is not announce by talkback.
|
||||||
info.isSelected = false
|
info.isSelected = false
|
||||||
|
info.text = if (TextUtils.isEmpty(secondaryLabel.text)) {
|
||||||
|
"${label.text}"
|
||||||
|
} else {
|
||||||
|
"${label.text}, ${secondaryLabel.text}"
|
||||||
|
}
|
||||||
if (lastDisabledByPolicy) {
|
if (lastDisabledByPolicy) {
|
||||||
info.addAction(
|
info.addAction(
|
||||||
AccessibilityNodeInfo.AccessibilityAction(
|
AccessibilityNodeInfo.AccessibilityAction(
|
||||||
@@ -402,12 +407,6 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
accessibilityClass
|
accessibilityClass
|
||||||
}
|
}
|
||||||
if (Switch::class.java.name == accessibilityClass) {
|
if (Switch::class.java.name == accessibilityClass) {
|
||||||
val label = resources.getString(
|
|
||||||
if (tileState) R.string.switch_bar_on else R.string.switch_bar_off)
|
|
||||||
// Set the text here for tests in
|
|
||||||
// android.platform.test.scenario.sysui.quicksettings. Can be removed when
|
|
||||||
// UiObject2 has a new getStateDescription() API and tests are updated.
|
|
||||||
info.text = label
|
|
||||||
info.isChecked = tileState
|
info.isChecked = tileState
|
||||||
info.isCheckable = true
|
info.isCheckable = true
|
||||||
if (isLongClickable) {
|
if (isLongClickable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user