Questions tagged [android-collapsingtoolbarlayout]

CollapsingToolbarLayout is a wrapper for Toolbar that provides several visual effects that are bind to the content scroll events.

CollapsingToolbarLayout is a ViewGroup that serves as a wrapper for Toolbar providing several visual effects to it. The class is part of the library.

The effects provided by the class include

  • Collapsing title
  • Content scrim
  • Status bar scrim
  • Parallax scrolling children
  • Pinned position children

For the correct behavior the CollapsingToolbarLayout has to be direct child of AppBarLayout placed within a CoordinatorLayout that contains a vertically scrollable View with app:layout_behavior parameter specified. The effects are bind to the vertical scrolling of this View.

For more information visit class reference or the Android developers blog.

1241 questions
185
votes
11 answers

Programmatically collapse or expand CollapsingToolbarLayout

Simple question, but I can't find an answer. How can I collapse or expand the CollapsingToolbarLayout programmatically? ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
Tomas
  • 4,652
  • 6
  • 31
  • 37
167
votes
16 answers

Show CollapsingToolbarLayout title only when collapsed

I've tried setExpandedTitleColor and setCollapsedTitleColor (switching to and from transparent) with no luck. I can't see any built in methods that'll do what I'm looking for, either. I only want to show the title when the CollapsingToolbarLayout…
Psest328
  • 6,575
  • 11
  • 55
  • 90
130
votes
12 answers

Android CollapsingToolbarLayout collapse Listener

I am using CollapsingToolBarLayout alongside with AppBarLayout and CoordinatorLayout, and they are working Fine altogether. I set my Toolbar to be fixed when I scroll up, I want to know if there is a way to change the title text of the Toolbar, when…
119
votes
4 answers

How to mimic Google Maps' bottom-sheet 3 phases behavior?

Background I'm assigned to make a UI that behaves similarly to how Google Maps shows a bottom-sheet for a found result. It has three different phases: Bottom content. The upper area is still touchable and won't scroll anything at the…
106
votes
2 answers

Overlap scrolling view with AppBarLayout

I want to implement the 'Flexible Space with overlapping content' pattern from the Material design scrolling techniques, such as in this video: My XML layout right now looks like:
95
votes
6 answers

CollapsingToolbarLayout doesn't recognize scroll fling

I have created a simple CollapsingToolbarLayout and it works like a charm. My problem is, that if I try to use a fling scroll on the nestedscrollview, it just stops when I release my finger. Normal scrolling works like it should. My activities code…
Xyz3R
  • 1,075
  • 1
  • 9
  • 12
92
votes
9 answers

How to change CollapsingToolbarLayout typeface and size?

I want to change CollapsingToolbarLayout font size and its typeface. How I can achieve that?
80
votes
1 answer

How to implement Custom Collapsable Toolbar in android?

Using this tutorial to implement a Flexible Space pattern (the one with the collapsing toolbar). I'm trying to achieve a similar effect as in the Lollipop Contacts activity, which at the beginning while entering the activity, views are only part of…
68
votes
6 answers

Android: CollapsingToolbarLayout and SwipeRefreshLayout get stuck

I use CollapsingToolbarLayout, RecyclerView and SwipeRefreshLayout together: Xml:
Tomas
  • 4,652
  • 6
  • 31
  • 37
66
votes
2 answers

create typeface from font resource id

I have tried using Typeface.createFromAsset(getAssets(),"font/myfont.ttf")); I know font directory should be in assets but in my case, I have an existing font resource directory so I thought asset manager will read from font resource directory but I…
65
votes
2 answers

How to disable scrolling of NestedScrollView&CollapsingToolbarLayout, for example when there is no more content below?

Background I try to add the same functionality as shown on many apps, where the upper area of the screen shrinks&expands according to the scrolled content. For this, I use Google's design library, as shown on the CheeseSquare sample. The…
54
votes
5 answers

Add app bar scrolling view behavior to multiple views in CoordinatorLayout

I am looking to add scroll support to more than just a single, scrollable, child view of CoordinatorLayout in conjunction with an AppBarLayout and CollapsingToolbarLayout. When scrolling the RecyclerView or the AppBarLayout (condensed code below),…
52
votes
6 answers

Android Material Design - How to change background color of Toolbar after CollapsingToolbarLayout is collapsed

After the user scrolls down the screen, the image in the CollapsingToolbarLayout disappears and is left with a toolbar with the back button, content title, and settings menu. I want to know how to change the background color of that toolbar only…
51
votes
4 answers

Android CollapsingToolbarLayout Title background

I'm working with the CollapsingToolbarLayout from the new Android Design Support Library. I have set its title and it is working fine, the only problem I still have is that when you scroll, the text is lost, depending on the image in the background.…
46
votes
5 answers

How can I determine that CollapsingToolbar is collapsed?

I need to know when CollapsingToolbar from material design library is collapsed.
1
2 3
82 83