-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Internal] Make letter spacing dependent on text size in CollapsingTextHelper #4640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[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
|
Ping |
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Also fixes #4639.