Back to project page 9GAGTVAnimation.
The source code is released under:
MIT License
If you think the Android project 9GAGTVAnimation listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.leolink.android.ninegagtvanimation; /*w w w . ja v a2s . c o m*/ import android.content.Context; import android.util.DisplayMetrics; /** * Created by leolink on 6/8/14. */ public class Util { public static int dpToPx(Context context, int dp) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); int px = Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT)); return px; } }