Created
May 4, 2014 04:15
-
-
Save burntcookie90/6e793e0c5a7d3ba65735 to your computer and use it in GitHub Desktop.
get size in dp
This file contains 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
float scale = getResources().getDisplayMetrics().density; | |
int dpAsPixels = (int) (sizeInDp*scale + 0.5f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment