transition/src/main/java/com/google/android/material/transition/MaskEvaluator.java
/** Update the mask used by this evaluator based on a given progress. */
Update the mask used by this evaluator based on a given progress.
Update the mask used by this evaluator based on a given progress .
@SuppressLint("RestrictedApi")
  void evaluate(
      float progress,
      ShapeAppearanceModel startShapeAppearanceModel,
      ShapeAppearanceModel endShapeAppearanceModel,
      RectF currentStartBounds,
      RectF currentStartBoundsMasked,
      RectF currentEndBoundsMasked,
      ProgressThresholds shapeMaskThresholds) {
    float shapeStartFraction = checkNotNull(shapeMaskThresholds.start);
    float shapeEndFraction = checkNotNull(shapeMaskThresholds.end);
    ShapeAppearanceModel currentShapeAppearanceModel =
        lerp(
            startShapeAppearanceModel,
            endShapeAppearanceModel,
            currentStartBounds,
            currentEndBoundsMasked,
            shapeStartFraction,
            shapeEndFraction,
            progress);
    pathProvider.calculatePath(currentShapeAppearanceModel, 1, currentStartBoundsMasked, startPath);
    pathProvider.calculatePath(currentShapeAppearanceModel, 1, currentEndBoundsMasked, endPath);
    if (VERSION.SDK_INT >= VERSION_CODES.M) {
      path.op(startPath, endPath, Op.UNION);
    }
  }
@ SuppressLint ( "RestrictedApi" ) void evaluate ( float progress , ShapeAppearanceModel startShapeAppearanceModel , ShapeAppearanceModel endShapeAppearanceModel , RectF currentStartBounds , RectF currentStartBoundsMasked , RectF currentEndBoundsMasked , ProgressThresholds shapeMaskThresholds ) { float shapeStartFraction = checkNotNull ( shapeMaskThresholds . start ) ; float shapeEndFraction = checkNotNull ( shapeMaskThresholds . end ) ; ShapeAppearanceModel currentShapeAppearanceModel = lerp ( startShapeAppearanceModel , endShapeAppearanceModel , currentStartBounds , currentEndBoundsMasked , shapeStartFraction , shapeEndFraction , progress ) ; pathProvider . calculatePath ( currentShapeAppearanceModel , 1 , currentStartBoundsMasked , startPath ) ; pathProvider . calculatePath ( currentShapeAppearanceModel , 1 , currentEndBoundsMasked , endPath ) ; if ( VERSION . SDK_INT >= VERSION_CODES . M ) { path . op ( startPath , endPath , Op . UNION ) ; } }
Update the mask used by this evaluator based on a given progress.
Update the mask used by this evaluator based on a given progress .
// Animate shape appearance corner changes over range of `progress` & use this when // drawing the container background & images // Union the two paths on API 23 and above. API 21 and 22 have problems with this // call and instead use the start and end paths to clip.