@@ -696,6 +696,17 @@ private void calculateOffsets(final float fraction) {
696696 currentDrawY = lerp (expandedDrawY , collapsedDrawY , fraction , positionInterpolator );
697697
698698 setInterpolatedTextSize (fraction );
699+
700+ if (collapsedLetterSpacing != expandedLetterSpacing ) {
701+ textPaint .setLetterSpacing (
702+ lerp (
703+ expandedLetterSpacing ,
704+ collapsedLetterSpacing ,
705+ fraction ,
706+ AnimationUtils .FAST_OUT_SLOW_IN_INTERPOLATOR ));
707+ } else {
708+ textPaint .setLetterSpacing (collapsedLetterSpacing );
709+ }
699710 }
700711
701712 setCollapsedTextBlend (
@@ -712,17 +723,6 @@ private void calculateOffsets(final float fraction) {
712723 textPaint .setColor (getCurrentCollapsedTextColor ());
713724 }
714725
715- if (collapsedLetterSpacing != expandedLetterSpacing ) {
716- textPaint .setLetterSpacing (
717- lerp (
718- expandedLetterSpacing ,
719- collapsedLetterSpacing ,
720- fraction ,
721- AnimationUtils .FAST_OUT_SLOW_IN_INTERPOLATOR ));
722- } else {
723- textPaint .setLetterSpacing (collapsedLetterSpacing );
724- }
725-
726726 // Calculates paint parameters for shadow layer.
727727 currentShadowRadius = lerp (expandedShadowRadius , collapsedShadowRadius , fraction , null );
728728 currentShadowDx = lerp (expandedShadowDx , collapsedShadowDx , fraction , null );
@@ -1320,11 +1320,11 @@ public void setStaticLayoutBuilderConfigurer(
13201320 }
13211321
13221322 /**
1323- * Returns true if {@code value } is 'close' to it's closest decimal value . Close is currently
1323+ * Returns true if {@code value1 } is 'close' to {@code value2} . Close is currently
13241324 * defined as it's difference being < 0.00001.
13251325 */
1326- private static boolean isClose (float value , float targetValue ) {
1327- return Math .abs (value - targetValue ) < 0.00001f ;
1326+ private static boolean isClose (float value1 , float value2 ) {
1327+ return Math .abs (value1 - value2 ) < 0.00001f ;
13281328 }
13291329
13301330 public ColorStateList getExpandedTextColor () {
0 commit comments