-
public final class Utils
-
-
Field Summary
Fields Modifier and Type Field Description public final static intSECOND_IN_NANOSpublic final static MatrixIDENTITY_MATRIX
-
Method Summary
Modifier and Type Method Description static PathcreatePath(PointF startPoint, PointF endPoint, PointF cp1, PointF cp2)static voidcloseQuietly(Closeable closeable)static floatgetScale(Matrix matrix)static booleanhasZeroScaleAxis(Matrix matrix)static voidapplyTrimPathIfNeeded(Path path, @Nullable() TrimPathContent trimPath)static voidapplyTrimPathIfNeeded(Path path, float startValue, float endValue, float offsetValue)static booleanisAtLeastVersion(int major, int minor, int patch, int minMajor, int minMinor, int minPatch)static inthashFor(float a, float b, float c, float d)static floatdpScale()static floatgetAnimationScale(@NonNull() Context context)static BitmapresizeBitmapIfNeeded(@NonNull() 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. static booleanisNetworkException(Throwable e)From http://vaibhavblogs. static voidsaveLayerCompat(Canvas canvas, RectF rect, Paint paint)static voidsaveLayerCompat(Canvas canvas, RectF rect, Paint paint, int flag)static intmixOpacities(int opacity1, int opacity2)Multiplies 2 opacities that are 0-255. static BitmaprenderPath(Path path)For testing purposes only. -
-
Method Detail
-
closeQuietly
static void closeQuietly(Closeable closeable)
-
hasZeroScaleAxis
static boolean hasZeroScaleAxis(Matrix matrix)
-
applyTrimPathIfNeeded
static void applyTrimPathIfNeeded(Path path, @Nullable() TrimPathContent trimPath)
-
applyTrimPathIfNeeded
static void applyTrimPathIfNeeded(Path path, float startValue, float endValue, float offsetValue)
-
isAtLeastVersion
static boolean isAtLeastVersion(int major, int minor, int patch, int minMajor, int minMinor, int minPatch)
-
hashFor
static int hashFor(float a, float b, float c, float d)
-
dpScale
static float dpScale()
-
getAnimationScale
static float getAnimationScale(@NonNull() Context context)
-
resizeBitmapIfNeeded
static Bitmap resizeBitmapIfNeeded(@NonNull() 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
static boolean isNetworkException(Throwable e)
From http://vaibhavblogs.org/2012/12/common-java-networking-exceptions/
-
saveLayerCompat
static void saveLayerCompat(Canvas canvas, RectF rect, Paint paint)
-
saveLayerCompat
static void saveLayerCompat(Canvas canvas, RectF rect, Paint paint, int flag)
-
mixOpacities
static int mixOpacities(int opacity1, int opacity2)
Multiplies 2 opacities that are 0-255.
-
renderPath
static Bitmap renderPath(Path path)
For testing purposes only. DO NOT USE IN PRODUCTION.
-
-
-
-