Forward additional drawable methods in AVD

BUG: 17156349
Change-Id: I1d7b41fc8d0399b31db4cf21aa47180e96bfbcfe
This commit is contained in:
Alan Viverette
2014-08-20 13:44:44 -07:00
parent aff1efa622
commit 06cd7dce24

View File

@@ -17,11 +17,15 @@ package android.graphics.drawable;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.ValueAnimator;
import android.annotation.NonNull;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
@@ -129,7 +133,6 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
private final AnimatedVectorDrawableState mAnimatedVectorState;
public AnimatedVectorDrawable() {
mAnimatedVectorState = new AnimatedVectorDrawableState(
new AnimatedVectorDrawableState(null));
@@ -162,6 +165,16 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
mAnimatedVectorState.mVectorDrawable.setBounds(bounds);
}
@Override
protected boolean onStateChange(int[] state) {
return mAnimatedVectorState.mVectorDrawable.setState(state);
}
@Override
protected boolean onLevelChange(int level) {
return mAnimatedVectorState.mVectorDrawable.setLevel(level);
}
@Override
public int getAlpha() {
return mAnimatedVectorState.mVectorDrawable.getAlpha();
@@ -177,6 +190,43 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
mAnimatedVectorState.mVectorDrawable.setColorFilter(colorFilter);
}
@Override
public void setTintList(ColorStateList tint) {
mAnimatedVectorState.mVectorDrawable.setTintList(tint);
}
@Override
public void setHotspot(float x, float y) {
mAnimatedVectorState.mVectorDrawable.setHotspot(x, y);
}
@Override
public void setHotspotBounds(int left, int top, int right, int bottom) {
mAnimatedVectorState.mVectorDrawable.setHotspotBounds(left, top, right, bottom);
}
@Override
public void setTintMode(PorterDuff.Mode tintMode) {
mAnimatedVectorState.mVectorDrawable.setTintMode(tintMode);
}
@Override
public boolean setVisible(boolean visible, boolean restart) {
mAnimatedVectorState.mVectorDrawable.setVisible(visible, restart);
return super.setVisible(visible, restart);
}
/** {@hide} */
@Override
public void setLayoutDirection(int layoutDirection) {
mAnimatedVectorState.mVectorDrawable.setLayoutDirection(layoutDirection);
}
@Override
public boolean isStateful() {
return mAnimatedVectorState.mVectorDrawable.isStateful();
}
@Override
public int getOpacity() {
return mAnimatedVectorState.mVectorDrawable.getOpacity();
@@ -192,6 +242,11 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
return mAnimatedVectorState.mVectorDrawable.getIntrinsicHeight();
}
@Override
public void getOutline(@NonNull Outline outline) {
mAnimatedVectorState.mVectorDrawable.getOutline(outline);
}
@Override
public void inflate(Resources res, XmlPullParser parser, AttributeSet attrs, Theme theme)
throws XmlPullParserException, IOException {