public class CircularBitmapDrawable extends ExtendedBitmapDrawable
ExtendedBitmapDrawable.ExtendedOptions
Drawable.Callback, Drawable.ConstantState
DEBUG, LOAD_STATE_FAILED, LOAD_STATE_LOADED, LOAD_STATE_LOADING, LOAD_STATE_NOT_YET_LOADED, LOAD_STATE_UNINITIALIZED
mCurrKey, mDecodeHeight, mDecodeWidth, mPaint, mPrevKey
Constructor and Description |
---|
CircularBitmapDrawable(Resources res,
BitmapCache cache,
boolean limitDensity) |
CircularBitmapDrawable(Resources res,
BitmapCache cache,
boolean limitDensity,
ExtendedBitmapDrawable.ExtendedOptions opts) |
Modifier and Type | Method and Description |
---|---|
protected void |
onDrawBitmap(Canvas canvas,
Rect src,
Rect dst)
Override this method to customize how to draw the bitmap to the canvas for the given bounds.
|
protected void |
onDrawCircularBitmap(Bitmap bitmap,
Canvas canvas,
Rect src,
Rect dst)
Call this method with a given bitmap to draw it onto the given canvas, masked by a circular
BitmapShader.
|
protected void |
onDrawCircularBitmap(Bitmap bitmap,
Canvas canvas,
Rect src,
Rect dst,
float alpha)
Call this method with a given bitmap to draw it onto the given canvas, masked by a circular
BitmapShader.
|
protected void |
onDrawPlaceholderOrProgress(Canvas canvas,
TileDrawable drawable)
Overriding this method to add your own custom placeholder or progress drawing.
|
void |
setAlpha(int alpha)
Specify an alpha value for the drawable. 0 means fully transparent, and
255 means fully opaque.
|
void |
setBorderColor(int color)
Set the border stroke color of this drawable.
|
void |
setBorderWidth(float borderWidth)
Set the border stroke width of this drawable.
|
void |
setColorFilter(ColorFilter cf)
Specify an optional color filter for the drawable.
|
draw, getDecodeHorizontalCenter, getDecodeVerticalCenter, getDrawVerticalCenter, getDrawVerticalOffsetMultiplier, getExtendedOptions, getLoadState, loadFileDescriptorFactory, onBecomeFirstExpected, onBoundsChange, onDecodeBegin, onDecodeCancel, onDecodeComplete, onDecodeFailed, onDraw, onOptsChanged, run, setBitmap, setDecodeDimensions, setExactDecodeDimensions, setImage, setParallaxFraction, shouldExecuteStateChange, showStaticPlaceholder
bind, decode, fileDescriptorFactoryCreated, getBitmap, getDecodeStrategy, getExecutor, getKey, getLayoutDirectionLocal, getOpacity, getPreviousKey, hasBitmap, invalidateDrawable, onLayoutDirectionChangeLocal, scheduleDrawable, setLayoutDirectionLocal, unbind, unbind, unscheduleDrawable
applyTheme, canApplyTheme, clearColorFilter, clearMutated, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, obtainAttributes, onLayoutDirectionChanged, onLevelChange, onStateChange, parseTintMode, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintList, setTintMode, setVisible, setXfermode, unscheduleSelf
public CircularBitmapDrawable(Resources res, BitmapCache cache, boolean limitDensity)
public CircularBitmapDrawable(Resources res, BitmapCache cache, boolean limitDensity, ExtendedBitmapDrawable.ExtendedOptions opts)
public void setBorderWidth(float borderWidth)
public void setBorderColor(int color)
Color.TRANSPARENT
to disable.protected void onDrawBitmap(Canvas canvas, Rect src, Rect dst)
BasicBitmapDrawable
BasicBitmapDrawable.getBitmap()
.onDrawBitmap
in class BasicBitmapDrawable
protected void onDrawPlaceholderOrProgress(Canvas canvas, TileDrawable drawable)
ExtendedBitmapDrawable
onDrawPlaceholderOrProgress
in class ExtendedBitmapDrawable
protected void onDrawCircularBitmap(Bitmap bitmap, Canvas canvas, Rect src, Rect dst)
protected void onDrawCircularBitmap(Bitmap bitmap, Canvas canvas, Rect src, Rect dst, float alpha)
public void setAlpha(int alpha)
Drawable
setAlpha
in class ExtendedBitmapDrawable
public void setColorFilter(ColorFilter cf)
Drawable
If a Drawable has a ColorFilter, each output pixel of the Drawable's drawing contents will be modified by the color filter before it is blended onto the render target of a Canvas.
Pass null
to remove any existing color filter.
Note: Setting a non-null
color
filter disables tint
.
setColorFilter
in class ExtendedBitmapDrawable
cf
- The color filter to apply, or null
to remove the
existing color filter