| java.lang.Object | |||
| ↳ | android.graphics.drawable.Drawable | ||
| ↳ | com.facebook.drawee.drawable.ForwardingDrawable | ||
| ↳ | com.facebook.drawee.drawable.ScaleTypeDrawable | ||
Drawable that can scale underlying drawable based on specified ScalingUtils.ScaleType options.
 
Based on android.widget.ImageView.ScaleType.
| [Expand] Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
com.facebook.drawee.drawable.ForwardingDrawable | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ScaleTypeDrawable(Drawable drawable, ScalingUtils.ScaleType scaleType) Creates a new ScaleType drawable with given underlying drawable and scale type. | |||||||||||
| ScaleTypeDrawable(Drawable drawable, ScalingUtils.ScaleType scaleType, PointF focusPoint) Creates a new ScaleType drawable with given underlying drawable, scale type, and focus point. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void | draw(Canvas canvas) | ||||||||||
| PointF | getFocusPoint() Gets the focus point. | ||||||||||
| ScalingUtils.ScaleType | getScaleType() Gets the current scale type. | ||||||||||
| void | getTransform(Matrix transform) TransformationCallback method | ||||||||||
| Drawable | setCurrent(Drawable newDelegate) Sets a new drawable to be the delegate, and returns the old one (or null). | ||||||||||
| void | setFocusPoint(PointF focusPoint) Sets the focus point. | ||||||||||
| void | setScaleType(ScalingUtils.ScaleType scaleType) Sets the scale type. | ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void | onBoundsChange(Rect bounds) | ||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  com.facebook.drawee.drawable.ForwardingDrawable | |||||||||||
|  From class
  android.graphics.drawable.Drawable | |||||||||||
|  From class
  java.lang.Object | |||||||||||
|  From interface
  android.graphics.drawable.Drawable.Callback | |||||||||||
|  From interface
  com.facebook.drawee.drawable.DrawableParent | |||||||||||
|  From interface
  com.facebook.drawee.drawable.TransformAwareDrawable | |||||||||||
|  From interface
  com.facebook.drawee.drawable.TransformCallback | |||||||||||
Creates a new ScaleType drawable with given underlying drawable and scale type.
| drawable | underlying drawable to apply scale type on | 
|---|---|
| scaleType | scale type to be applied | 
Creates a new ScaleType drawable with given underlying drawable, scale type, and focus point.
| drawable | underlying drawable to apply scale type on | 
|---|---|
| scaleType | scale type to be applied | 
| focusPoint | focus point of the image | 
Gets the focus point.
TransformationCallback method
| transform | Matrix that is applied to the drawable by the parent drawables. | 
|---|
Sets a new drawable to be the delegate, and returns the old one (or null).
This method will cause the drawable to be invalidated.
Sets the focus point. If ScaleType.FOCUS_CROP is used, focus point will attempted to be centered within a view. Each coordinate is a real number in [0,1] range, in the coordinate system where top-left corner of the image corresponds to (0, 0) and the bottom-right corner corresponds to (1, 1).
| focusPoint | focus point of the image | 
|---|
Sets the scale type.
| scaleType | scale type to set | 
|---|