Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CollapsingToolbarLayout with multiline title

Is it possible to make CollapsingToolbarLayout's expanded title text wraps across several lines (similar to TextView.maxLines attribute)?

like image 332
Sokolov Avatar asked Jul 05 '15 19:07

Sokolov


People also ask

What is a Collapsing Toolbar?

Android CollapsingToolbarLayout is a wrapper for Toolbar which implements a collapsing app bar. It is designed to be used as a direct child of a AppBarLayout. This type of layout is commonly seen in the Profile Screen of the Whatsapp Application.

What is contentScrim in Android?

app:contentScrim: Specifies drawable or Color value when scrolled sufficiently off screen. app:layout_collapseMode: Specifies how child views of collapsing toolbar layout move when layout is moving. Parallax- moves in parallax fashion, Pin-view placed in fixed position.


1 Answers

I did this with help from this library

https://github.com/opacapp/multiline-collapsingtoolbar

add the library to your project and replace the CollapsingToolbarLayout with net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout

like image 89
Ilanthirayan Paramanathan Avatar answered Oct 11 '22 00:10

Ilanthirayan Paramanathan