Created
June 7, 2019 22:02
-
-
Save haseebpvt/44aec003d10bc191ad96b59adfed67b9 to your computer and use it in GitHub Desktop.
Method to convert DP 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 int convertDip2Pixels(Context context, int dip) { | |
| return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, context.getResources().getDisplayMetrics()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment