diff options
82 files changed, 248 insertions, 68 deletions
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index ff74c60..a4c8d1c 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -86,10 +86,10 @@ public abstract class AbsSeekBar extends ProgressBar { public AbsSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - TypedArray a = context.obtainStyledAttributes( - attrs, com.android.internal.R.styleable.SeekBar, defStyleAttr, defStyleRes); + final TypedArray a = context.obtainStyledAttributes( + attrs, R.styleable.SeekBar, defStyleAttr, defStyleRes); - final Drawable thumb = a.getDrawable(com.android.internal.R.styleable.SeekBar_thumb); + final Drawable thumb = a.getDrawable(R.styleable.SeekBar_thumb); setThumb(thumb); if (a.hasValue(R.styleable.SeekBar_thumbTintMode)) { @@ -103,18 +103,22 @@ public abstract class AbsSeekBar extends ProgressBar { mHasThumbTint = true; } + mSplitTrack = a.getBoolean(R.styleable.SeekBar_splitTrack, false); + // Guess thumb offset if thumb != null, but allow layout to override. - final int thumbOffset = a.getDimensionPixelOffset( - com.android.internal.R.styleable.SeekBar_thumbOffset, getThumbOffset()); + final int thumbOffset = a.getDimensionPixelOffset(R.styleable.SeekBar_thumbOffset, getThumbOffset()); setThumbOffset(thumbOffset); - mSplitTrack = a.getBoolean(com.android.internal.R.styleable.SeekBar_splitTrack, false); + final boolean useDisabledAlpha = a.getBoolean(R.styleable.SeekBar_useDisabledAlpha, true); a.recycle(); - a = context.obtainStyledAttributes(attrs, - com.android.internal.R.styleable.Theme, 0, 0); - mDisabledAlpha = a.getFloat(com.android.internal.R.styleable.Theme_disabledAlpha, 0.5f); - a.recycle(); + if (useDisabledAlpha) { + final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.Theme, 0, 0); + mDisabledAlpha = ta.getFloat(R.styleable.Theme_disabledAlpha, 0.5f); + ta.recycle(); + } else { + mDisabledAlpha = 1.0f; + } applyThumbTint(); @@ -360,7 +364,7 @@ public abstract class AbsSeekBar extends ProgressBar { super.drawableStateChanged(); final Drawable progressDrawable = getProgressDrawable(); - if (progressDrawable != null) { + if (progressDrawable != null && mDisabledAlpha < 1.0f) { progressDrawable.setAlpha(isEnabled() ? NO_ALPHA : (int) (NO_ALPHA * mDisabledAlpha)); } diff --git a/core/res/res/anim/seekbar_thumb_pressed_to_unpressed_thumb_animation.xml b/core/res/res/anim/seekbar_thumb_pressed_to_unpressed_thumb_animation.xml new file mode 100644 index 0000000..081b552 --- /dev/null +++ b/core/res/res/anim/seekbar_thumb_pressed_to_unpressed_thumb_animation.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + <objectAnimator + android:duration="133" + android:propertyName="scaleX" + android:valueFrom="1.5" + android:valueTo="1.0" + android:valueType="floatType" + android:interpolator="@android:interpolator/fast_out_slow_in" /> + <objectAnimator + android:duration="133" + android:propertyName="scaleY" + android:valueFrom="1.5" + android:valueTo="1.0" + android:valueType="floatType" + android:interpolator="@android:interpolator/fast_out_slow_in" /> +</set> diff --git a/core/res/res/anim/seekbar_thumb_unpressed_to_pressed_thumb_0_animation.xml b/core/res/res/anim/seekbar_thumb_unpressed_to_pressed_thumb_0_animation.xml new file mode 100644 index 0000000..41e5a44 --- /dev/null +++ b/core/res/res/anim/seekbar_thumb_unpressed_to_pressed_thumb_0_animation.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<set + xmlns:android="http://schemas.android.com/apk/res/android" > + <objectAnimator + android:duration="533" + android:propertyName="scaleX" + android:valueFrom="1.0" + android:valueTo="1.5" + android:valueType="floatType" + android:interpolator="@android:interpolator/fast_out_slow_in" /> + <objectAnimator + android:duration="533" + android:propertyName="scaleY" + android:valueFrom="1.0" + android:valueTo="1.5" + android:valueType="floatType" + android:interpolator="@android:interpolator/fast_out_slow_in" /> +</set> diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_000.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 281923e..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_001.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index e91d4fb..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_002.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 15baded..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_003.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 3d5899f..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_004.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index e2277bd..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_005.png b/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index b502e22..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_from_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_off_mtrl_alpha.png b/core/res/res/drawable-hdpi/scrubber_control_off_mtrl_alpha.png Binary files differdeleted file mode 100644 index 5a99528..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_off_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_off_pressed_mtrl_alpha.png b/core/res/res/drawable-hdpi/scrubber_control_off_pressed_mtrl_alpha.png Binary files differdeleted file mode 100644 index 10ce2bc..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_off_pressed_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_000.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index a70be2c..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_001.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index 9442316..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_002.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 33db4a88..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_003.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 4e1cd16..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_004.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index d5254f4..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_005.png b/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 7aa0a3e..0000000 --- a/core/res/res/drawable-hdpi/scrubber_control_to_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_000.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 377a6b4..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_001.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index 0859f62..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_002.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index bf5cdcd..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_003.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 4cd177d..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_004.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index dfe39ca..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_005.png b/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 5d3ab99..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_from_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_off_mtrl_alpha.png b/core/res/res/drawable-mdpi/scrubber_control_off_mtrl_alpha.png Binary files differdeleted file mode 100644 index e40cba8..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_off_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_off_pressed_mtrl_alpha.png b/core/res/res/drawable-mdpi/scrubber_control_off_pressed_mtrl_alpha.png Binary files differdeleted file mode 100644 index 1f4b46a..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_off_pressed_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_000.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 80922eb..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_001.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index aa77044..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_002.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 7b099db..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_003.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 088c86a..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_004.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index 3c6b9bc..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_005.png b/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index adf5100..0000000 --- a/core/res/res/drawable-mdpi/scrubber_control_to_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_000.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index ea09a31..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_001.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index f9a4391..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_002.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index d9606e1..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_003.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index df2d9d0..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_004.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index 625a322..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_005.png b/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 79e8dde..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_from_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_off_mtrl_alpha.png b/core/res/res/drawable-xhdpi/scrubber_control_off_mtrl_alpha.png Binary files differdeleted file mode 100644 index 729e0bf..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_off_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_off_pressed_mtrl_alpha.png b/core/res/res/drawable-xhdpi/scrubber_control_off_pressed_mtrl_alpha.png Binary files differdeleted file mode 100644 index 754b321..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_off_pressed_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_000.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index e99c266..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_001.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index f0329a4..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_002.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 42c40b7..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_003.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 807491f..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_004.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index dfec9cc..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_005.png b/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 0ed59ea..0000000 --- a/core/res/res/drawable-xhdpi/scrubber_control_to_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_000.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 46aa533..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_001.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index a749469..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_002.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index ef43f00..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_003.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index eebddc3..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_004.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index 44b654d..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_005.png b/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 6e768c1..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_from_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_off_mtrl_alpha.png b/core/res/res/drawable-xxhdpi/scrubber_control_off_mtrl_alpha.png Binary files differdeleted file mode 100644 index a2b5716..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_off_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_off_pressed_mtrl_alpha.png b/core/res/res/drawable-xxhdpi/scrubber_control_off_pressed_mtrl_alpha.png Binary files differdeleted file mode 100644 index 0319bd8..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_off_pressed_mtrl_alpha.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_000.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 2ac6dae..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_001.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index 91c49ce..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_002.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 4b4bd1f..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_003.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 637e596..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_004.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index 42d4d2a..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_005.png b/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 995d1b2..0000000 --- a/core/res/res/drawable-xxhdpi/scrubber_control_to_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_000.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index 0c8f746..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_001.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index 5db9deb..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_002.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 3aca6d3..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_003.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 746c74f..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_004.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index 454a5b2..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_005.png b/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 80ad8cc..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_from_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_000.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_000.png Binary files differdeleted file mode 100644 index cfd0db4..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_000.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_001.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_001.png Binary files differdeleted file mode 100644 index 845092f..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_001.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_002.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_002.png Binary files differdeleted file mode 100644 index 0042db4..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_002.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_003.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_003.png Binary files differdeleted file mode 100644 index 77b2901..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_003.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_004.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_004.png Binary files differdeleted file mode 100644 index fb3c238..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_004.png +++ /dev/null diff --git a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_005.png b/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_005.png Binary files differdeleted file mode 100644 index 0d28c45..0000000 --- a/core/res/res/drawable-xxxhdpi/scrubber_control_to_pressed_mtrl_005.png +++ /dev/null diff --git a/core/res/res/drawable/seekbar_thumb_material_anim.xml b/core/res/res/drawable/seekbar_thumb_material_anim.xml index 4b13259..9726e73 100644 --- a/core/res/res/drawable/seekbar_thumb_material_anim.xml +++ b/core/res/res/drawable/seekbar_thumb_material_anim.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 The Android Open Source Project +<!-- Copyright (C) 2015 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,61 +14,36 @@ limitations under the License. --> -<animated-selector xmlns:android="http://schemas.android.com/apk/res/android" android:constantSize="true"> - <item android:state_enabled="false" android:state_pressed="true"> - <bitmap android:src="@drawable/scrubber_control_off_mtrl_alpha" android:gravity="center" android:tint="?attr/colorControlActivated" android:alpha="?attr/disabledAlpha" /> - </item> +<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false"> - <bitmap android:src="@drawable/scrubber_control_off_mtrl_alpha" android:gravity="center" android:tint="?attr/colorControlNormal" android:alpha="?attr/disabledAlpha" /> - </item> - <item android:state_pressed="true" android:id="@+id/pressed"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_005" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:id="@+id/not_pressed"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_000" android:gravity="center" android:tint="?attr/colorControlActivated" /> + <shape + android:shape="ring" + android:innerRadius="2dp" + android:thickness="2dp" + android:useLevel="false" + android:tint="?attr/colorControlNormal" + android:opticalInsetLeft="3dp" + android:opticalInsetRight="3dp"> + <solid + android:color="#ff000000" /> + <size + android:width="18dp" + android:height="18dp" /> + </shape> </item> - <transition android:fromId="@+id/not_pressed" android:toId="@+id/pressed"> - <animation-list> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_000" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_001" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_002" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_003" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_004" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_to_pressed_mtrl_005" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - </animation-list> - </transition> - <transition android:fromId="@+id/pressed" android:toId="@+id/not_pressed"> - <animation-list> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_000" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_001" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_002" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_003" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_004" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - <item android:duration="15"> - <bitmap android:src="@drawable/scrubber_control_from_pressed_mtrl_005" android:gravity="center" android:tint="?attr/colorControlActivated" /> - </item> - </animation-list> - </transition> + <item + android:id="@+id/pressed" + android:state_pressed="true" + android:drawable="@drawable/seekbar_thumb_pressed_to_unpressed" /> + <item + android:id="@+id/unpressed" + android:drawable="@drawable/seekbar_thumb_unpressed_to_pressed" /> + <transition + android:fromId="@+id/unpressed" + android:toId="@+id/pressed" + android:drawable="@drawable/seekbar_thumb_unpressed_to_pressed_animation" /> + <transition + android:fromId="@+id/pressed" + android:toId="@+id/unpressed" + android:drawable="@drawable/seekbar_thumb_pressed_to_unpressed_animation" /> </animated-selector> diff --git a/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed.xml b/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed.xml new file mode 100644 index 0000000..c2c678af --- /dev/null +++ b/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:name="seekbar_thumb_pressed_to_unpressed" + android:width="18dp" + android:height="18dp" + android:viewportWidth="18" + android:viewportHeight="18" + android:tint="?attr/colorControlActivated" + android:opticalInsetLeft="6dp" + android:opticalInsetRight="6dp"> + <group + android:name="thumb" + android:translateX="9" + android:translateY="9" + android:scaleX="1.5" + android:scaleY="1.5"> + <path + android:name="thumb_path" + android:fillColor="#FF000000" + android:pathData="M 0.0,-6.0 c 3.3137084988,0.0 6.0,2.6862915012 6.0,6.0 c 0.0,3.3137084988 -2.6862915012,6.0 -6.0,6.0 c -3.3137084988,0.0 -6.0,-2.6862915012 -6.0,-6.0 c 0.0,-3.3137084988 2.6862915012,-6.0 6.0,-6.0 Z" /> + </group> +</vector> diff --git a/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed_animation.xml b/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed_animation.xml new file mode 100644 index 0000000..6a2da7d --- /dev/null +++ b/core/res/res/drawable/seekbar_thumb_pressed_to_unpressed_animation.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<animated-vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/seekbar_thumb_pressed_to_unpressed" > + <target + android:name="thumb" + android:animation="@anim/seekbar_thumb_pressed_to_unpressed_thumb_animation" /> +</animated-vector> diff --git a/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed.xml b/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed.xml new file mode 100644 index 0000000..8040018 --- /dev/null +++ b/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:name="seekbar_thumb_unpressed_to_pressed" + android:width="18dp" + android:height="18dp" + android:viewportWidth="18" + android:viewportHeight="18" + android:tint="?attr/colorControlActivated" + android:opticalInsetLeft="6dp" + android:opticalInsetRight="6dp"> + <group + android:name="thumb_0" + android:translateX="9" + android:translateY="9"> + <path + android:name="thumb_path_0" + android:fillColor="#FF000000" + android:pathData="M 0.0,-6.0 c 3.3137084988,0.0 6.0,2.6862915012 6.0,6.0 c 0.0,3.3137084988 -2.6862915012,6.0 -6.0,6.0 c -3.3137084988,0.0 -6.0,-2.6862915012 -6.0,-6.0 c 0.0,-3.3137084988 2.6862915012,-6.0 6.0,-6.0 Z" /> + </group> +</vector> diff --git a/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed_animation.xml b/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed_animation.xml new file mode 100644 index 0000000..1c2b3a9 --- /dev/null +++ b/core/res/res/drawable/seekbar_thumb_unpressed_to_pressed_animation.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<animated-vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/seekbar_thumb_unpressed_to_pressed" > + <target + android:name="thumb_0" + android:animation="@anim/seekbar_thumb_unpressed_to_pressed_thumb_0_animation" /> +</animated-vector> diff --git a/core/res/res/drawable/seekbar_track_material.xml b/core/res/res/drawable/seekbar_track_material.xml index 01eb243..6e40c48 100644 --- a/core/res/res/drawable/seekbar_track_material.xml +++ b/core/res/res/drawable/seekbar_track_material.xml @@ -20,7 +20,7 @@ <shape android:shape="rectangle" android:tint="?attr/colorControlNormal"> <size android:height="@dimen/seekbar_track_background_height_material" /> - <solid android:color="@color/white_disabled_material" /> + <solid android:color="#ff000000" /> </shape> </item> <item android:id="@id/secondaryProgress" diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 46e1e5e..312ec04 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -3908,6 +3908,11 @@ <attr name="thumbOffset" format="dimension" /> <!-- Whether to split the track and leave a gap for the thumb drawable. --> <attr name="splitTrack" format="boolean" /> + <!-- Whether to force the track's alpha to ?android:attr/disabledAlpha + when disabled. This is required for Holo and Gingerbread, but + should always be false for Material and beyond. + @hide Developers shouldn't need to change this. --> + <attr name="useDisabledAlpha" format="boolean" /> <!-- Tint to apply to the button graphic. --> <attr name="thumbTint" format="color" /> <!-- Blending mode used to apply the button graphic tint. --> @@ -5117,6 +5122,18 @@ <!-- When a tint color is set, specifies its Porter-Duff blending mode. The default value is src_in, which treats the drawable as an alpha mask. --> <attr name="tintMode" /> + <!-- Left optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetLeft" /> + <!-- Top optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetTop" /> + <!-- Right optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetRight" /> + <!-- Bottom optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetBottom" /> </declare-styleable> <!-- Used to specify the size of the shape for GradientDrawable. --> @@ -5578,6 +5595,18 @@ <!-- The opacity of the whole vector drawable, as a value between 0 (completely transparent) and 1 (completely opaque). --> <attr name="alpha" /> + <!-- Left optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetLeft" format="dimension" /> + <!-- Top optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetTop" format="dimension" /> + <!-- Right optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetRight" format="dimension" /> + <!-- Bottom optical inset. + @hide Until optical insets are fully supported. --> + <attr name="opticalInsetBottom" format="dimension" /> </declare-styleable> <!-- Defines the group used in VectorDrawables. --> diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml index 56eafe1..f9fcf38 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -721,6 +721,7 @@ please see styles_device_defaults.xml. <item name="indeterminateDrawable">@drawable/seekbar_track_material</item> <item name="thumb">@drawable/seekbar_thumb_material_anim</item> <item name="splitTrack">true</item> + <item name="useDisabledAlpha">false</item> <item name="focusable">true</item> <item name="paddingStart">16dip</item> <item name="paddingEnd">16dip</item> diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java index b8f64a4..d0535e7 100644 --- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java @@ -25,6 +25,7 @@ import android.content.res.Resources.Theme; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.ColorFilter; +import android.graphics.Insets; import android.graphics.Outline; import android.graphics.PorterDuff; import android.graphics.Rect; @@ -271,6 +272,12 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable { mAnimatedVectorState.mVectorDrawable.getOutline(outline); } + /** @hide */ + @Override + public Insets getOpticalInsets() { + return mAnimatedVectorState.mVectorDrawable.getOpticalInsets(); + } + @Override public void inflate(Resources res, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 4c2817c..ed47eed 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -25,6 +25,7 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.DashPathEffect; +import android.graphics.Insets; import android.graphics.LinearGradient; import android.graphics.Outline; import android.graphics.Paint; @@ -1107,6 +1108,16 @@ public class GradientDrawable extends Drawable { if (tint != null) { state.mTint = tint; } + + final int insetLeft = a.getDimensionPixelSize( + R.styleable.GradientDrawable_opticalInsetLeft, state.mOpticalInsets.left); + final int insetTop = a.getDimensionPixelSize( + R.styleable.GradientDrawable_opticalInsetTop, state.mOpticalInsets.top); + final int insetRight = a.getDimensionPixelSize( + R.styleable.GradientDrawable_opticalInsetRight, state.mOpticalInsets.right); + final int insetBottom = a.getDimensionPixelSize( + R.styleable.GradientDrawable_opticalInsetBottom, state.mOpticalInsets.bottom); + state.mOpticalInsets = Insets.of(insetLeft, insetTop, insetRight, insetBottom); } @Override @@ -1469,6 +1480,12 @@ public class GradientDrawable extends Drawable { return mGradientState.mHeight; } + /** @hide */ + @Override + public Insets getOpticalInsets() { + return mGradientState.mOpticalInsets; + } + @Override public ConstantState getConstantState() { mGradientState.mChangingConfigurations = getChangingConfigurations(); @@ -1573,6 +1590,7 @@ public class GradientDrawable extends Drawable { public int mInnerRadius = -1; public int mThickness = -1; public boolean mDither = false; + public Insets mOpticalInsets = Insets.NONE; float mCenterX = 0.5f; float mCenterY = 0.5f; @@ -1631,6 +1649,7 @@ public class GradientDrawable extends Drawable { mInnerRadius = state.mInnerRadius; mThickness = state.mThickness; mDither = state.mDither; + mOpticalInsets = state.mOpticalInsets; mCenterX = state.mCenterX; mCenterY = state.mCenterY; mGradientRadius = state.mGradientRadius; diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index f4df14e..b9f3f2a 100644 --- a/graphics/java/android/graphics/drawable/VectorDrawable.java +++ b/graphics/java/android/graphics/drawable/VectorDrawable.java @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.ColorFilter; +import android.graphics.Insets; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; @@ -361,6 +362,12 @@ public class VectorDrawable extends Drawable { return (int) mVectorState.mVPathRenderer.mBaseHeight; } + /** @hide */ + @Override + public Insets getOpticalInsets() { + return mVectorState.mVPathRenderer.mOpticalInsets; + } + @Override public boolean canApplyTheme() { return (mVectorState != null && mVectorState.canApplyTheme()) || super.canApplyTheme(); @@ -524,6 +531,16 @@ public class VectorDrawable extends Drawable { "<vector> tag requires height > 0"); } + final int insetLeft = a.getDimensionPixelSize( + R.styleable.VectorDrawable_opticalInsetLeft, pathRenderer.mOpticalInsets.left); + final int insetTop = a.getDimensionPixelSize( + R.styleable.VectorDrawable_opticalInsetTop, pathRenderer.mOpticalInsets.top); + final int insetRight = a.getDimensionPixelSize( + R.styleable.VectorDrawable_opticalInsetRight, pathRenderer.mOpticalInsets.right); + final int insetBottom = a.getDimensionPixelSize( + R.styleable.VectorDrawable_opticalInsetBottom, pathRenderer.mOpticalInsets.bottom); + pathRenderer.mOpticalInsets = Insets.of(insetLeft, insetTop, insetRight, insetBottom); + final float alphaInFloat = a.getFloat(R.styleable.VectorDrawable_alpha, pathRenderer.getAlpha()); pathRenderer.setAlpha(alphaInFloat); @@ -821,6 +838,7 @@ public class VectorDrawable extends Drawable { float mBaseHeight = 0; float mViewportWidth = 0; float mViewportHeight = 0; + Insets mOpticalInsets = Insets.NONE; int mRootAlpha = 0xFF; String mRootName = null; @@ -859,6 +877,7 @@ public class VectorDrawable extends Drawable { mBaseHeight = copy.mBaseHeight; mViewportWidth = copy.mViewportWidth; mViewportHeight = copy.mViewportHeight; + mOpticalInsets = copy.mOpticalInsets; mChangingConfigurations = copy.mChangingConfigurations; mRootAlpha = copy.mRootAlpha; mRootName = copy.mRootName; |