Aggregation checkbox and locale text

Refer to other settings with the checkbox to read the checkbox and corresponding text together, such as "Erase SIMs" or "Show password" in WiFi settings.

Bug: 288223637
Bug: 317927064
Test: Perform some accessibility test like TalkBack and Select to Speak
Change-Id: I571fe3f2f8d7b6b4f4c7b5804d0217a2a2b97757
This commit is contained in:
Josh Hou
2024-03-26 02:42:38 +00:00
parent 42be6f6e88
commit 3c38a12347
2 changed files with 11 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
@@ -189,6 +190,13 @@ class LocaleDragAndDropAdapter
setCheckBoxDescription(dragCell, checkbox, isChecked);
}
});
dragCell.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
checkbox.toggle();
}
});
}
@VisibleForTesting
@@ -200,8 +208,6 @@ class LocaleDragAndDropAdapter
CharSequence checkedStatus = mContext.getText(
isChecked ? com.android.internal.R.string.checked
: com.android.internal.R.string.not_checked);
// Talkback
dragCell.setStateDescription(checkedStatus);
// Select to Speak
checkbox.setContentDescription(checkedStatus);
}