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
14
votes
2 answers

Anchor a RecyclerView little higher on a Collapsing Toolbar Layout

Is it possible to anchor a RecyclerView a little bit higher than it's usual location, Like the FAB icon on most of the collapsible views (see Image 1 for the expected results). Image 1 I tried the following code but it doesn't give the expected…
14
votes
1 answer

How to have a collapsing of top view into a smaller sized view?

This question was asked before in a too broad and unclear way here, so I've made it much more specific, with full explanation and code of what I've tried. Background I'm required to mimic the way the Google Calendar has a view at the top, that can…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
14
votes
3 answers

Click not working on RecyclerView in CoordinatorLayout when scrolling

I am facing a strange behaviour with a RecyclerView as a second child of CoordinatorLayout, just after an AppBarLayout (as described in a lot of examples). My problem is when I scroll the recycler view and I want to click on a particular item.…
14
votes
5 answers

requestLayout() improperly called

I'm getting this warning spammed in my console. The only info I can find is most people get it when they have fast scroll enabled in a listview. I'm not using any listviews. It says its being improperly called by CollapsingToolbarLayout,…
14
votes
4 answers

Android: CollapsingToolbarLayout centers expanded text but not collapsed text

I have a CollapsingToolbarLayout that is defined to center both in collapsed and in expanded…
Jon
  • 7,941
  • 9
  • 53
  • 105
13
votes
5 answers

CollapsingToolbarLayout expand only when at the top

I have some problems with AppBarLayout and CollapsingToolbarLayout. This is what currently happens: https://www.youtube.com/watch?v=z4yD8rmjSjU The downwards scrolling motion is exactly what I want. However when I scroll up again, the orange bar…
13
votes
2 answers

Shared element transitions not working when combined with a CoordinatorLayout and CollapsingToolbarLayout

My application main screen contains a grid view of images. When the user selects an image, a detail activity is started using a shared element transition that animates the selected grid image to a paired image located in a CardView in the detail…
13
votes
1 answer

Collapsible Toolbar: Set how much the toolbar should be collapsed in onCreate

I'm creating a ListView and its corresponding DetailView application. My ListView has items which if clicked take the user to the DetailViewActivity. On the DetailViewActivity, I've implemented a Collapsible Toolbar. Now, every time the…
Rachit
  • 3,173
  • 3
  • 28
  • 45
13
votes
1 answer

How to add a gradient to a ImageView nested in a CollapsingToolbar

I'am working on an Android app with material design. I have a detail view with a CollapsingToolbarLayout and a ImageView (works fine so far). Unfortunately the title is not readable if there is a bright image. So far I tried to add a gradient (Add…
12
votes
2 answers

Android Compose - Use traditional View with ComposeView

I use Compose with existed fragment. My structure in xml
12
votes
4 answers

CollapsingToolbarLayout collapsed title has bad position

I have a straight forward CollapsingToolbarLayout. It works fine so far but if I collapse the toolbar the title's position isn't centered vertically. Here is my layout:
deadpoint
  • 433
  • 3
  • 17
12
votes
4 answers

android - RelativeLayout height to fill remaining space of CollapsingToolBarLayout

I have the following design where there is a CollapsingToolbarLayout on top and below there is a RelativeLayout: I want the RelativeLayout to fill the remaining space until bottom so I can center the content like this: I tried using match_parent…
12
votes
4 answers

When running on Nougat, why does the title gets cut off when using a CollapsingToolbarLayout?

I'm using the following layout and it works great on all versions except Android Nougat where the title gets cut off when fully collapsed.
user2881604
  • 2,330
  • 3
  • 21
  • 38
12
votes
3 answers

Disable vertical scroll in CollapsingToolbarLayout / AppBarLayout

I would like the vertical scroll on the CollapsingToolbarLayout / AppBarLayout ONLY when the scroll/touch event occurs in the nestedscrollview (this is working), but if the user tries to scroll the CollapsingToolbarLayout / AppBarLayout directly it…
nsL
  • 3,722
  • 3
  • 23
  • 40
12
votes
5 answers

CollapsingToolbarLayout Issue with GridView

CollapsingToolbarLayout only working with RecyclerView but not working with ListView and GridView. Below one is my XML file:
sushildlh
  • 8,986
  • 4
  • 33
  • 77