DO NOT MERGE: Downbranch merge conflict [Output Switcher] [A11y] Set property for endTouchArea
update property for endTouchArea to make it selectable when talkback on. Bug: 221162268 Test: verify on device Change-Id: I063cb828694a5654374b296089c8aed384c9a2fc
This commit is contained in:
committed by
Shaowei Shen
parent
48d602a8a6
commit
be6b577f27
@@ -129,6 +129,8 @@
|
||||
android:gravity="center_vertical">
|
||||
<CheckBox
|
||||
android:id="@+id/check_box"
|
||||
android:focusable="false"
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
|
||||
@@ -118,6 +118,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
mCheckBox.setVisibility(View.GONE);
|
||||
mStatusIcon.setVisibility(View.GONE);
|
||||
mEndTouchArea.setVisibility(View.GONE);
|
||||
mEndTouchArea.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||
mContainerLayout.setOnClickListener(null);
|
||||
mContainerLayout.setContentDescription(null);
|
||||
mTitleText.setTextColor(mController.getColorItemContent());
|
||||
@@ -170,7 +171,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
setSingleLineLayout(getItemTitle(device), true /* bFocused */,
|
||||
true /* showSeekBar */,
|
||||
false /* showProgressBar */, false /* showStatus */);
|
||||
setUpContentDescriptionForActiveDevice(device);
|
||||
setUpContentDescriptionForView(mContainerLayout, false, device);
|
||||
mCheckBox.setOnCheckedChangeListener(null);
|
||||
mCheckBox.setVisibility(View.VISIBLE);
|
||||
mCheckBox.setChecked(true);
|
||||
@@ -181,6 +182,9 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
mEndTouchArea.setVisibility(View.VISIBLE);
|
||||
mEndTouchArea.setOnClickListener(null);
|
||||
mEndTouchArea.setOnClickListener((v) -> mCheckBox.performClick());
|
||||
mEndTouchArea.setImportantForAccessibility(
|
||||
View.IMPORTANT_FOR_ACCESSIBILITY_YES);
|
||||
setUpContentDescriptionForView(mEndTouchArea, true, device);
|
||||
} else if (!mController.hasAdjustVolumeUserRestriction() && currentlyConnected) {
|
||||
mStatusIcon.setImageDrawable(
|
||||
mContext.getDrawable(R.drawable.media_output_status_check));
|
||||
@@ -190,7 +194,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
true /* showSeekBar */,
|
||||
false /* showProgressBar */, true /* showStatus */);
|
||||
initSeekbar(device);
|
||||
setUpContentDescriptionForActiveDevice(device);
|
||||
setUpContentDescriptionForView(mContainerLayout, false, device);
|
||||
mCurrentActivePosition = position;
|
||||
} else if (isDeviceIncluded(mController.getSelectableMediaDevice(), device)) {
|
||||
mCheckBox.setOnCheckedChangeListener(null);
|
||||
@@ -258,9 +262,10 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private void setUpContentDescriptionForActiveDevice(MediaDevice device) {
|
||||
mContainerLayout.setClickable(false);
|
||||
mContainerLayout.setContentDescription(
|
||||
private void setUpContentDescriptionForView(View view, boolean clickable,
|
||||
MediaDevice device) {
|
||||
view.setClickable(clickable);
|
||||
view.setContentDescription(
|
||||
mContext.getString(device.getDeviceType()
|
||||
== MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE
|
||||
? R.string.accessibility_bluetooth_name
|
||||
|
||||
Reference in New Issue
Block a user