public ResizeAnimation(@NonNull View view, final ImageParameters imageParameters) {
   mStartLength =
       view.getContext()
           .getResources()
           .getDimensionPixelSize(R.dimen.squarecamera__cover_start_width);
   mFinalLength = imageParameters.getAnimationParameter();
   mIsPortrait = imageParameters.isPortrait();
   mView = view;
 }
예제 #2
0
  public void initializeLimits(Graphics2D g2d) {
    FontRenderContext frc = g2d.getFontRenderContext();
    ImageParameters im = new ImageParameters();
    int summaryLines = withSummary ? 5 : 0;

    im.xsize = getWidth();
    im.ysize = getHeight();
    im.unitslength = DEFAULT_UNITS_LENGTH;
    im.xorigin = (int) (PADDING_LEFT + im.unitslength * getSmallFontCharWidth(frc));
    im.xorigin += getSmallFontHeight(frc);
    im.yorigin = PADDING_TOP + im.ysize;
    if (graphTitle != null && !"".equals(graphTitle))
      im.yorigin += getLargeFontHeight(frc) + PADDING_TITLE;
    im.xgif = PADDING_RIGHT + im.xsize + im.xorigin;
    im.ygif = im.yorigin + (int) (PADDING_PLOT * getSmallFontHeight(frc));
    im.ygif += ((int) getSmallLeading(frc) + summaryLines) * (getLegendLines() + summaryLines);
    im.ygif += PADDING_BOTTOM;
    setDimension(im.ygif, im.xgif);
  }