code: public static int dpToPx(Context context, float dp) {
      DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
      return (int) ((dp * displayMetrics.density) + 0.5);
    }
docs: Converts a dp value to a px value
  
  @param context The context
  @param dp the dp value
  @return value in pixels