Recently I had some fun with CollapsingToolbarLayout, and I learned a few tricks that I would love to share. When using this piece of magic it is very easy to implement material behaviour, your App looks amazing with very little effort. However you might find that you want something slightly different sometimes, and find yourself stuck googling for a solution, or digging into the code.
This happened to me because I wanted to be able to lock the CollapsingToolbarLayout, meaning that I wanted to prevent the user from expanding and collapsing the toolbar by dragging his finger. However I still needed the collapsing behaviour to work programmatically. Took me longer than expected to figure this out, however the solution turned out to be pretty easy, this is the result (more…)