float scale = getResources().getDisplayMetrics().density;
dpAsPixels = (int) (sizeInDp * scale + 0.5f);
Last active
March 30, 2016 14:25
-
-
Save MaartenS/1804d3a6e3f6a9717a1eb1e15e7ea54a to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment