Class FixedSizeDrawable
java.lang.Object
android.graphics.drawable.Drawable
com.bumptech.glide.request.target.FixedSizeDrawable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class android.graphics.drawable.Drawable
Drawable.Callback, Drawable.ConstantState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintgetAlpha()intintintintintintbooleangetPadding(Rect padding) voidmutate()voidscheduleSelf(Runnable what, long when) voidsetAlpha(int i) voidsetBounds(int left, int top, int right, int bottom) voidvoidsetChangingConfigurations(int configs) voidsetColorFilter(int color, PorterDuff.Mode mode) voidsetColorFilter(ColorFilter colorFilter) voidsetDither(boolean dither) Deprecated.voidsetFilterBitmap(boolean filter) booleansetVisible(boolean visible, boolean restart) voidunscheduleSelf(Runnable what) Methods inherited from class android.graphics.drawable.Drawable
applyTheme, canApplyTheme, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getColorFilter, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getOpticalInsets, getOutline, getState, getTransparentRegion, hasFocusStateSpecified, inflate, inflate, isAutoMirrored, isFilterBitmap, isProjected, isStateful, isVisible, jumpToCurrentState, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, setAutoMirrored, setCallback, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintBlendMode, setTintList, setTintMode
-
Constructor Details
-
FixedSizeDrawable
-
-
Method Details
-
setBounds
public void setBounds(int left, int top, int right, int bottom) -
setBounds
-
setChangingConfigurations
public void setChangingConfigurations(int configs) - Overrides:
setChangingConfigurationsin classDrawable
-
getChangingConfigurations
public int getChangingConfigurations()- Overrides:
getChangingConfigurationsin classDrawable
-
setDither
Deprecated. -
setFilterBitmap
public void setFilterBitmap(boolean filter) - Overrides:
setFilterBitmapin classDrawable
-
getCallback
- Overrides:
getCallbackin classDrawable
-
getAlpha
@RequiresApi(19) public int getAlpha() -
setColorFilter
- Overrides:
setColorFilterin classDrawable
-
clearColorFilter
public void clearColorFilter()- Overrides:
clearColorFilterin classDrawable
-
getCurrent
- Overrides:
getCurrentin classDrawable
-
setVisible
public boolean setVisible(boolean visible, boolean restart) - Overrides:
setVisiblein classDrawable
-
getIntrinsicWidth
public int getIntrinsicWidth()- Overrides:
getIntrinsicWidthin classDrawable
-
getIntrinsicHeight
public int getIntrinsicHeight()- Overrides:
getIntrinsicHeightin classDrawable
-
getMinimumWidth
public int getMinimumWidth()- Overrides:
getMinimumWidthin classDrawable
-
getMinimumHeight
public int getMinimumHeight()- Overrides:
getMinimumHeightin classDrawable
-
getPadding
- Overrides:
getPaddingin classDrawable
-
invalidateSelf
public void invalidateSelf()- Overrides:
invalidateSelfin classDrawable
-
unscheduleSelf
- Overrides:
unscheduleSelfin classDrawable
-
scheduleSelf
- Overrides:
scheduleSelfin classDrawable
-
draw
-
setAlpha
public void setAlpha(int i) -
setColorFilter
- Specified by:
setColorFilterin classDrawable
-
getOpacity
public int getOpacity()- Specified by:
getOpacityin classDrawable
-
mutate
-
getConstantState
- Overrides:
getConstantStatein classDrawable
-