Last active
February 23, 2022 16:19
-
-
Save Ankit-Slnk/87f887918c168336e0668a69737499c4 to your computer and use it in GitHub Desktop.
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
public static int dpToPx(Context context, float dp) { | |
return Math.round(dp * context.getResources().getDisplayMetrics().density); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment