{"action":"created","comment":{"url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/comments/52407626","id":52407626,"diff_hunk":"@@ -59,10 +59,26 @@\n   }\n \n   /**\n+   * If you don't need header feature, you can bypass overriding this method.\n+   */\n+  protected VH onCreateHeaderViewHolder(ViewGroup parent, int viewType) {\n+    return null;\n+  }\n+\n+  protected abstract VH onCreateItemViewHolder(ViewGroup parent, int viewType);\n+\n+  /**\n+   * If you don't need footer feature, you can bypass overriding this method.\n+   */\n+  protected VH onCreateFooterViewHolder(ViewGroup parent, int viewType) {\n+    return null;\n+  }\n+\n+  /**","path":"library/src/main/java/com/karumi/headerrecyclerview/HeaderRecyclerViewAdapter.java","position":28,"original_position":28,"commit_id":"df5402ef9d919e21671b5ab9a10968d67a559b63","original_commit_id":"df5402ef9d919e21671b5ab9a10968d67a559b63","user":{"login":"cmicat","id":13158883,"avatar_url":"https://avatars.githubusercontent.com/u/13158883?v=3","gravatar_id":"","url":"https://api.github.com/users/cmicat","html_url":"https://github.com/cmicat","followers_url":"https://api.github.com/users/cmicat/followers","following_url":"https://api.github.com/users/cmicat/following{/other_user}","gists_url":"https://api.github.com/users/cmicat/gists{/gist_id}","starred_url":"https://api.github.com/users/cmicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmicat/subscriptions","organizations_url":"https://api.github.com/users/cmicat/orgs","repos_url":"https://api.github.com/users/cmicat/repos","events_url":"https://api.github.com/users/cmicat/events{/privacy}","received_events_url":"https://api.github.com/users/cmicat/received_events","type":"User","site_admin":false},"body":"Header and footer are optional, so don't use `abstract` modifier to force user to override `onCreateHeaderViewHolder` and `onCreateFooterViewHolder`","created_at":"2016-02-10T02:23:10Z","updated_at":"2016-02-10T02:23:10Z","html_url":"https://github.com/Karumi/HeaderRecyclerView/pull/15#discussion_r52407626","pull_request_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/comments/52407626"},"html":{"href":"https://github.com/Karumi/HeaderRecyclerView/pull/15#discussion_r52407626"},"pull_request":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15","id":58004691,"html_url":"https://github.com/Karumi/HeaderRecyclerView/pull/15","diff_url":"https://github.com/Karumi/HeaderRecyclerView/pull/15.diff","patch_url":"https://github.com/Karumi/HeaderRecyclerView/pull/15.patch","issue_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/15","number":15,"state":"open","locked":false,"title":"Seperate view life cycle method","user":{"login":"cmicat","id":13158883,"avatar_url":"https://avatars.githubusercontent.com/u/13158883?v=3","gravatar_id":"","url":"https://api.github.com/users/cmicat","html_url":"https://github.com/cmicat","followers_url":"https://api.github.com/users/cmicat/followers","following_url":"https://api.github.com/users/cmicat/following{/other_user}","gists_url":"https://api.github.com/users/cmicat/gists{/gist_id}","starred_url":"https://api.github.com/users/cmicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmicat/subscriptions","organizations_url":"https://api.github.com/users/cmicat/orgs","repos_url":"https://api.github.com/users/cmicat/repos","events_url":"https://api.github.com/users/cmicat/events{/privacy}","received_events_url":"https://api.github.com/users/cmicat/received_events","type":"User","site_admin":false},"body":"1. finalize onCreateViewHolder, onBindViewHolder , this fix #3\r\n2. make onCreateHeaderViewHolder, onCreateFooterViewHolder, onBindHeaderViewHolder, onBindFooterViewHolder not abstract, since headers and footers are optional, users may ignore to override those method.\r\n3. seperate onFailedToRecycleView to onFailedToRecycleHeaderView, onFailedToRecycleItemView, onFailedToRecycleFooterView\r\n4. seperate onViewAttachedToWindow to onHeaderViewAttachedToWindow, onItemViewAttachedToWindow, onFooterViewAttachedToWindow\r\n5. seperate onViewDetachedFromWindow to onHeaderViewDetachedFromWindow, onItemViewDetachedFromWindow, onFooterViewDetachedFromWindow\r\n6. seperate onViewRecycled to onHeaderViewRecycled, onItemViewRecycled, onFooterViewRecycled\r\n7. update robolectric dependency to 3.0\r\n8. update mockito dependency 1.10.19\r\n9. update junit dependency to 4.12\r\n10. add powermock 1.6.4 dependency\r\n11. seperate test base class to PowermockTest, RobolectricTestWithMockito, RobolectricTestWithPowermock. Because I can't get spy() work with RobolectricTestWithPowermock, while it's really useful to mock final methods.\r\n\r\nI have tested my change in Unit test, in the example project, and in one of my own project.\r\n","created_at":"2016-02-02T15:44:38Z","updated_at":"2016-02-10T02:23:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12e6892c486a65230d7bed724d62158d00a249a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/15/comments","statuses_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/statuses/df5402ef9d919e21671b5ab9a10968d67a559b63","head":{"label":"cmicat:seperate_View_life_cycle_method","ref":"seperate_View_life_cycle_method","sha":"df5402ef9d919e21671b5ab9a10968d67a559b63","user":{"login":"cmicat","id":13158883,"avatar_url":"https://avatars.githubusercontent.com/u/13158883?v=3","gravatar_id":"","url":"https://api.github.com/users/cmicat","html_url":"https://github.com/cmicat","followers_url":"https://api.github.com/users/cmicat/followers","following_url":"https://api.github.com/users/cmicat/following{/other_user}","gists_url":"https://api.github.com/users/cmicat/gists{/gist_id}","starred_url":"https://api.github.com/users/cmicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmicat/subscriptions","organizations_url":"https://api.github.com/users/cmicat/orgs","repos_url":"https://api.github.com/users/cmicat/repos","events_url":"https://api.github.com/users/cmicat/events{/privacy}","received_events_url":"https://api.github.com/users/cmicat/received_events","type":"User","site_admin":false},"repo":{"id":50765620,"name":"HeaderRecyclerView","full_name":"cmicat/HeaderRecyclerView","owner":{"login":"cmicat","id":13158883,"avatar_url":"https://avatars.githubusercontent.com/u/13158883?v=3","gravatar_id":"","url":"https://api.github.com/users/cmicat","html_url":"https://github.com/cmicat","followers_url":"https://api.github.com/users/cmicat/followers","following_url":"https://api.github.com/users/cmicat/following{/other_user}","gists_url":"https://api.github.com/users/cmicat/gists{/gist_id}","starred_url":"https://api.github.com/users/cmicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmicat/subscriptions","organizations_url":"https://api.github.com/users/cmicat/orgs","repos_url":"https://api.github.com/users/cmicat/repos","events_url":"https://api.github.com/users/cmicat/events{/privacy}","received_events_url":"https://api.github.com/users/cmicat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmicat/HeaderRecyclerView","description":"HeaderRecyclerView is an Android library created to be able to use RecyclerView.Adapter with a header in a easy way. To use this library create your RecyclerView.Adapter classes extending from HeaderRecyclerViewAdapter.","fork":true,"url":"https://api.github.com/repos/cmicat/HeaderRecyclerView","forks_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/forks","keys_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/teams","hooks_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/hooks","issue_events_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/issues/events{/number}","events_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/events","assignees_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/assignees{/user}","branches_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/branches{/branch}","tags_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/tags","blobs_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/statuses/{sha}","languages_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/languages","stargazers_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/stargazers","contributors_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/contributors","subscribers_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/subscribers","subscription_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/subscription","commits_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/contents/{+path}","compare_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/merges","archive_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/downloads","issues_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/issues{/number}","pulls_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/pulls{/number}","milestones_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/milestones{/number}","notifications_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/labels{/name}","releases_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/releases{/id}","deployments_url":"https://api.github.com/repos/cmicat/HeaderRecyclerView/deployments","created_at":"2016-01-31T08:39:19Z","updated_at":"2016-01-31T08:39:20Z","pushed_at":"2016-02-10T01:36:13Z","git_url":"git://github.com/cmicat/HeaderRecyclerView.git","ssh_url":"git@github.com:cmicat/HeaderRecyclerView.git","clone_url":"https://github.com/cmicat/HeaderRecyclerView.git","svn_url":"https://github.com/cmicat/HeaderRecyclerView","homepage":null,"size":9145,"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":"Karumi:master","ref":"master","sha":"6001b9dca0a816ed14217d7486766dca0c7caf7f","user":{"login":"Karumi","id":6469715,"avatar_url":"https://avatars.githubusercontent.com/u/6469715?v=3","gravatar_id":"","url":"https://api.github.com/users/Karumi","html_url":"https://github.com/Karumi","followers_url":"https://api.github.com/users/Karumi/followers","following_url":"https://api.github.com/users/Karumi/following{/other_user}","gists_url":"https://api.github.com/users/Karumi/gists{/gist_id}","starred_url":"https://api.github.com/users/Karumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Karumi/subscriptions","organizations_url":"https://api.github.com/users/Karumi/orgs","repos_url":"https://api.github.com/users/Karumi/repos","events_url":"https://api.github.com/users/Karumi/events{/privacy}","received_events_url":"https://api.github.com/users/Karumi/received_events","type":"Organization","site_admin":false},"repo":{"id":35882684,"name":"HeaderRecyclerView","full_name":"Karumi/HeaderRecyclerView","owner":{"login":"Karumi","id":6469715,"avatar_url":"https://avatars.githubusercontent.com/u/6469715?v=3","gravatar_id":"","url":"https://api.github.com/users/Karumi","html_url":"https://github.com/Karumi","followers_url":"https://api.github.com/users/Karumi/followers","following_url":"https://api.github.com/users/Karumi/following{/other_user}","gists_url":"https://api.github.com/users/Karumi/gists{/gist_id}","starred_url":"https://api.github.com/users/Karumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Karumi/subscriptions","organizations_url":"https://api.github.com/users/Karumi/orgs","repos_url":"https://api.github.com/users/Karumi/repos","events_url":"https://api.github.com/users/Karumi/events{/privacy}","received_events_url":"https://api.github.com/users/Karumi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Karumi/HeaderRecyclerView","description":"HeaderRecyclerView is an Android library created to be able to use RecyclerView.Adapter with a header in a easy way. To use this library create your RecyclerView.Adapter classes extending from HeaderRecyclerViewAdapter.","fork":false,"url":"https://api.github.com/repos/Karumi/HeaderRecyclerView","forks_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/forks","keys_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/teams","hooks_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/hooks","issue_events_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/events{/number}","events_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/events","assignees_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/assignees{/user}","branches_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/branches{/branch}","tags_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/tags","blobs_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/git/refs{/sha}","trees_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/statuses/{sha}","languages_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/languages","stargazers_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/stargazers","contributors_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/contributors","subscribers_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/subscribers","subscription_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/subscription","commits_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/commits{/sha}","git_commits_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/git/commits{/sha}","comments_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/comments{/number}","issue_comment_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/comments{/number}","contents_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/contents/{+path}","compare_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/merges","archive_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/downloads","issues_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues{/number}","pulls_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls{/number}","milestones_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/milestones{/number}","notifications_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/labels{/name}","releases_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/releases{/id}","deployments_url":"https://api.github.com/repos/Karumi/HeaderRecyclerView/deployments","created_at":"2015-05-19T13:09:08Z","updated_at":"2016-02-08T11:52:56Z","pushed_at":"2016-02-10T01:36:13Z","git_url":"git://github.com/Karumi/HeaderRecyclerView.git","ssh_url":"git@github.com:Karumi/HeaderRecyclerView.git","clone_url":"https://github.com/Karumi/HeaderRecyclerView.git","svn_url":"https://github.com/Karumi/HeaderRecyclerView","homepage":null,"size":9147,"stargazers_count":331,"watchers_count":331,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":3,"forks":44,"open_issues":3,"watchers":331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15"},"html":{"href":"https://github.com/Karumi/HeaderRecyclerView/pull/15"},"issue":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/15"},"comments":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Karumi/HeaderRecyclerView/statuses/df5402ef9d919e21671b5ab9a10968d67a559b63"}}}}