Android Open Source - 9GAGTVAnimation Util






From Project

Back to project page 9GAGTVAnimation.

License

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.

Java Source Code

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;
    }
}




Java Source Code List

net.leolink.android.ninegagtvanimation.Card.java
net.leolink.android.ninegagtvanimation.MainActivity.java
net.leolink.android.ninegagtvanimation.Util.java