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

Commit 23a86a91 authored by John Spurlock's avatar John Spurlock Committed by Android Git Automerger
Browse files

am 77cbbd17: am 62c3bbc4: am 13ea79de: Merge "Volume: Separate tint colors for...

am 77cbbd17: am 62c3bbc4: am 13ea79de: Merge "Volume: Separate tint colors for active vs inactive sliders." into mnc-dev

* commit '77cbbd17':
  Volume: Separate tint colors for active vs inactive sliders.
parents 47a74937 77cbbd17
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -50,9 +50,7 @@
        android:layout_toEndOf="@id/volume_row_icon"
        android:layout_toStartOf="@+id/volume_settings_button"
        android:paddingEnd="8dp"
        android:paddingStart="8dp"
        android:progressTint="@android:color/white"
        android:thumbTint="@android:color/white" />
        android:paddingStart="8dp" />

    <com.android.keyguard.AlphaOptimizedImageButton
        android:id="@+id/volume_settings_button"
+1 −0
Original line number Diff line number Diff line
@@ -142,4 +142,5 @@
    <color name="zen_introduction_message_background">#ff009688</color><!-- deep teal 500 -->
    <color name="volume_icon_color">#ffffffff</color>
    <color name="volume_settings_icon_color">#7fffffff</color>
    <color name="volume_slider_inactive">#FFB0BEC5</color><!-- blue grey 200 -->
</resources>
+11 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PixelFormat;
@@ -107,6 +108,8 @@ public class VolumeDialog {
    private final LayoutTransition mLayoutTransition;
    private final Object mSafetyWarningLock = new Object();
    private final Accessibility mAccessibility = new Accessibility();
    private final ColorStateList mActiveSliderTint;
    private final ColorStateList mInactiveSliderTint;

    private boolean mShowing;
    private boolean mExpanded;
@@ -152,6 +155,8 @@ public class VolumeDialog {
        lp.gravity = Gravity.TOP;
        window.setAttributes(lp);

        mActiveSliderTint = loadColorStateList(R.color.system_accent_color);
        mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
        mDialog.setContentView(R.layout.volume_dialog);
        mDialogView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog);
        mDialogContentView = (ViewGroup) mDialog.findViewById(R.id.volume_dialog_content);
@@ -190,6 +195,10 @@ public class VolumeDialog {
        controller.getState();
    }

    private ColorStateList loadColorStateList(int colorResId) {
        return ColorStateList.valueOf(mContext.getColor(colorResId));
    }

    private void updateWindowWidthH() {
        final ViewGroup.LayoutParams lp = mDialogView.getLayoutParams();
        final DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
@@ -524,6 +533,8 @@ public class VolumeDialog {
            }
            Util.setVisOrInvis(row.settingsButton, false);
            row.header.setAlpha(mExpanded && isActive ? 1 : 0.5f);
            row.slider.setProgressTintList(isActive ? mActiveSliderTint : mInactiveSliderTint);
            row.slider.setThumbTintList(isActive ? mActiveSliderTint : mInactiveSliderTint);
        }
    }