ui/src/main/java/com/stanfy/enroscar/views/GUIUtils.java
public static int pixelsWidth(final DisplayMetrics displayMetrics, final int dip) {
    final float scale = displayMetrics.density;
    final float alpha = 0.5f;
    return (int)(dip * scale + alpha);
  }
public static int pixelsWidth(final DisplayMetrics displayMetrics, final int dip) {
    final float scale = displayMetrics.density;
    final float alpha = 0.5f;
    return (int)(dip * scale + alpha);
  }
public static int pixelsWidth ( final DisplayMetrics displayMetrics , final int dip ) { final float scale = displayMetrics . density ; final float alpha = 0.5f ; return ( int ) ( dip * scale + alpha ) ; }
Converts device independent points to actual pixels.
@param displayMetrics display metrics
@param dip dip value
@return pixels count
Converts device independent points to actual pixels .