Methods Summary |
---|
public void | draw(Canvas canvas)
canvas.drawColor(mState.mUseColor);
|
public int | getAlpha()Returns the alpha value of this drawable's color.
return mState.mUseColor >>> 24;
|
public int | getChangingConfigurations()
return super.getChangingConfigurations() | mState.mChangingConfigurations;
|
public ConstantState | getConstantState()
mState.mChangingConfigurations = super.getChangingConfigurations();
return mState;
|
public int | getOpacity()
switch (mState.mUseColor >>> 24) {
case 255:
return PixelFormat.OPAQUE;
case 0:
return PixelFormat.TRANSPARENT;
}
return PixelFormat.TRANSLUCENT;
|
public void | inflate(android.content.res.Resources r, org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs)
super.inflate(r, parser, attrs);
TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ColorDrawable);
int color = mState.mBaseColor;
color = a.getColor(com.android.internal.R.styleable.ColorDrawable_color, color);
mState.mBaseColor = mState.mUseColor = color;
a.recycle();
|
public void | setAlpha(int alpha)Sets the color's alpha value.
alpha += alpha >> 7; // make it 0..256
int baseAlpha = mState.mBaseColor >>> 24;
int useAlpha = baseAlpha * alpha >> 8;
mState.mUseColor = (mState.mBaseColor << 8 >>> 8) | (useAlpha << 24);
|
public void | setColorFilter(ColorFilter colorFilter)Setting a color filter on a ColorDrawable has no effect.
|