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

Commit ef70f8e4 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Volume: Show row headers for cast streams." into mnc-dev

parents cc87cfa2 0265657d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -22,15 +22,15 @@

    <TextView
        android:id="@+id/volume_row_header"
        style="?android:attr/textAppearanceButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="1"
        android:textAppearance="@style/TextAppearance.Volume.Header"
        android:paddingBottom="0dp"
        android:paddingEnd="12dp"
        android:paddingStart="13dp"
        android:paddingTop="8dp" />
        android:paddingStart="12dp"
        android:paddingTop="4dp" />

    <com.android.keyguard.AlphaOptimizedImageButton
        android:id="@+id/volume_row_icon"
+5 −0
Original line number Diff line number Diff line
@@ -275,6 +275,11 @@
        <item name="android:fontFamily">sans-serif</item>
    </style>

    <style name="TextAppearance.Volume.Header">
        <item name="android:textSize">12sp</item>
        <item name="android:textColor">@color/volume_slider_inactive</item>
    </style>

    <style name="TextAppearance.Volume.ZenSummary">
        <item name="android:textSize">14sp</item>
        <item name="android:fontFamily">sans-serif-medium</item>
+24 −17
Original line number Diff line number Diff line
@@ -524,6 +524,7 @@ public class VolumeDialog {
                }
            }
            Util.setVisOrInvis(row.settingsButton, false);
            updateVolumeRowHeaderVisibleH(row);
            row.header.setAlpha(mExpanded && isActive ? 1 : 0.5f);
            updateVolumeRowSliderTintH(row, isActive);
        }
@@ -606,13 +607,11 @@ public class VolumeDialog {
        }

        // update header visible
        if (row.cachedShowHeaders != mShowHeaders) {
            row.cachedShowHeaders = mShowHeaders;
            Util.setVisOrGone(row.header, mShowHeaders);
        }
        updateVolumeRowHeaderVisibleH(row);

        // update header text
        final String text;
        String text = ss.name;
        if (mShowHeaders) {
            if (isRingZenNone) {
                text = mContext.getString(R.string.volume_stream_muted_dnd, ss.name);
            } else if (isRingVibrate && isRingLimited) {
@@ -623,8 +622,7 @@ public class VolumeDialog {
                text = mContext.getString(R.string.volume_stream_muted, ss.name);
            } else if (isRingLimited) {
                text = mContext.getString(R.string.volume_stream_limited_dnd, ss.name);
        } else {
            text = ss.name;
            }
        }
        Util.setText(row.header, text);

@@ -663,6 +661,15 @@ public class VolumeDialog {
        updateVolumeRowSliderH(row, enableSlider, vlevel);
    }

    private void updateVolumeRowHeaderVisibleH(VolumeRow row) {
        final boolean dynamic = row.ss != null && row.ss.dynamic;
        final boolean showHeaders = mShowHeaders || mExpanded && dynamic;
        if (row.cachedShowHeaders != showHeaders) {
            row.cachedShowHeaders = showHeaders;
            Util.setVisOrGone(row.header, showHeaders);
        }
    }

    private void updateVolumeRowSliderTintH(VolumeRow row, boolean isActive) {
        final ColorStateList tint = isActive && row.slider.isEnabled() ? mActiveSliderTint
                : mInactiveSliderTint;