List of usage examples for android.util TypedValue applyDimension
public static float applyDimension(int unit, float value, DisplayMetrics metrics)
From source file:Main.java
public static int sp2px(Context context, int spValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics()); }
From source file:Main.java
public static int dp2px(Context context, int dpValue) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics()); }
From source file:Main.java
public static float sp2px(int sp, DisplayMetrics metrics) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, metrics); }
From source file:Main.java
public static int getPixelFromDIP(final View view, int value) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, view.getResources().getDisplayMetrics()); }
From source file:Main.java
public static float sp2Px(float sp, DisplayMetrics metrics) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, metrics); }
From source file:Main.java
public static float getPxValue(int unit, float value) { return TypedValue.applyDimension(unit, value, Resources.getSystem().getDisplayMetrics()); }
From source file:Main.java
public static float px2dip(Context context, float pxValue) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, pxValue, context.getResources().getDisplayMetrics()); }
From source file:Main.java
public static int convertDpToPx(float dp, Context context) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()); }
From source file:Main.java
public static float transformToDip(float i, Context context) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, i, context.getResources().getDisplayMetrics()); }
From source file:Main.java
public static int dpToPx(Resources res, int dp) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, res.getDisplayMetrics()); }