Package com.airbnb.lottie.utils
Class Utils
- java.lang.Object
-
- com.airbnb.lottie.utils.Utils
-
public final class Utils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intSECOND_IN_NANOS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyTrimPathIfNeeded(Path path, float startValue, float endValue, float offsetValue)static voidapplyTrimPathIfNeeded(Path path, TrimPathContent trimPath)static voidcloseQuietly(java.io.Closeable closeable)static PathcreatePath(PointF startPoint, PointF endPoint, PointF cp1, PointF cp2)static floatdpScale()static floatgetAnimationScale(Context context)static floatgetScale(Matrix matrix)static inthashFor(float a, float b, float c, float d)static booleanhasZeroScaleAxis(Matrix matrix)static booleanisAtLeastVersion(int major, int minor, int patch, int minMajor, int minMinor, int minPatch)static booleanisNetworkException(java.lang.Throwable e)From http://vaibhavblogs.org/2012/12/common-java-networking-exceptions/static BitmaprenderPath(Path path)For testing purposes only.static BitmapresizeBitmapIfNeeded(Bitmap bitmap, int width, int height)Resize the bitmap to exactly the same size as the specified dimension, changing the aspect ratio if needed.static voidsaveLayerCompat(Canvas canvas, RectF rect, Paint paint)static voidsaveLayerCompat(Canvas canvas, RectF rect, Paint paint, int flag)
-
-
-
Field Detail
-
SECOND_IN_NANOS
public static final int SECOND_IN_NANOS
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPath
public static Path createPath(PointF startPoint, PointF endPoint, PointF cp1, PointF cp2)
-
closeQuietly
public static void closeQuietly(java.io.Closeable closeable)
-
getScale
public static float getScale(Matrix matrix)
-
hasZeroScaleAxis
public static boolean hasZeroScaleAxis(Matrix matrix)
-
applyTrimPathIfNeeded
public static void applyTrimPathIfNeeded(Path path, @Nullable TrimPathContent trimPath)
-
applyTrimPathIfNeeded
public static void applyTrimPathIfNeeded(Path path, float startValue, float endValue, float offsetValue)
-
isAtLeastVersion
public static boolean isAtLeastVersion(int major, int minor, int patch, int minMajor, int minMinor, int minPatch)
-
hashFor
public static int hashFor(float a, float b, float c, float d)
-
dpScale
public static float dpScale()
-
getAnimationScale
public static float getAnimationScale(Context context)
-
resizeBitmapIfNeeded
public static Bitmap resizeBitmapIfNeeded(Bitmap bitmap, int width, int height)
Resize the bitmap to exactly the same size as the specified dimension, changing the aspect ratio if needed. Returns the original bitmap if the dimensions already match.
-
isNetworkException
public static boolean isNetworkException(java.lang.Throwable e)
From http://vaibhavblogs.org/2012/12/common-java-networking-exceptions/
-
saveLayerCompat
public static void saveLayerCompat(Canvas canvas, RectF rect, Paint paint, int flag)
-
-