[Internal] Make letter spacing dependent on text size in CollapsingTextHelper#4640
Conversation
|
Hey Hunter, will you able to review this PR? |
587f81f to
9fae0ca
Compare
9fae0ca to
6b05f8a
Compare
| if (collapsedLetterSpacing != expandedLetterSpacing) { | ||
| textPaint.setLetterSpacing( | ||
| lerp( | ||
| expandedLetterSpacing, | ||
| collapsedLetterSpacing, | ||
| fraction, | ||
| AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR)); | ||
| } else { | ||
| textPaint.setLetterSpacing(collapsedLetterSpacing); | ||
| } | ||
|
|
There was a problem hiding this comment.
Instead of removing this block, could it be moved into the else statement of if (fadeModeEnabled)?
if (fadeModeEnabled) {
...
} else {
lerp letter spacing
}
| newLetterSpacing = lerp( | ||
| expandedLetterSpacing, collapsedLetterSpacing, | ||
| 1f, collapsedTextSize / expandedTextSize, | ||
| scale); | ||
|
|
There was a problem hiding this comment.
No longer needed if letter spacing lerping is replaced inside calculateOffsets
|
Hey @pubiqq! I checked this PR internally and it is causes some breakages with TextInputLayout's hint. With this change, when the hint text is collapsed on focus, the hint's letter spacing is smaller than it was previously. I added some comments suggesting an alternative approach. Let me know what you think. |
|
Hey @pubiqq. I went ahead and made the changes suggested in tis PR's comments internally. The change should be synced out soon and will close this PR. |
Also fixes #4639.