// Path: app/src/main/java/com/github/mzule/androidweekly/App.java
// public class App extends Application {
//     private static App instance;
// 
//     public static App getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// }


import com.github.mzule.androidweekly.App;
package com.github.mzule.androidweekly.util;



/**
 * Created by CaoDongping on 11/4/15.
 */
public class DensityUtil {
    public static int dp2px(float dp) {
// Path: app/src/main/java/com/github/mzule/androidweekly/App.java
// public class App extends Application {
//     private static App instance;
// 
//     public static App getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// }


// Path: app/src/main/java/com/github/mzule/androidweekly/util/DensityUtil.java
import com.github.mzule.androidweekly.App;

package com.github.mzule.androidweekly.util;



/**
 * Created by CaoDongping on 11/4/15.
 */
public class DensityUtil {
    public static int dp2px(float dp) {
        float density = App.getInstance().getResources().getDisplayMetrics().density;