Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a61c6df authored by shaoweishen's avatar shaoweishen Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: Downbranch merge conflict [Output Switcher] [A11y] Set property...

DO NOT MERGE: Downbranch merge conflict [Output Switcher] [A11y] Set property for endTouchArea am: be6b577f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17951963



Change-Id: Id0a020dd741370629d05840bff30692869656673
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 76d6b5bb be6b577f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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"
+10 −5
Original line number Diff line number Diff line
@@ -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