Loading res/layout/preference_importance_slider.xml +2 −2 Original line number Diff line number Diff line Loading @@ -58,8 +58,8 @@ android:focusable="true" android:background="#00ffffff" android:progressBackgroundTint="@color/importance_secondary_slider_color" android:thumbTint="@color/importance_disabled_slider_color" android:progressTint="@color/importance_disabled_slider_color" android:thumbTint="@color/importance_slider_color" android:progressTint="@color/importance_slider_color" style="@android:style/Widget.Material.SeekBar.Discrete" android:tickMarkTint="@android:color/black" /> Loading src/com/android/settings/notification/ImportanceSeekBarPreference.java +10 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.settings.SeekBarPreference; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Handler; import android.service.notification.NotificationListenerService; Loading @@ -45,6 +46,8 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private SeekBar mSeekBar; private ColorStateList mActiveSliderTint; private ColorStateList mInactiveSliderTint; private float mActiveSliderAlpha = 1.0f; private float mInactiveSliderAlpha; private boolean mAutoOn; private Handler mHandler; Loading @@ -57,6 +60,11 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements mInactiveSliderTint = ColorStateList.valueOf( context.getColor(R.color.importance_disabled_slider_color)); mHandler = new Handler(); final TypedArray ta = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.Theme, 0, 0); mInactiveSliderAlpha = ta.getFloat(com.android.internal.R.styleable.Theme_disabledAlpha, 0.5f); ta.recycle(); } public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) { Loading Loading @@ -124,13 +132,12 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private void applyAutoUi(ImageView autoButton) { mSeekBar.setEnabled(!mAutoOn); final ColorStateList sliderTint = mAutoOn ? mInactiveSliderTint : mActiveSliderTint; final float alpha = mAutoOn ? mInactiveSliderAlpha : mActiveSliderAlpha; final ColorStateList starTint = mAutoOn ? mActiveSliderTint : mInactiveSliderTint; Drawable icon = autoButton.getDrawable().mutate(); icon.setTintList(starTint); autoButton.setImageDrawable(icon); mSeekBar.setProgressTintList(sliderTint); mSeekBar.setThumbTintList(sliderTint); mSeekBar.setAlpha(alpha); if (mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); Loading Loading
res/layout/preference_importance_slider.xml +2 −2 Original line number Diff line number Diff line Loading @@ -58,8 +58,8 @@ android:focusable="true" android:background="#00ffffff" android:progressBackgroundTint="@color/importance_secondary_slider_color" android:thumbTint="@color/importance_disabled_slider_color" android:progressTint="@color/importance_disabled_slider_color" android:thumbTint="@color/importance_slider_color" android:progressTint="@color/importance_slider_color" style="@android:style/Widget.Material.SeekBar.Discrete" android:tickMarkTint="@android:color/black" /> Loading
src/com/android/settings/notification/ImportanceSeekBarPreference.java +10 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.settings.SeekBarPreference; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Handler; import android.service.notification.NotificationListenerService; Loading @@ -45,6 +46,8 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private SeekBar mSeekBar; private ColorStateList mActiveSliderTint; private ColorStateList mInactiveSliderTint; private float mActiveSliderAlpha = 1.0f; private float mInactiveSliderAlpha; private boolean mAutoOn; private Handler mHandler; Loading @@ -57,6 +60,11 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements mInactiveSliderTint = ColorStateList.valueOf( context.getColor(R.color.importance_disabled_slider_color)); mHandler = new Handler(); final TypedArray ta = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.Theme, 0, 0); mInactiveSliderAlpha = ta.getFloat(com.android.internal.R.styleable.Theme_disabledAlpha, 0.5f); ta.recycle(); } public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) { Loading Loading @@ -124,13 +132,12 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private void applyAutoUi(ImageView autoButton) { mSeekBar.setEnabled(!mAutoOn); final ColorStateList sliderTint = mAutoOn ? mInactiveSliderTint : mActiveSliderTint; final float alpha = mAutoOn ? mInactiveSliderAlpha : mActiveSliderAlpha; final ColorStateList starTint = mAutoOn ? mActiveSliderTint : mInactiveSliderTint; Drawable icon = autoButton.getDrawable().mutate(); icon.setTintList(starTint); autoButton.setImageDrawable(icon); mSeekBar.setProgressTintList(sliderTint); mSeekBar.setThumbTintList(sliderTint); mSeekBar.setAlpha(alpha); if (mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); Loading