Created
March 30, 2016 02:30
-
-
Save shau-lok/592e698204bf59d99664b3ec7981081c to your computer and use it in GitHub Desktop.
dip convert to pixel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static float dipToPixels(Context context, float dipValue) { | |
DisplayMetrics metrics = context.getResources().getDisplayMetrics(); | |
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue, metrics); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment