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

Commit 3e99e02e authored by Alex Shabalin's avatar Alex Shabalin
Browse files

Remove background for the icon area in disabled state.

- The icon area background is needed only when the device is
 connected. The icon area background matches the seekbar
 background.
- This CL removes the unnecessary logic of updating the icon area
background color in disconnected or connecting states. For these
states the background should be simply removed.

Flag: EXEMPT refactor
Bug: 387570618
Test: atest SystemUIGoogleRoboRNGTests:MediaOutputAdapterScreenshotTest
Change-Id: I48b593b135361964eb9c54c77afad70b3ee8abe5
parent f5b4905f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@
            android:layout_height="64dp"
            android:focusable="false"
            android:importantForAccessibility="no"
            android:background="@drawable/media_output_title_icon_area"
            android:layout_gravity="center_vertical|start">
            <ImageView
                android:id="@+id/title_icon"
+0 −2
Original line number Diff line number Diff line
@@ -427,8 +427,6 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
            mTitleIcon.setImageDrawable(addDrawable);
            mTitleIcon.setImageTintList(
                    ColorStateList.valueOf(mController.getColorItemContent()));
            mIconAreaLayout.setBackgroundTintList(
                    ColorStateList.valueOf(mController.getColorItemBackground()));
            mContainerLayout.setOnClickListener(mController::launchBluetoothPairing);
        }

+2 −11
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ public abstract class MediaOutputBaseAdapter extends
            mSubTitleText.setSelected(true);
            mTwoLineTitleText.setTextColor(mController.getColorItemContent());
            mVolumeValueText.setTextColor(mController.getColorItemContent());
            mIconAreaLayout.setBackground(null);
            mSeekBar.setProgressTintList(
                    ColorStateList.valueOf(mController.getColorSeekbarProgress()));
        }
@@ -216,10 +217,6 @@ public abstract class MediaOutputBaseAdapter extends
            mItemLayout.setBackgroundTintList(
                    ColorStateList.valueOf(isActive ? mController.getColorConnectedItemBackground()
                            : mController.getColorItemBackground()));
            mIconAreaLayout.setBackgroundTintList(
                    ColorStateList.valueOf(showSeekBar ? mController.getColorSeekbarProgress()
                            : showProgressBar ? mController.getColorConnectedItemBackground()
                                    : mController.getColorItemBackground()));
            mProgressBar.setVisibility(showProgressBar ? View.VISIBLE : View.GONE);
            mSeekBar.setAlpha(1);
            mSeekBar.setVisibility(showSeekBar ? View.VISIBLE : View.GONE);
@@ -259,11 +256,6 @@ public abstract class MediaOutputBaseAdapter extends
                    showSeekBar || isFakeActive ? mController.getColorConnectedItemBackground()
                            : mController.getColorItemBackground()
            ));
            mIconAreaLayout.setBackgroundTintList(
                    ColorStateList.valueOf(showProgressBar || isFakeActive
                            ? mController.getColorConnectedItemBackground()
                            : showSeekBar ? mController.getColorSeekbarProgress()
                                    : mController.getColorItemBackground()));
            if (showSeekBar) {
                updateSeekbarProgressBackground();
            }
@@ -443,8 +435,7 @@ public abstract class MediaOutputBaseAdapter extends
            mItemLayout.setBackground(backgroundDrawable);
            mItemLayout.setBackgroundTintList(
                    ColorStateList.valueOf(mController.getColorConnectedItemBackground()));
            mIconAreaLayout.setBackgroundTintList(
                    ColorStateList.valueOf(mController.getColorConnectedItemBackground()));
            mIconAreaLayout.setBackground(null);
        }

        private void initAnimator() {