Package com.airbnb.lottie.utils
Class MiscUtils
- java.lang.Object
-
- com.airbnb.lottie.utils.MiscUtils
-
public class MiscUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MiscUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PointFaddPoints(PointF p1, PointF p2)static doubleclamp(double number, double min, double max)static floatclamp(float number, float min, float max)static intclamp(int number, int min, int max)static booleancontains(float number, float rangeMin, float rangeMax)static voidgetPathFromData(ShapeData shapeData, Path outPath)static doublelerp(double a, double b, double percentage)static floatlerp(float a, float b, float percentage)static intlerp(int a, int b, float percentage)static voidresolveKeyPath(KeyPath keyPath, int depth, java.util.List<KeyPath> accumulator, KeyPath currentPartialKeyPath, KeyPathElementContent content)Helper method for anyKeyPathElementContentthat will check if the content fully matches the keypath then will add itself as the final key, resolve it, and add it to the accumulator list.
-
-
-
Method Detail
-
lerp
public static float lerp(float a, float b, float percentage)
-
lerp
public static double lerp(double a, double b, double percentage)
-
lerp
public static int lerp(int a, int b, float percentage)
-
clamp
public static int clamp(int number, int min, int max)
-
clamp
public static float clamp(float number, float min, float max)
-
clamp
public static double clamp(double number, double min, double max)
-
contains
public static boolean contains(float number, float rangeMin, float rangeMax)
-
resolveKeyPath
public static void resolveKeyPath(KeyPath keyPath, int depth, java.util.List<KeyPath> accumulator, KeyPath currentPartialKeyPath, KeyPathElementContent content)
Helper method for anyKeyPathElementContentthat will check if the content fully matches the keypath then will add itself as the final key, resolve it, and add it to the accumulator list. AnyKeyPathElementContentshould call through to this as its implementation ofKeyPathElement.resolveKeyPath(KeyPath, int, List, KeyPath).
-
-