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

Commit 5677ac66 authored by Alex Shabalin's avatar Alex Shabalin Committed by Alexandr Shabalin
Browse files

Add a contrast dot to the slider end.

Additionally, fix the scaling of the end area icon.

Flag: EXEMPT bugfix
Bug: 379967988
Fix: 379967988
Test: atest
    SystemUIGoogleScreenshotTests:MediaOutputAdapterScreenshotTest,
    On a physical device.
Change-Id: I9ad1d923678cbba2e94ee62e03f333d9a41a771d
parent db072d38
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -23,16 +23,24 @@
            />
            <solid android:color="@android:color/transparent" />
            <size
                android:height="64dp"/>
                android:height="@dimen/media_output_dialog_item_height"/>
        </shape>
    </item>
    <item android:id="@+id/contrast_dot" android:right="8dp" android:gravity="center_vertical|end">
        <shape android:shape="oval">
            <solid android:color="@color/media_dialog_seekbar_progress" />
            <size
                android:width="4dp"
                android:height="4dp" />
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners
                    android:radius="16dp"/>
                    android:radius="@dimen/media_output_dialog_background_radius"/>
                <size
                    android:height="64dp"/>
                    android:height="@dimen/media_output_dialog_item_height"/>
                <solid android:color="@color/material_dynamic_primary80" />
            </shape>
        </clip>
+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@
        <ImageButton
            android:id="@+id/end_area_image_button"
            android:background="@android:color/transparent"
            android:padding="20dp"
            android:scaleType="fitCenter"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:contentDescription="@null"
+11 −2
Original line number Diff line number Diff line
@@ -186,8 +186,7 @@ public class MediaOutputAdapterLegacy extends MediaOutputAdapterBase {
            mVolumeValueText.setTextColor(mController.getColorItemContent());
            mIconAreaLayout.setBackground(null);
            updateIconAreaClickListener(null);
            mSeekBar.setProgressTintList(
                    ColorStateList.valueOf(mController.getColorSeekbarProgress()));
            updateSeekBarProgressColor();
            updateContainerContentA11yImportance(true  /* isImportant */);
            renderItem(mediaItem, position);
        }
@@ -332,6 +331,16 @@ public class MediaOutputAdapterLegacy extends MediaOutputAdapterBase {
            }
        }

        private void updateSeekBarProgressColor() {
            mSeekBar.setProgressTintList(
                    ColorStateList.valueOf(mController.getColorSeekbarProgress()));
            final Drawable contrastDotDrawable =
                    ((LayerDrawable) mSeekBar.getProgressDrawable()).findDrawableByLayerId(
                            R.id.contrast_dot);
            contrastDotDrawable.setTintList(
                    ColorStateList.valueOf(mController.getColorItemContent()));
        }

        void updateSeekbarProgressBackground() {
            final ClipDrawable clipDrawable =
                    (ClipDrawable) ((LayerDrawable) mSeekBar.getProgressDrawable())