{"action":"created","issue":{"url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/4","repository_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax","labels_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/4/comments","events_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/4/events","html_url":"https://github.com/TheOriginalJosh/nativescript-parallax/issues/4","id":148246092,"number":4,"title":"Enhancement: Calculate the statusbar height to anchor correctly","user":{"login":"bradmartin","id":6006148,"avatar_url":"https://avatars.githubusercontent.com/u/6006148?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmartin","html_url":"https://github.com/bradmartin","followers_url":"https://api.github.com/users/bradmartin/followers","following_url":"https://api.github.com/users/bradmartin/following{/other_user}","gists_url":"https://api.github.com/users/bradmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmartin/subscriptions","organizations_url":"https://api.github.com/users/bradmartin/orgs","repos_url":"https://api.github.com/users/bradmartin/repos","events_url":"https://api.github.com/users/bradmartin/events{/privacy}","received_events_url":"https://api.github.com/users/bradmartin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-14T04:02:24Z","updated_at":"2016-04-14T04:05:08Z","closed_at":null,"body":"Here is a function that should be reliable enough to return the android status bar height, which might need to be taken into consideration for setting the top of the anchor position on pre-lollipop devices.\r\n\r\n```JS\r\n function statHeight(args) {\r\n    var result = 0;\r\n    var resourceId = utils.ad.getApplicationContext().getResources().getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\r\n    if (resourceId > 0) {\r\n        result = utils.ad.getApplicationContext().getResources().getDimensionPixelSize(resourceId);\r\n    }\r\n    console.log(result);\r\n    return result;\r\n}\r\nexports.statHeight = statHeight;\r\n```\r\n\r\nThis is the current demo screen (not same background image 😉 ) but notice the gap between statusbar and the **Anchor** \r\n![snip20160413_2](https://cloud.githubusercontent.com/assets/6006148/14516725/9b7eb418-01cb-11e6-8494-62a3a1296afe.png)\r\n\r\nIf I add a button in the **Content** you'll see the **Anchor** covers the gap.\r\n\r\n![snip20160413_4](https://cloud.githubusercontent.com/assets/6006148/14516742/b3c6399c-01cb-11e6-9c3d-839d08812fba.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/comments/209751772","html_url":"https://github.com/TheOriginalJosh/nativescript-parallax/issues/4#issuecomment-209751772","issue_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-parallax/issues/4","id":209751772,"user":{"login":"bradmartin","id":6006148,"avatar_url":"https://avatars.githubusercontent.com/u/6006148?v=3","gravatar_id":"","url":"https://api.github.com/users/bradmartin","html_url":"https://github.com/bradmartin","followers_url":"https://api.github.com/users/bradmartin/followers","following_url":"https://api.github.com/users/bradmartin/following{/other_user}","gists_url":"https://api.github.com/users/bradmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/bradmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradmartin/subscriptions","organizations_url":"https://api.github.com/users/bradmartin/orgs","repos_url":"https://api.github.com/users/bradmartin/repos","events_url":"https://api.github.com/users/bradmartin/events{/privacy}","received_events_url":"https://api.github.com/users/bradmartin/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T04:05:08Z","updated_at":"2016-04-14T04:05:08Z","body":"Not entirely sure how the anchor is being set, no time to dig into the code. So take this as a possible improvement to cover some various cases. It might be solved by simply specifying the parallax image be a specific height at minimum."}}