public class DPIUtil
{
  private static Display defaultDisplay;
  private static float mDensity;

  public static int dip2px(float paramFloat)
  {
    return (int)(0.5F + paramFloat * mDensity);
  }

  public static int getHeight()
  {
    return defaultDisplay.getHeight();
  }

  public static int getWidth()
  {
    return defaultDisplay.getWidth();
  }

  public static int percentHeight(float paramFloat)
  {
    return (int)(paramFloat * defaultDisplay.getHeight());
  }

  public static int percentWidth(float paramFloat)
  {
    return (int)(paramFloat * defaultDisplay.getWidth());
  }

  public static int px2dip(Context paramContext, float paramFloat)
  {
    return (int)(0.5F + paramFloat / mDensity);
  }

  public static void setDefaultDisplay(Display paramDisplay)
  {
    defaultDisplay = paramDisplay;
  }

  public static void setDensity(float paramFloat)
  {
    mDensity = paramFloat;
  }
}
jd客户端提取