-
public class FixedSizeDrawable extends Drawable
A wrapper drawable to square the wrapped drawable so that it expands to fill a square with exactly the given side length. The goal of this drawable is to ensure that square thumbnail drawables always match the size of the view they will be displayed in to avoid a costly requestLayout call. This class should not be used with views or drawables that are not square.
-
-
Constructor Summary
Constructors Constructor Description FixedSizeDrawable(Drawable wrapped, int width, int height)
-
Method Summary
Modifier and Type Method Description voidsetBounds(int left, int top, int right, int bottom)voidsetChangingConfigurations(int configs)intgetChangingConfigurations()voidsetDither(boolean dither)voidsetFilterBitmap(boolean filter)Drawable.CallbackgetCallback()intgetAlpha()voidsetColorFilter(int color, @NonNull() PorterDuff.Mode mode)voidclearColorFilter()DrawablegetCurrent()booleansetVisible(boolean visible, boolean restart)intgetIntrinsicWidth()intgetIntrinsicHeight()intgetMinimumWidth()intgetMinimumHeight()booleangetPadding(@NonNull() Rect padding)voidinvalidateSelf()voidunscheduleSelf(@NonNull() Runnable what)voidscheduleSelf(@NonNull() Runnable what, long when)voiddraw(@NonNull() Canvas canvas)voidsetAlpha(int i)voidsetColorFilter(ColorFilter colorFilter)intgetOpacity()Drawablemutate()Drawable.ConstantStategetConstantState()-
Methods inherited from class android.graphics.drawable.Drawable
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromStream, createFromXml, createFromXmlInner, draw, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOpacity, getOpticalInsets, getOutline, getPadding, getState, getTransparentRegion, hasFocusStateSpecified, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, mutate, onLayoutDirectionChanged, resolveOpacity, scheduleSelf, setAlpha, setAutoMirrored, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode, setVisible, unscheduleSelf -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FixedSizeDrawable
FixedSizeDrawable(Drawable wrapped, int width, int height)
-
-
Method Detail
-
setBounds
void setBounds(int left, int top, int right, int bottom)
-
setChangingConfigurations
void setChangingConfigurations(int configs)
-
getChangingConfigurations
int getChangingConfigurations()
-
setDither
@Deprecated() void setDither(boolean dither)
-
setFilterBitmap
void setFilterBitmap(boolean filter)
-
getCallback
Drawable.Callback getCallback()
-
getAlpha
@RequiresApi(value = Build.VERSION_CODES.KITKAT) int getAlpha()
-
setColorFilter
void setColorFilter(int color, @NonNull() PorterDuff.Mode mode)
-
clearColorFilter
void clearColorFilter()
-
getCurrent
@NonNull() Drawable getCurrent()
-
setVisible
boolean setVisible(boolean visible, boolean restart)
-
getIntrinsicWidth
int getIntrinsicWidth()
-
getIntrinsicHeight
int getIntrinsicHeight()
-
getMinimumWidth
int getMinimumWidth()
-
getMinimumHeight
int getMinimumHeight()
-
getPadding
boolean getPadding(@NonNull() Rect padding)
-
invalidateSelf
void invalidateSelf()
-
unscheduleSelf
void unscheduleSelf(@NonNull() Runnable what)
-
scheduleSelf
void scheduleSelf(@NonNull() Runnable what, long when)
-
setAlpha
void setAlpha(int i)
-
setColorFilter
void setColorFilter(ColorFilter colorFilter)
-
getOpacity
int getOpacity()
-
getConstantState
Drawable.ConstantState getConstantState()
-
-
-
-