Merge "Importance slider updates." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2bf73e94c3
@@ -20,8 +20,8 @@
|
|||||||
android:viewportHeight="24.0">
|
android:viewportHeight="24.0">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FFFFFFFF"
|
android:fillColor="#FFFFFFFF"
|
||||||
android:pathData="M11.2,13.6l1.6,0l-0.8,-2.6z"/>
|
android:pathData="M10.8,12.7l2.4,0l-1.2,-3.7z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="#FF000000"
|
||||||
android:pathData="M22.5,9.6L15,9l-3,-7L9,9L1.5,9.6l5.7,5L5.5,22l6.5,-3.9l6.5,3.9l-1.7,-7.4L22.5,9.6zM13.6,16l-0.5,-1.4h-2.3L10.4,16H9l2.3,-6.4h1.4L15,16H13.6z"/>
|
android:pathData="M12,2C6.5,2 2,6.5 2,12s4.5,10 10,10s10,-4.5 10,-10S17.5,2 12,2zM14.3,16l-0.7,-2h-3.2l-0.7,2H7.8L11,7h2l3.2,9H14.3z"/>
|
||||||
</vector>
|
</vector>
|
||||||
@@ -23,6 +23,7 @@ import android.content.Context;
|
|||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -70,6 +71,8 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab
|
|||||||
private ImageView mAutoButton;
|
private ImageView mAutoButton;
|
||||||
private ColorStateList mActiveSliderTint;
|
private ColorStateList mActiveSliderTint;
|
||||||
private ColorStateList mInactiveSliderTint;
|
private ColorStateList mInactiveSliderTint;
|
||||||
|
private float mActiveSliderAlpha = 1.0f;
|
||||||
|
private float mInactiveSliderAlpha;
|
||||||
private TextView mImportanceSummary;
|
private TextView mImportanceSummary;
|
||||||
private TextView mImportanceTitle;
|
private TextView mImportanceTitle;
|
||||||
private boolean mAuto;
|
private boolean mAuto;
|
||||||
@@ -100,6 +103,11 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
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 void resetFalsingCheck() {
|
public void resetFalsingCheck() {
|
||||||
@@ -299,13 +307,12 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab
|
|||||||
private void applyAuto() {
|
private void applyAuto() {
|
||||||
mSeekBar.setEnabled(!mAuto);
|
mSeekBar.setEnabled(!mAuto);
|
||||||
|
|
||||||
final ColorStateList sliderTint = mAuto ? mInactiveSliderTint : mActiveSliderTint;
|
|
||||||
final ColorStateList starTint = mAuto ? mActiveSliderTint : mInactiveSliderTint;
|
final ColorStateList starTint = mAuto ? mActiveSliderTint : mInactiveSliderTint;
|
||||||
|
final float alpha = mAuto ? mInactiveSliderAlpha : mActiveSliderAlpha;
|
||||||
Drawable icon = mAutoButton.getDrawable().mutate();
|
Drawable icon = mAutoButton.getDrawable().mutate();
|
||||||
icon.setTintList(starTint);
|
icon.setTintList(starTint);
|
||||||
mAutoButton.setImageDrawable(icon);
|
mAutoButton.setImageDrawable(icon);
|
||||||
mSeekBar.setProgressTintList(sliderTint);
|
mSeekBar.setAlpha(alpha);
|
||||||
mSeekBar.setThumbTintList(sliderTint);
|
|
||||||
|
|
||||||
if (mAuto) {
|
if (mAuto) {
|
||||||
mSeekBar.setProgress(mNotificationImportance);
|
mSeekBar.setProgress(mNotificationImportance);
|
||||||
|
|||||||
Reference in New Issue
Block a user