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

Commit 0265657d authored by John Spurlock's avatar John Spurlock
Browse files

Volume: Show row headers for cast streams.

Change-Id: Icbdc336ee7fd53494eab4b5c54c693504b816b29
parent 281dffb7
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
@@ -534,6 +534,7 @@ public class VolumeDialog {
                }
            }
            Util.setVisOrInvis(row.settingsButton, false);
            updateVolumeRowHeaderVisibleH(row);
            row.header.setAlpha(mExpanded && isActive ? 1 : 0.5f);
            updateVolumeRowSliderTintH(row, isActive);
        }
@@ -613,13 +614,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) {
@@ -630,8 +629,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);

@@ -667,6 +665,15 @@ public class VolumeDialog {
        updateVolumeRowSliderH(row, zenMuted);
    }

    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;