Android-ObservableScrollView
Android-ObservableScrollView copied to clipboard
Fading toolbar with image and RecyclerView not working
I'm using code from this Gist and this is what I am trying to achieve (a fading ToolBar). However, when I start up my app I get the following error:
java.lang.NullPointerException: Attempt to write to field 'int android.view.ViewGroup$LayoutParams.height' on a null object reference
This is referring to the following line of code which is also on line 54 of this, as well as here:
headerView.getLayoutParams().height = mFlexibleSpaceImageHeight;
When I comment out that line of code, the error stops appearing, but I don't get the fading effect I want; instead, the RecyclerView appears above the toolbar. The code I used is exactly the same (I've triple checked) as the following:
Here's the problematic scrolling effect:
The image behind the list is inside of the toolbar; that image, along with the toolbar should be in front of the list. The green bar in the other picture where I have scrolled further down the list is the toolbar - as you can see, the intended effect is not being achieved.
Im having the same issue... anyone have a solution?