package lic.swifter.box.util;

import android.content.Context;

/**
 * Created by lic on 16-7-7.
 */
public class DisplayUtil {

    public static int dip2px(Context context, float dip) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (dip * scale + 0.5);
    }
}

@@ -181,12 +181,214 @@
  dip
+Value) %7B%0A        final float scale = context.getResources().getDisplayMetrics().density;%0A        return (int) (dipValue * scale + 0.5);%0A    %7D%0A%0A    public static int px2dip(Context context, float pxValue
 ) %7B%0A
-
     
@@ -489,13 +489,17 @@
 t) (
-dip *
+pxValue /
  sca
@@ -498,27 +498,28 @@
 ue / scale + 0.5
+f
 );%0A    %7D%0A%7D%0A

add method to DisplayUtil