The setTitle()
method from CollapsingToolbarLayout
had some bugs already (like showing only after a scroll, fixed in v22.2.1
).
Today I updated to v23.0.0
, and it is simply not working, like no title is shown. By calling it multiple times with a delay, I can see that sometimes the title is there, but it is really not reliable (like, you switch to another fragment, then back to the first, and there's no title anymore).
I found there's a new attribute, app:titleEnabled
or CollapsingToolbarLayout.setTitleEnabled(boolean)
. I have set both to true, but it doesn't change anything actually.
Is any of you experiencing the same behavior?
I wonder how many apps out there in the market are really using this Design Library, it has been full of bugs from the very first release and is not getting better.
Edit
With further testing, it seems (I'm not 100% sure) it is connected to the new AppBarLayout.setExpanded()
api.
If I call:
collapsingToolbar.setTitle("title");
it works, but if I call
collapsingToolbar.setTitle("title");
appbarLayout.setExpanded(true, true);
//OR
appbarLayout.setExpanded(true, true);
collapsingToolbar.setTitle("title");
it doesn't - no title shown. Same with setExpanded(false, true)
, i. e. trying to collapse the toolbar.
Edit2 (sep 2015)
Well, no. The issue is present even when I never call abl.setExpanded()
or app:expanded
. Also, we're on v23.0.1 now and this still has not been fixed. Looks like only a few of us are experiencing it, because I couldn't find anything here nor in the official bug list. I filed a bug here.