{"action":"created","comment":{"url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/comments/38524122","id":38524122,"diff_hunk":"@@ -108,12 +113,12 @@ private Rect getDefaultHeaderOffset(RecyclerView recyclerView, View header, View\n       translationX = firstView.getLeft() + headerMargins.left;\n       translationY = Math.max(\n           firstView.getTop() - header.getHeight() - headerMargins.bottom,\n-          getListTop(recyclerView) + headerMargins.top);\n+          mSticky ? getListTop(recyclerView) + headerMargins.top : Integer.MIN_VALUE);","path":"library/src/main/java/com/timehop/stickyheadersrecyclerview/HeaderPositionCalculator.java","position":24,"original_position":24,"commit_id":"6b50d432cf378e706efc989f94f5c62bd879a64a","original_commit_id":"6b50d432cf378e706efc989f94f5c62bd879a64a","user":{"login":"markini","id":1747400,"avatar_url":"https://avatars.githubusercontent.com/u/1747400?v=3","gravatar_id":"","url":"https://api.github.com/users/markini","html_url":"https://github.com/markini","followers_url":"https://api.github.com/users/markini/followers","following_url":"https://api.github.com/users/markini/following{/other_user}","gists_url":"https://api.github.com/users/markini/gists{/gist_id}","starred_url":"https://api.github.com/users/markini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markini/subscriptions","organizations_url":"https://api.github.com/users/markini/orgs","repos_url":"https://api.github.com/users/markini/repos","events_url":"https://api.github.com/users/markini/events{/privacy}","received_events_url":"https://api.github.com/users/markini/received_events","type":"User","site_admin":false},"body":"Could of course be changed to something like this for readability:\r\n```java\r\ntranslationY = firstView.getTop() - header.getHeight() - headerMargins.bottom;\r\nif (mSticky) {\r\n  translationY = Math.max(translationY, getListTop(recyclerView) + headerMargins.top);\r\n}\r\n```","created_at":"2015-09-02T12:06:26Z","updated_at":"2015-09-02T12:06:26Z","html_url":"https://github.com/timehop/sticky-headers-recyclerview/pull/74#discussion_r38524122","pull_request_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/comments/38524122"},"html":{"href":"https://github.com/timehop/sticky-headers-recyclerview/pull/74#discussion_r38524122"},"pull_request":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74","id":43983426,"html_url":"https://github.com/timehop/sticky-headers-recyclerview/pull/74","diff_url":"https://github.com/timehop/sticky-headers-recyclerview/pull/74.diff","patch_url":"https://github.com/timehop/sticky-headers-recyclerview/pull/74.patch","issue_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/74","number":74,"state":"open","locked":false,"title":"Introduce a non sticky header switch","user":{"login":"markini","id":1747400,"avatar_url":"https://avatars.githubusercontent.com/u/1747400?v=3","gravatar_id":"","url":"https://api.github.com/users/markini","html_url":"https://github.com/markini","followers_url":"https://api.github.com/users/markini/followers","following_url":"https://api.github.com/users/markini/following{/other_user}","gists_url":"https://api.github.com/users/markini/gists{/gist_id}","starred_url":"https://api.github.com/users/markini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markini/subscriptions","organizations_url":"https://api.github.com/users/markini/orgs","repos_url":"https://api.github.com/users/markini/repos","events_url":"https://api.github.com/users/markini/events{/privacy}","received_events_url":"https://api.github.com/users/markini/received_events","type":"User","site_admin":false},"body":"This introduces the ability to change the header to a non sticky mode without breaking the api.\r\n\r\nTo be used like this:\r\n\r\n```java\r\n    final StickyRecyclerHeadersDecoration headersDecor = new StickyRecyclerHeadersDecoration(mAdapter);\r\n    headersDecor.setHeadersSticky(false);\r\n    recyclerView.addItemDecoration(headersDecor);\r\n```\r\n\r\nI would kinda like to introduce a builder pattern and make a creator for `StickyRecyclerHeadersDecoration.java`. This would however break the api.\r\n```java\r\nrecyclerView.addItemDecoration(StickyRecyclerHeadersDecoration.with(mAdapter)\r\n                                                              .setHeadersSticky(false);\r\n```","created_at":"2015-09-02T12:02:25Z","updated_at":"2015-09-02T12:06:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bde227aa694c4d539c2a01e8688291a3895582b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74/commits","review_comments_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74/comments","review_comment_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/74/comments","statuses_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/statuses/6b50d432cf378e706efc989f94f5c62bd879a64a","head":{"label":"markini:marki/non_sticky_switch","ref":"marki/non_sticky_switch","sha":"6b50d432cf378e706efc989f94f5c62bd879a64a","user":{"login":"markini","id":1747400,"avatar_url":"https://avatars.githubusercontent.com/u/1747400?v=3","gravatar_id":"","url":"https://api.github.com/users/markini","html_url":"https://github.com/markini","followers_url":"https://api.github.com/users/markini/followers","following_url":"https://api.github.com/users/markini/following{/other_user}","gists_url":"https://api.github.com/users/markini/gists{/gist_id}","starred_url":"https://api.github.com/users/markini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markini/subscriptions","organizations_url":"https://api.github.com/users/markini/orgs","repos_url":"https://api.github.com/users/markini/repos","events_url":"https://api.github.com/users/markini/events{/privacy}","received_events_url":"https://api.github.com/users/markini/received_events","type":"User","site_admin":false},"repo":{"id":41764303,"name":"sticky-headers-recyclerview","full_name":"markini/sticky-headers-recyclerview","owner":{"login":"markini","id":1747400,"avatar_url":"https://avatars.githubusercontent.com/u/1747400?v=3","gravatar_id":"","url":"https://api.github.com/users/markini","html_url":"https://github.com/markini","followers_url":"https://api.github.com/users/markini/followers","following_url":"https://api.github.com/users/markini/following{/other_user}","gists_url":"https://api.github.com/users/markini/gists{/gist_id}","starred_url":"https://api.github.com/users/markini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markini/subscriptions","organizations_url":"https://api.github.com/users/markini/orgs","repos_url":"https://api.github.com/users/markini/repos","events_url":"https://api.github.com/users/markini/events{/privacy}","received_events_url":"https://api.github.com/users/markini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markini/sticky-headers-recyclerview","description":"Sticky Headers decorator for Android's RecyclerView","fork":true,"url":"https://api.github.com/repos/markini/sticky-headers-recyclerview","forks_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/forks","keys_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/teams","hooks_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/hooks","issue_events_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/issues/events{/number}","events_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/events","assignees_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/assignees{/user}","branches_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/branches{/branch}","tags_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/tags","blobs_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/git/refs{/sha}","trees_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/statuses/{sha}","languages_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/languages","stargazers_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/stargazers","contributors_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/contributors","subscribers_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/subscribers","subscription_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/subscription","commits_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/commits{/sha}","git_commits_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/git/commits{/sha}","comments_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/comments{/number}","issue_comment_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/issues/comments{/number}","contents_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/contents/{+path}","compare_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/merges","archive_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/downloads","issues_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/issues{/number}","pulls_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/pulls{/number}","milestones_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/milestones{/number}","notifications_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/labels{/name}","releases_url":"https://api.github.com/repos/markini/sticky-headers-recyclerview/releases{/id}","created_at":"2015-09-01T21:27:13Z","updated_at":"2015-09-01T21:27:13Z","pushed_at":"2015-09-02T11:56:26Z","git_url":"git://github.com/markini/sticky-headers-recyclerview.git","ssh_url":"git@github.com:markini/sticky-headers-recyclerview.git","clone_url":"https://github.com/markini/sticky-headers-recyclerview.git","svn_url":"https://github.com/markini/sticky-headers-recyclerview","homepage":null,"size":1042,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"timehop:master","ref":"master","sha":"8da3abdd108130930c31537d9537cf503fc022aa","user":{"login":"timehop","id":1259053,"avatar_url":"https://avatars.githubusercontent.com/u/1259053?v=3","gravatar_id":"","url":"https://api.github.com/users/timehop","html_url":"https://github.com/timehop","followers_url":"https://api.github.com/users/timehop/followers","following_url":"https://api.github.com/users/timehop/following{/other_user}","gists_url":"https://api.github.com/users/timehop/gists{/gist_id}","starred_url":"https://api.github.com/users/timehop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timehop/subscriptions","organizations_url":"https://api.github.com/users/timehop/orgs","repos_url":"https://api.github.com/users/timehop/repos","events_url":"https://api.github.com/users/timehop/events{/privacy}","received_events_url":"https://api.github.com/users/timehop/received_events","type":"Organization","site_admin":false},"repo":{"id":24743779,"name":"sticky-headers-recyclerview","full_name":"timehop/sticky-headers-recyclerview","owner":{"login":"timehop","id":1259053,"avatar_url":"https://avatars.githubusercontent.com/u/1259053?v=3","gravatar_id":"","url":"https://api.github.com/users/timehop","html_url":"https://github.com/timehop","followers_url":"https://api.github.com/users/timehop/followers","following_url":"https://api.github.com/users/timehop/following{/other_user}","gists_url":"https://api.github.com/users/timehop/gists{/gist_id}","starred_url":"https://api.github.com/users/timehop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timehop/subscriptions","organizations_url":"https://api.github.com/users/timehop/orgs","repos_url":"https://api.github.com/users/timehop/repos","events_url":"https://api.github.com/users/timehop/events{/privacy}","received_events_url":"https://api.github.com/users/timehop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/timehop/sticky-headers-recyclerview","description":"Sticky Headers decorator for Android's RecyclerView","fork":false,"url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview","forks_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/forks","keys_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/teams","hooks_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/hooks","issue_events_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/events{/number}","events_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/events","assignees_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/assignees{/user}","branches_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/branches{/branch}","tags_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/tags","blobs_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/git/refs{/sha}","trees_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/statuses/{sha}","languages_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/languages","stargazers_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/stargazers","contributors_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/contributors","subscribers_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/subscribers","subscription_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/subscription","commits_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/commits{/sha}","git_commits_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/git/commits{/sha}","comments_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/comments{/number}","issue_comment_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/comments{/number}","contents_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/contents/{+path}","compare_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/merges","archive_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/downloads","issues_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues{/number}","pulls_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls{/number}","milestones_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/milestones{/number}","notifications_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/labels{/name}","releases_url":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/releases{/id}","created_at":"2014-10-03T01:57:46Z","updated_at":"2015-09-02T06:27:04Z","pushed_at":"2015-09-02T12:02:25Z","git_url":"git://github.com/timehop/sticky-headers-recyclerview.git","ssh_url":"git@github.com:timehop/sticky-headers-recyclerview.git","clone_url":"https://github.com/timehop/sticky-headers-recyclerview.git","svn_url":"https://github.com/timehop/sticky-headers-recyclerview","homepage":null,"size":1042,"stargazers_count":730,"watchers_count":730,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":147,"mirror_url":null,"open_issues_count":19,"forks":147,"open_issues":19,"watchers":730,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74"},"html":{"href":"https://github.com/timehop/sticky-headers-recyclerview/pull/74"},"issue":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/74"},"comments":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/timehop/sticky-headers-recyclerview/statuses/6b50d432cf378e706efc989f94f5c62bd879a64a"}}}}