-
public class PixelUtils
-
-
Field Summary
Fields Modifier and Type Field Description public final static Map<String, Integer>
dimensionConstantLookup
-
Method Summary
Modifier and Type Method Description static void
init(Context ctx)
Recalculates scale value etc. static PointF
add(PointF lhs, PointF rhs)
static PointF
sub(PointF lhs, PointF rhs)
static float
dpToPix(float dp)
Converts a dp value to pixels. static float
spToPix(float sp)
Converts an sp value to pixels. static float
stringToDimension(String dimension)
-
-
Method Detail
-
init
static void init(Context ctx)
Recalculates scale value etc. Should be called when an application starts orwhenever the screen is rotated.
-
dpToPix
static float dpToPix(float dp)
Converts a dp value to pixels.
-
spToPix
static float spToPix(float sp)
Converts an sp value to pixels.
-
stringToDimension
static float stringToDimension(String dimension)
-
-
-
-