Android Open Source - spiderreddit Gfx Util






From Project

Back to project page spiderreddit.

License

The source code is released under:

MIT License

If you think the Android project spiderreddit 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 com.davepayne.blogcrawler.util;
/*w ww.  java 2  s  . com*/
import android.content.res.Resources;

/**
 * Helper utility with lightweight methods for pixel to density-pixel (px to dp, respectively)
 * conversion and vice vera.
 */
public class GfxUtil {
    /**
     *
     * @param dp input density pixels.
     * @return returns conversion in pixels.
     */
    public static int dpToPx(int dp)
    {
        return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
    }

    /**
     *
     * @param px input pixels.
     * @return returns conversion in density pixels.
     */
    public static int pxToDp(int px)
    {
        return (int) (px / Resources.getSystem().getDisplayMetrics().density);
    }
}




Java Source Code List

com.davepayne.blogcrawler.EntryDialog.java
com.davepayne.blogcrawler.activity.ItemDetailActivity.java
com.davepayne.blogcrawler.activity.ItemListActivity.java
com.davepayne.blogcrawler.db.RSSDBConfigUtil.java
com.davepayne.blogcrawler.db.RSSDBData.java
com.davepayne.blogcrawler.db.RSSDBHelper.java
com.davepayne.blogcrawler.db.RSSDBManager.java
com.davepayne.blogcrawler.fragment.ItemDetailFragment.java
com.davepayne.blogcrawler.fragment.ItemListFragment.java
com.davepayne.blogcrawler.model.ItemListAdapter.java
com.davepayne.blogcrawler.util.GfxUtil.java