Loading core/java/android/widget/SmartSelectSprite.java +4 −31 Original line number Diff line number Diff line Loading @@ -50,11 +50,9 @@ import java.util.Objects; */ final class SmartSelectSprite { private static final int EXPAND_DURATION = 300; private static final int CORNER_DURATION = 50; private static final int EXPAND_DURATION = 200; private final Interpolator mExpandInterpolator; private final Interpolator mCornerInterpolator; private Animator mActiveAnimator = null; private final Runnable mInvalidator; Loading Loading @@ -337,9 +335,6 @@ final class SmartSelectSprite { mExpandInterpolator = AnimationUtils.loadInterpolator( context, android.R.interpolator.fast_out_slow_in); mCornerInterpolator = AnimationUtils.loadInterpolator( context, android.R.interpolator.fast_out_linear_in); mFillColor = highlightColor; mInvalidator = Objects.requireNonNull(invalidator); } Loading Loading @@ -372,7 +367,6 @@ final class SmartSelectSprite { final int rectangleCount = destinationRectangles.size(); final List<RoundedRectangleShape> shapes = new ArrayList<>(rectangleCount); final List<Animator> cornerAnimators = new ArrayList<>(rectangleCount); RectangleWithTextSelectionLayout centerRectangle = null; Loading Loading @@ -405,7 +399,6 @@ final class SmartSelectSprite { expansionDirections[index], rectangleWithTextSelectionLayout.getTextSelectionLayout() == Layout.TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT); cornerAnimators.add(createCornerAnimator(shape, updateListener)); shapes.add(shape); } Loading @@ -420,7 +413,7 @@ final class SmartSelectSprite { mExistingDrawable = shapeDrawable; mActiveAnimator = createAnimator(rectangleList, startingOffset, startingOffset, cornerAnimators, updateListener, onAnimationEnd); updateListener, onAnimationEnd); mActiveAnimator.start(); } Loading @@ -433,7 +426,6 @@ final class SmartSelectSprite { final RectangleList rectangleList, final float startingOffsetLeft, final float startingOffsetRight, final List<Animator> cornerAnimators, final ValueAnimator.AnimatorUpdateListener updateListener, final Runnable onAnimationEnd) { final ObjectAnimator rightBoundaryAnimator = ObjectAnimator.ofFloat( Loading @@ -457,18 +449,12 @@ final class SmartSelectSprite { rightBoundaryAnimator.setInterpolator(mExpandInterpolator); leftBoundaryAnimator.setInterpolator(mExpandInterpolator); final AnimatorSet cornerAnimator = new AnimatorSet(); cornerAnimator.playTogether(cornerAnimators); final AnimatorSet boundaryAnimator = new AnimatorSet(); boundaryAnimator.playTogether(leftBoundaryAnimator, rightBoundaryAnimator); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playSequentially(boundaryAnimator, cornerAnimator); setUpAnimatorListener(animatorSet, onAnimationEnd); setUpAnimatorListener(boundaryAnimator, onAnimationEnd); return animatorSet; return boundaryAnimator; } private void setUpAnimatorListener(final Animator animator, final Runnable onAnimationEnd) { Loading @@ -495,19 +481,6 @@ final class SmartSelectSprite { }); } private ObjectAnimator createCornerAnimator( final RoundedRectangleShape shape, final ValueAnimator.AnimatorUpdateListener listener) { final ObjectAnimator animator = ObjectAnimator.ofFloat( shape, RoundedRectangleShape.PROPERTY_ROUND_RATIO, shape.getRoundRatio(), 0.0F); animator.setDuration(CORNER_DURATION); animator.addUpdateListener(listener); animator.setInterpolator(mCornerInterpolator); return animator; } private static @RoundedRectangleShape.ExpansionDirection int[] generateDirections( final RectangleWithTextSelectionLayout centerRectangle, final List<RectangleWithTextSelectionLayout> rectangles) { Loading Loading
core/java/android/widget/SmartSelectSprite.java +4 −31 Original line number Diff line number Diff line Loading @@ -50,11 +50,9 @@ import java.util.Objects; */ final class SmartSelectSprite { private static final int EXPAND_DURATION = 300; private static final int CORNER_DURATION = 50; private static final int EXPAND_DURATION = 200; private final Interpolator mExpandInterpolator; private final Interpolator mCornerInterpolator; private Animator mActiveAnimator = null; private final Runnable mInvalidator; Loading Loading @@ -337,9 +335,6 @@ final class SmartSelectSprite { mExpandInterpolator = AnimationUtils.loadInterpolator( context, android.R.interpolator.fast_out_slow_in); mCornerInterpolator = AnimationUtils.loadInterpolator( context, android.R.interpolator.fast_out_linear_in); mFillColor = highlightColor; mInvalidator = Objects.requireNonNull(invalidator); } Loading Loading @@ -372,7 +367,6 @@ final class SmartSelectSprite { final int rectangleCount = destinationRectangles.size(); final List<RoundedRectangleShape> shapes = new ArrayList<>(rectangleCount); final List<Animator> cornerAnimators = new ArrayList<>(rectangleCount); RectangleWithTextSelectionLayout centerRectangle = null; Loading Loading @@ -405,7 +399,6 @@ final class SmartSelectSprite { expansionDirections[index], rectangleWithTextSelectionLayout.getTextSelectionLayout() == Layout.TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT); cornerAnimators.add(createCornerAnimator(shape, updateListener)); shapes.add(shape); } Loading @@ -420,7 +413,7 @@ final class SmartSelectSprite { mExistingDrawable = shapeDrawable; mActiveAnimator = createAnimator(rectangleList, startingOffset, startingOffset, cornerAnimators, updateListener, onAnimationEnd); updateListener, onAnimationEnd); mActiveAnimator.start(); } Loading @@ -433,7 +426,6 @@ final class SmartSelectSprite { final RectangleList rectangleList, final float startingOffsetLeft, final float startingOffsetRight, final List<Animator> cornerAnimators, final ValueAnimator.AnimatorUpdateListener updateListener, final Runnable onAnimationEnd) { final ObjectAnimator rightBoundaryAnimator = ObjectAnimator.ofFloat( Loading @@ -457,18 +449,12 @@ final class SmartSelectSprite { rightBoundaryAnimator.setInterpolator(mExpandInterpolator); leftBoundaryAnimator.setInterpolator(mExpandInterpolator); final AnimatorSet cornerAnimator = new AnimatorSet(); cornerAnimator.playTogether(cornerAnimators); final AnimatorSet boundaryAnimator = new AnimatorSet(); boundaryAnimator.playTogether(leftBoundaryAnimator, rightBoundaryAnimator); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.playSequentially(boundaryAnimator, cornerAnimator); setUpAnimatorListener(animatorSet, onAnimationEnd); setUpAnimatorListener(boundaryAnimator, onAnimationEnd); return animatorSet; return boundaryAnimator; } private void setUpAnimatorListener(final Animator animator, final Runnable onAnimationEnd) { Loading @@ -495,19 +481,6 @@ final class SmartSelectSprite { }); } private ObjectAnimator createCornerAnimator( final RoundedRectangleShape shape, final ValueAnimator.AnimatorUpdateListener listener) { final ObjectAnimator animator = ObjectAnimator.ofFloat( shape, RoundedRectangleShape.PROPERTY_ROUND_RATIO, shape.getRoundRatio(), 0.0F); animator.setDuration(CORNER_DURATION); animator.addUpdateListener(listener); animator.setInterpolator(mCornerInterpolator); return animator; } private static @RoundedRectangleShape.ExpansionDirection int[] generateDirections( final RectangleWithTextSelectionLayout centerRectangle, final List<RectangleWithTextSelectionLayout> rectangles) { Loading