com.bumptech.glide.request.target
Class SquaringDrawable
java.lang.Object
android.graphics.drawable.Drawable
com.bumptech.glide.load.resource.drawable.GlideDrawable
com.bumptech.glide.request.target.SquaringDrawable
- All Implemented Interfaces:
- android.graphics.drawable.Animatable
public class SquaringDrawable
- extends GlideDrawable
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 classes/interfaces inherited from class android.graphics.drawable.Drawable |
android.graphics.drawable.Drawable.Callback, android.graphics.drawable.Drawable.ConstantState |
Methods inherited from class android.graphics.drawable.Drawable |
copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXmlInner, getBounds, getLevel, getState, getTransparentRegion, inflate, isAutoMirrored, isStateful, isVisible, jumpToCurrentState, onBoundsChange, onLevelChange, onStateChange, resolveOpacity, setAutoMirrored, setCallback, setLevel, setState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SquaringDrawable
public SquaringDrawable(GlideDrawable wrapped,
int side)
setBounds
public void setBounds(int left,
int top,
int right,
int bottom)
- Overrides:
setBounds
in class android.graphics.drawable.Drawable
setBounds
public void setBounds(android.graphics.Rect bounds)
- Overrides:
setBounds
in class android.graphics.drawable.Drawable
setChangingConfigurations
public void setChangingConfigurations(int configs)
- Overrides:
setChangingConfigurations
in class android.graphics.drawable.Drawable
getChangingConfigurations
public int getChangingConfigurations()
- Overrides:
getChangingConfigurations
in class android.graphics.drawable.Drawable
setDither
public void setDither(boolean dither)
- Overrides:
setDither
in class android.graphics.drawable.Drawable
setFilterBitmap
public void setFilterBitmap(boolean filter)
- Overrides:
setFilterBitmap
in class android.graphics.drawable.Drawable
getCallback
public android.graphics.drawable.Drawable.Callback getCallback()
- Overrides:
getCallback
in class android.graphics.drawable.Drawable
getAlpha
public int getAlpha()
- Overrides:
getAlpha
in class android.graphics.drawable.Drawable
setColorFilter
public void setColorFilter(int color,
android.graphics.PorterDuff.Mode mode)
- Overrides:
setColorFilter
in class android.graphics.drawable.Drawable
clearColorFilter
public void clearColorFilter()
- Overrides:
clearColorFilter
in class android.graphics.drawable.Drawable
getCurrent
public android.graphics.drawable.Drawable getCurrent()
- Overrides:
getCurrent
in class android.graphics.drawable.Drawable
setVisible
public boolean setVisible(boolean visible,
boolean restart)
- Overrides:
setVisible
in class android.graphics.drawable.Drawable
getIntrinsicWidth
public int getIntrinsicWidth()
- Overrides:
getIntrinsicWidth
in class android.graphics.drawable.Drawable
getIntrinsicHeight
public int getIntrinsicHeight()
- Overrides:
getIntrinsicHeight
in class android.graphics.drawable.Drawable
getMinimumWidth
public int getMinimumWidth()
- Overrides:
getMinimumWidth
in class android.graphics.drawable.Drawable
getMinimumHeight
public int getMinimumHeight()
- Overrides:
getMinimumHeight
in class android.graphics.drawable.Drawable
getPadding
public boolean getPadding(android.graphics.Rect padding)
- Overrides:
getPadding
in class android.graphics.drawable.Drawable
invalidateSelf
public void invalidateSelf()
- Overrides:
invalidateSelf
in class android.graphics.drawable.Drawable
unscheduleSelf
public void unscheduleSelf(Runnable what)
- Overrides:
unscheduleSelf
in class android.graphics.drawable.Drawable
scheduleSelf
public void scheduleSelf(Runnable what,
long when)
- Overrides:
scheduleSelf
in class android.graphics.drawable.Drawable
draw
public void draw(android.graphics.Canvas canvas)
- Specified by:
draw
in class android.graphics.drawable.Drawable
setAlpha
public void setAlpha(int i)
- Specified by:
setAlpha
in class android.graphics.drawable.Drawable
setColorFilter
public void setColorFilter(android.graphics.ColorFilter colorFilter)
- Specified by:
setColorFilter
in class android.graphics.drawable.Drawable
getOpacity
public int getOpacity()
- Specified by:
getOpacity
in class android.graphics.drawable.Drawable
isAnimated
public boolean isAnimated()
- Description copied from class:
GlideDrawable
- Returns
true
if this drawable is animated.
- Specified by:
isAnimated
in class GlideDrawable
setLoopCount
public void setLoopCount(int loopCount)
- Description copied from class:
GlideDrawable
- Sets the number of times the animation should loop. This method will only have an affect if
()
} returns true
. A loop count of <=0 indicates loop forever.
- Specified by:
setLoopCount
in class GlideDrawable
start
public void start()
stop
public void stop()
isRunning
public boolean isRunning()
mutate
public android.graphics.drawable.Drawable mutate()
- Overrides:
mutate
in class android.graphics.drawable.Drawable
getConstantState
public android.graphics.drawable.Drawable.ConstantState getConstantState()
- Overrides:
getConstantState
in class android.graphics.drawable.Drawable