hanggrian / collapsingtoolbarlayout-subtitle

Standard CollapsingToolbarLayout with subtitle support
http://hanggrian.com/collapsingtoolbarlayout-subtitle/
Apache License 2.0
289 stars 52 forks source link

Multiline title #14

Closed Greg222777 closed 2 years ago

Greg222777 commented 7 years ago

Hello,

I really love this library but a multilines title feature would make it perfect.

The title length is very limited on small devices, with the default text size it can only be 11 characters long on a 3.7" Nexus One, so the rest of the String is replaced by "..." for both collapsed and regular mode. I'd like a multilines mode for regular mode, that goes back to single line for collapsed mode.

There are libs for multilines collapsing toolbar titles (https://github.com/opacapp/multiline-collapsingtoolbar) but can't use both at the same time, there is not much change made to the vanilla CollapsingToolbarLayout, but I guess it would change the way your animations work.

Do you have a solution for this? Thanks!

hanggrian commented 7 years ago

Although it might sound like a good idea, I'm not so sure if such feature still comply with material design guideline. I'll keep this issue open for a while for future reconsideration and others' input.

ArcherEmiya05 commented 4 years ago

Although it might sound like a good idea, I'm not so sure if such feature still comply with material design guideline. I'll keep this issue open for a while for future reconsideration and others' input.

Yes it is definitely the recommended way.

Don’t truncate text, hiding the full title may cause misunderstanding.

https://material.io/components/app-bars-top/#anatomy

adhirajsinghchauhan commented 4 years ago

Bump. No progress yet? @hendraanggrian if you need help in developing, let us know. We'll open up a PR

hanggrian commented 4 years ago

Thanks for checking out this library, I am so sorry for late reply. A multiline subtitle is definitely not in the realm of impossibility here.

In fact, I bet it looks nice while the toolbar is expanded. But as you swipe to collapse, those lines of text will have to be flattened to one line. The problem is: the animation needed to achieve such behavior will be extremely different than the animation we use to collapse the title. It sounds unacceptable to me on design perspective.

But still, I'm open for some changes. If you can show how would you do it correctly (even some illustrations will do, or pull requests are even better), then the discussion would progress.

hanggrian commented 2 years ago

Since version 1.2.0, multiline title is supported by CollapsingToolbarLayout, and therefore SubtitleCollapsingToolbarLayout too.