Back to Fresco

DrawableUtils

docs/javadoc/reference/com/facebook/drawee/drawable/DrawableUtils.html

3.6.016.0 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

DrawableUtils

extends Object

| java.lang.Object | | ↳ | com.facebook.drawee.drawable.DrawableUtils |

Class Overview

Helper class containing functionality commonly used by drawables.

Summary

Public Constructors
Public Methods
static Drawable
Clones the specified drawable.
static void
Copies various properties from one drawable to the other.
static int
Gets the opacity from a color.
static int
Multiplies the color with the given alpha.
static void
Sets callback to the drawable.
static void
Sets various paint properties on the drawable

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Constructors

public DrawableUtils()

Public Methods

public static Drawable cloneDrawable(Drawable drawable)

Clones the specified drawable.

Parameters

| drawable | the drawable to clone. |

Returns
  • a clone of the drawable or null if the drawable cannot be cloned.

public static void copyProperties(Drawable to, Drawable from)

Copies various properties from one drawable to the other.

Parameters

| to | drawable to copy properties to | | from | drawable to copy properties from |

public static int getOpacityFromColor(int color)

Gets the opacity from a color. Inspired by Android ColorDrawable.

Returns
  • opacity expressed by one of PixelFormat constants

public static int multiplyColorAlpha(int color, int alpha)

Multiplies the color with the given alpha.

Parameters

| color | color to be multiplied | | alpha | value between 0 and 255 |

Returns
  • multiplied color

public static void setCallbacks(Drawable drawable, Drawable.Callback callback, TransformCallback transformCallback)

Sets callback to the drawable.

Parameters

| drawable | drawable to set callbacks to | | callback | standard Android Drawable.Callback | | transformCallback | TransformCallback used by TransformAwareDrawables |

public static void setDrawableProperties(Drawable drawable, DrawableProperties properties)

Sets various paint properties on the drawable

Parameters

| drawable | Drawable on which to set the properties | | properties | wrapper around mValue values to set on the drawable |

+Generated by Doclava. +