Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static float cvDP2PX(float dp) {
- DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
- float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
- return px;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement