Skip to content

Commit f64ce9e

Browse files
committed
[Internal] Fix letter spacing not updating correctly in CollapsingTextHelper
Resolves material-components#5014 Resolves material-components#5016
1 parent c7a3451 commit f64ce9e

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

lib/java/com/google/android/material/internal/CollapsingTextHelper.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -696,17 +696,6 @@ 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-
}
710699
}
711700

712701
setCollapsedTextBlend(
@@ -1098,7 +1087,11 @@ private void calculateUsingTextSize(final float fraction, boolean forceRecalcula
10981087
newTypeface = collapsedTypeface;
10991088
} else {
11001089
newTextSize = expandedTextSize;
1101-
newLetterSpacing = expandedLetterSpacing;
1090+
newLetterSpacing = lerp(
1091+
expandedLetterSpacing,
1092+
collapsedLetterSpacing,
1093+
fraction,
1094+
AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
11021095
newTypeface = expandedTypeface;
11031096
if (isClose(fraction, /* targetValue= */ 0)) {
11041097
// If we're close to the expanded text size, snap to it and use a scale of 1

0 commit comments

Comments
 (0)