Skip to content
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

[CollapsingToolbarLayout] Slight misalignment during transition in multiline mode #1052

Closed
johan12345 opened this issue Feb 23, 2020 · 3 comments
Labels

Comments

@johan12345
Copy link
Contributor

Description: This affects the multiline mode of the CollapsingToolbarLayout that was added as an experimental feature in 1.2.0-alpha05 (see also: #413). Upon closer inspection of the new implementation, I found that there is a slight misalignment in the positions of the expanded text and the overlays drawn during the transition, as seen in the screenshot below. Also, when the text snaps to the completely collapsed state, there is a slight upwards jump of the text position. Both of these problems can be seen in the catalog app and were not present in my original version in #413.

Screenshot_1582471001

Expected behavior: Smooth transition without misalignments. This worked correctly in our original PR:

Demo image

Source code: see catalog app -> Top App Bar -> Collapsing Demo (Multiline title)

Android API version: 28

Material Library version: 1.2.0-alpha05

Device: Android Emulator

I haven't found the source of the issue yet, but it should be possible to find when comparing my implementation in #413 with the one added by @ymarian in 83e4e47.

@catellie
Copy link

catellie commented Feb 29, 2020

Possibly intentional, but still odd IMHO:
I just tried this on an Activity which has three action buttons in the toolbar, and although it technically works as such, my three line title will never use the area underneath the three action buttons which looks a bit sub-optimal. If you compare with the original animation above it is clear that "displayed..." show shown beneath the overflow icon. As far as I can tell, in the current animation nothing is ever shown (or animated) beneath the action icons. For a single icon this is less than obvious, but with 3 it is fairly clear. IMHO the expanded state should use the full available width.
Screenshot_1582985651
Other than that it looks great!

brudaswen pushed a commit to brudaswen/material-components-android that referenced this issue Jun 16, 2020
…nment during transition in multiline mode
brudaswen pushed a commit to brudaswen/material-components-android that referenced this issue Jun 16, 2020
@brudaswen
Copy link

@johan12345 Thanks a lot for contributing the multi-line support! I also realized that the text is misaligned. This becomes even more prominent (to unusable) when the different between expanded and collapsed textSize is larger.

I created a PR, so let's hope it gets included, soon. Maybe you can also have a look to verify that I did not miss anything.

@johan12345
Copy link
Contributor Author

Yes, it works much better with that change in #1408. Thank you for figuring this out!

@ymarian ymarian closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants