code: public AutofitHelper setMaxTextSize(int unit, float size) {
          Context context = mTextView.getContext();
          Resources r = Resources.getSystem();
  
          if (context != null) {
              r = context.getResources();
          }
  
          setRawMaxTextSize(TypedValue.applyDimension(unit, size, r.getDisplayMetrics()));
          return this;
      }
docs: Set the maximum text size to a given unit and value. See TypedValue for the possible
  dimension units.
  
  @param unit The desired dimension unit.
  @param size The desired size in the given units.
  
  @attr ref android.R.styleable#TextView_textSize