OSDN Git Service

Revert "Importance slider updates."
authorBart Sears <bsears@google.com>
Fri, 27 May 2016 01:58:26 +0000 (01:58 +0000)
committerBart Sears <bsears@google.com>
Fri, 27 May 2016 02:04:03 +0000 (02:04 +0000)
This reverts commit 373a9e2fcfedda0dbf736d2e3f95edaf38833756.

Change-Id: I3279163eb052f93cf6b87710c17cfa0c2eae56ba

res/layout/preference_importance_slider.xml
src/com/android/settings/notification/ImportanceSeekBarPreference.java

index ddbcd30..dc7c9db 100644 (file)
@@ -58,8 +58,8 @@
                 android:focusable="true"
                 android:background="#00ffffff"
                 android:progressBackgroundTint="@color/importance_secondary_slider_color"
-                android:thumbTint="@color/importance_slider_color"
-                android:progressTint="@color/importance_slider_color"
+                android:thumbTint="@color/importance_disabled_slider_color"
+                android:progressTint="@color/importance_disabled_slider_color"
                 style="@android:style/Widget.Material.SeekBar.Discrete"
                 android:tickMarkTint="@android:color/black" />
 
index 90a3a50..fe97448 100644 (file)
@@ -23,7 +23,6 @@ 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;
@@ -48,8 +47,6 @@ 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;
 
@@ -64,11 +61,6 @@ 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) {
@@ -136,12 +128,13 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements
     private void applyAutoUi(ImageView autoButton) {
         mSeekBar.setEnabled(!mAutoOn);
 
-        final float alpha = mAutoOn ? mInactiveSliderAlpha : mActiveSliderAlpha;
+        final ColorStateList sliderTint = mAutoOn ? mInactiveSliderTint : mActiveSliderTint;
         final ColorStateList starTint = mAutoOn ?  mActiveSliderTint : mInactiveSliderTint;
         Drawable icon = autoButton.getDrawable().mutate();
         icon.setTintList(starTint);
         autoButton.setImageDrawable(icon);
-        mSeekBar.setAlpha(alpha);
+        mSeekBar.setProgressTintList(sliderTint);
+        mSeekBar.setThumbTintList(sliderTint);
 
         if (mAutoOn) {
             setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT);