-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Feature request - CollapsingToolbarLayout: Allow multiple lines of text in expanded state #6
Comments
What’s the current status on this one? The Material guidelines state that multiple lines should be used and that the code for Android was readily available, however it doesn’t feature this option. |
We are still struggling to update our multiline-collapsingtoolbar library to support Android 9 and the new Material Components and AndroidX libraries, because the |
guys, any plan to add such support in material components library? |
Added this as a feature request on https://issuetracker.google.com/issues/136120586 |
It seems they can accept PRs. https://issuetracker.google.com/issues/136120586 @johan12345 It'd be awesome if this makes part of material.components ! |
Yep, we saw this already, one of the comments came from @raphaelm. I will try to implement this as a PR. |
Brilliant. I can lend a hand if needed. |
see #413 |
So is this feature already available in |
@ArcherEmiya05 Not as far as I can see - the last change to CollapsingToolbarLayout in the library was 5 months ago. See the PR #413 for the latest updates. |
So there is no way to do this without needing to create your own xml layout? |
There is, you can use our fork of the Material Components library until it's merged. But it might cause incompatibilities with other libraries that depend on the Material Components library and we will provide no support.
Well, I'm not from Google, so I can't really answer that. The Material Components library doesn't have implementations for all the things that show up in the guidelines, but I guess something needs to be added to the guidelines first before an implementation can be included. |
Overview
CollapsingToolbarLayout
currently only allows for a single line title. However, in the expanded state, there would be enough space to display multiple lines.Multiple app developers (such as WhatsApp) have already built their own custom views as a replacement for
CollapsingToolbarLayout
to solve this issue. However, these are mostly closed-source, use different, inconsistent animations when expanding and collapsing, and/or are not usable as a drop-in replacement forCollapsingToolbarLayout
because they have a different API.We (@raphaelm and I, with help from some contributors) have built an open-source library that tries to solve this problem. It is based directly on the original
CollapsingToolbarLayout
/CollapsingTextHelper
classes from the Design Support Library with only a few code changes and an additionalmaxLines
attribute. In addition to that, we feel that the animation we use is more smooth than the one from e.g. WhatsApp.However, we had to copy quite a lot of files (basically all the classes that are referenced from
CollapsingToolbarLayout
) from the original support library when creating this library because they are package-private and therefore not accessible from our classes or because we needed access to private fields, which is not possible when extending a class. For this reason, it is quite tedious to keep our library up-to-date with changes from the support library.Would you be interested in adopting our changes into the original library, e.g through a pull request? Or are you already working on the same feature?
There are some bugs in our library that occur when using text shadows or transparent text that we have not worked on ourselves because we don't use those features in our app, but they should be quite straightforward to resolve.
Related issues
The text was updated successfully, but these errors were encountered: