public RoundedIconGenerator(int iconWidthPx,int iconHeightPx,int cornerRadiusPx,int backgroundColor,float textSizePx){
  mIconWidthPx=iconWidthPx;
  mIconHeightPx=iconHeightPx;
  mCornerRadiusPx=cornerRadiusPx;
  mBackgroundRect=new RectF(0,0,mIconWidthPx,mIconHeightPx);
  mBackgroundPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
  mBackgroundPaint.setColor(backgroundColor);
  mTextPaint=new TextPaint(Paint.ANTI_ALIAS_FLAG);
  mTextPaint.setColor(Color.WHITE);
  mTextPaint.setFakeBoldText(true);
  mTextPaint.setTextSize(textSizePx);
  FontMetrics textFontMetrics=mTextPaint.getFontMetrics();
  mTextHeight=(float)Math.ceil(textFontMetrics.bottom - textFontMetrics.top);
  mTextYOffset=-textFontMetrics.top;
}

public RoundedIconGenerator ( int iconWidthPx , int iconHeightPx , int cornerRadiusPx , int backgroundColor , float textSizePx ) { mIconWidthPx = iconWidthPx ; mIconHeightPx = iconHeightPx ; mCornerRadiusPx = cornerRadiusPx ; mBackgroundRect = new RectF ( 0 , 0 , mIconWidthPx , mIconHeightPx ) ; mBackgroundPaint = new Paint ( Paint . ANTI_ALIAS_FLAG ) ; mBackgroundPaint . setColor ( backgroundColor ) ; mTextPaint = new TextPaint ( Paint . ANTI_ALIAS_FLAG ) ; mTextPaint . setColor ( Color . WHITE ) ; mTextPaint . setFakeBoldText ( true ) ; mTextPaint . setTextSize ( textSizePx ) ; FontMetrics textFontMetrics = mTextPaint . getFontMetrics ( ) ; mTextHeight = ( float ) Math . ceil ( textFontMetrics . bottom - textFontMetrics . top ) ; mTextYOffset = - textFontMetrics . top ; }
constructs the generator and initializes the common members ignoring display density .
