{"action":"created","issue":{"url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/97","repository_url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView","labels_url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/97/comments","events_url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/97/events","html_url":"https://github.com/ksoichiro/Android-ObservableScrollView/issues/97","id":65259798,"number":97,"title":"Fading toolbar with image and RecyclerView not working","user":{"login":"buneme","id":3949246,"avatar_url":"https://avatars.githubusercontent.com/u/3949246?v=3","gravatar_id":"","url":"https://api.github.com/users/buneme","html_url":"https://github.com/buneme","followers_url":"https://api.github.com/users/buneme/followers","following_url":"https://api.github.com/users/buneme/following{/other_user}","gists_url":"https://api.github.com/users/buneme/gists{/gist_id}","starred_url":"https://api.github.com/users/buneme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buneme/subscriptions","organizations_url":"https://api.github.com/users/buneme/orgs","repos_url":"https://api.github.com/users/buneme/repos","events_url":"https://api.github.com/users/buneme/events{/privacy}","received_events_url":"https://api.github.com/users/buneme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-30T17:23:31Z","updated_at":"2016-02-27T22:53:28Z","closed_at":null,"body":"I'm using code from [this Gist][1] and [this is what I am trying to achieve][2] (a fading ToolBar). However, when I start up my app I get the following error:\r\n\r\n`    java.lang.NullPointerException: Attempt to write to field 'int android.view.ViewGroup$LayoutParams.height' on a null object reference\r\n`\r\n\r\nThis is referring to the following line of code which is also on line 54 of [this][3], as well as here:\r\n\r\n    headerView.getLayoutParams().height = mFlexibleSpaceImageHeight;\r\nWhen 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:\r\n\r\n - [XML Activity Layout file][4]\r\n - [Activity][5]\r\n - [Base Activity][6]\r\n - [dimens.xml][7]\r\n - [recycler_header.xml][8]\r\n - [padding.xml][9]\r\n\r\nHere's the problematic scrolling effect:\r\n![enter image description here][10] ![enter image description here][11]\r\nThe 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.\r\n\r\n\r\n  [1]: https://github.com/ksoichiro/Android-ObservableScrollView\r\n  [2]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/images/demo10.gif\r\n  [3]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageRecyclerViewActivity.java\r\n  [4]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/res/layout/activity_flexiblespacewithimagerecyclerview.xml\r\n  [5]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageRecyclerViewActivity.java\r\n  [6]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/BaseActivity.java\r\n  [7]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/res/values/dimens.xml\r\n  [8]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/res/layout/recycler_header.xml\r\n  [9]: https://github.com/ksoichiro/Android-ObservableScrollView/blob/master/samples/res/layout/padding.xml\r\n  [10]: http://i.stack.imgur.com/lS9fv.png\r\n  [11]: http://i.stack.imgur.com/ASi8n.png"},"comment":{"url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/comments/189743781","html_url":"https://github.com/ksoichiro/Android-ObservableScrollView/issues/97#issuecomment-189743781","issue_url":"https://api.github.com/repos/ksoichiro/Android-ObservableScrollView/issues/97","id":189743781,"user":{"login":"TheGreenBastard","id":16344836,"avatar_url":"https://avatars.githubusercontent.com/u/16344836?v=3","gravatar_id":"","url":"https://api.github.com/users/TheGreenBastard","html_url":"https://github.com/TheGreenBastard","followers_url":"https://api.github.com/users/TheGreenBastard/followers","following_url":"https://api.github.com/users/TheGreenBastard/following{/other_user}","gists_url":"https://api.github.com/users/TheGreenBastard/gists{/gist_id}","starred_url":"https://api.github.com/users/TheGreenBastard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheGreenBastard/subscriptions","organizations_url":"https://api.github.com/users/TheGreenBastard/orgs","repos_url":"https://api.github.com/users/TheGreenBastard/repos","events_url":"https://api.github.com/users/TheGreenBastard/events{/privacy}","received_events_url":"https://api.github.com/users/TheGreenBastard/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T22:53:28Z","updated_at":"2016-02-27T22:53:28Z","body":"Im having the same issue... anyone have a solution?"}}