code: static float dipToPixels(Resources resources, int dip) {
          return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, resources.getDisplayMetrics());
      }
docs: Converts dp into px.
  
  @param resources the context's current resources.
  @param dip       the dp value to convert to px.
  @return the result px value.