code: public static float dipToPx(Resources resources, float dp) {
          DisplayMetrics metrics = resources.getDisplayMetrics();
          return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, metrics);
      }
docs: Change Dip to PX
  
  @param resources Resources
  @param dp        Dip
  @return PX