{"action":"created","comment":{"url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/comments/204657763","pull_request_review_id":139772703,"id":204657763,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDY1Nzc2Mw==","diff_hunk":"@@ -0,0 +1,109 @@\n+package com.hannesdorfmann.adapterdelegates3;\n+\n+import android.support.annotation.NonNull;\n+import android.support.v7.recyclerview.extensions.AsyncListDiffer;\n+import android.support.v7.util.DiffUtil;\n+import android.support.v7.widget.RecyclerView;\n+import android.view.ViewGroup;\n+\n+import java.util.List;\n+\n+/**\n+ * An implementation of an Adapter that already uses a {@link AdapterDelegatesManager} pretty same as\n+ * {@link AbsDelegationAdapter} but also uses {@link AsyncListDiffer} from support library 27.0.1 for\n+ * calculating diffs between old and new collections of items and does this on background thread.\n+ * That means that now you should not carry about {@link RecyclerView.Adapter#notifyItemChanged(int)}\n+ * and other methods of adapter, all you need to do is to submit a new list into adapter and all diffs will be\n+ * calculated for you.\n+ * You just have to add the {@link AdapterDelegate}s i.e. in the constructor of a subclass that inheritance from this\n+ * class:\n+ * <pre>\n+ * {@code\n+ *    class MyAdapter extends AbsDiffDelegationAdapter<MyDataSourceType> {\n+ *        public MyAdapter() {\n+ *            this.delegatesManager.add(new FooAdapterDelegate());\n+ *            this.delegatesManager.add(new BarAdapterDelegate());\n+ *        }\n+ *    }\n+ * }\n+ * </pre>\n+ *\n+ * @param <T> The type of the item, must implement {@link DiffItem}\n+ * @author Sergey Opivalov\n+ */\n+\n+public abstract class AbsDiffDelegationAdapter<T extends DiffItem> extends RecyclerView.Adapter {\n+\n+    protected final AdapterDelegatesManager<List<T>> delegatesManager;\n+    protected final AsyncListDiffer<T> differ;\n+\n+    public AbsDiffDelegationAdapter(@NonNull DiffUtil.ItemCallback<T> diffCallback) {\n+        this.differ = new AsyncListDiffer<>(this, diffCallback);\n+        this.delegatesManager = new AdapterDelegatesManager<>();\n+    }\n+\n+    public AbsDiffDelegationAdapter(@NonNull DiffUtil.ItemCallback<T> diffCallback,","path":"library/src/main/java/com/hannesdorfmann/adapterdelegates3/AbsDiffDelegationAdapter.java","position":45,"original_position":45,"commit_id":"dad8c4bfbce6031477523285a02d3d2c9314449d","original_commit_id":"dad8c4bfbce6031477523285a02d3d2c9314449d","user":{"login":"6hundreds","id":16295835,"node_id":"MDQ6VXNlcjE2Mjk1ODM1","avatar_url":"https://avatars3.githubusercontent.com/u/16295835?v=4","gravatar_id":"","url":"https://api.github.com/users/6hundreds","html_url":"https://github.com/6hundreds","followers_url":"https://api.github.com/users/6hundreds/followers","following_url":"https://api.github.com/users/6hundreds/following{/other_user}","gists_url":"https://api.github.com/users/6hundreds/gists{/gist_id}","starred_url":"https://api.github.com/users/6hundreds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6hundreds/subscriptions","organizations_url":"https://api.github.com/users/6hundreds/orgs","repos_url":"https://api.github.com/users/6hundreds/repos","events_url":"https://api.github.com/users/6hundreds/events{/privacy}","received_events_url":"https://api.github.com/users/6hundreds/received_events","type":"User","site_admin":false},"body":"But T is restricted with DiffItem interface in DiffDelegationAdapter class signature.","created_at":"2018-07-24T07:58:02Z","updated_at":"2018-07-24T07:58:02Z","html_url":"https://github.com/sockeqwe/AdapterDelegates/pull/54#discussion_r204657763","pull_request_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/comments/204657763"},"html":{"href":"https://github.com/sockeqwe/AdapterDelegates/pull/54#discussion_r204657763"},"pull_request":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54"}},"in_reply_to_id":204574571},"pull_request":{"url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54","id":203012309,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDEyMzA5","html_url":"https://github.com/sockeqwe/AdapterDelegates/pull/54","diff_url":"https://github.com/sockeqwe/AdapterDelegates/pull/54.diff","patch_url":"https://github.com/sockeqwe/AdapterDelegates/pull/54.patch","issue_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/54","number":54,"state":"open","locked":false,"title":"6hundreds/diff util adapter","user":{"login":"6hundreds","id":16295835,"node_id":"MDQ6VXNlcjE2Mjk1ODM1","avatar_url":"https://avatars3.githubusercontent.com/u/16295835?v=4","gravatar_id":"","url":"https://api.github.com/users/6hundreds","html_url":"https://github.com/6hundreds","followers_url":"https://api.github.com/users/6hundreds/followers","following_url":"https://api.github.com/users/6hundreds/following{/other_user}","gists_url":"https://api.github.com/users/6hundreds/gists{/gist_id}","starred_url":"https://api.github.com/users/6hundreds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6hundreds/subscriptions","organizations_url":"https://api.github.com/users/6hundreds/orgs","repos_url":"https://api.github.com/users/6hundreds/repos","events_url":"https://api.github.com/users/6hundreds/events{/privacy}","received_events_url":"https://api.github.com/users/6hundreds/received_events","type":"User","site_admin":false},"body":"Hi Hannes! \r\nFirst of all - thank you for such elegant solution of multiple viewTypes in RecyclerView.\r\nIn this PR i'm implemented new adapter type, that allows to work with ListAdapter from support library 27.0.1. It using AsyncListDiffer internally and calculating diffs in the background thread by the default.\r\nNew sample was added\r\nReadme was updated\r\nTests for new classes written","created_at":"2018-07-21T14:34:55Z","updated_at":"2018-07-24T07:58:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"546823396b771e520a91da448aaef59f6f3058f2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54/commits","review_comments_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54/comments","review_comment_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/54/comments","statuses_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/statuses/dad8c4bfbce6031477523285a02d3d2c9314449d","head":{"label":"6hundreds:6hundreds/diff-util-adapter","ref":"6hundreds/diff-util-adapter","sha":"dad8c4bfbce6031477523285a02d3d2c9314449d","user":{"login":"6hundreds","id":16295835,"node_id":"MDQ6VXNlcjE2Mjk1ODM1","avatar_url":"https://avatars3.githubusercontent.com/u/16295835?v=4","gravatar_id":"","url":"https://api.github.com/users/6hundreds","html_url":"https://github.com/6hundreds","followers_url":"https://api.github.com/users/6hundreds/followers","following_url":"https://api.github.com/users/6hundreds/following{/other_user}","gists_url":"https://api.github.com/users/6hundreds/gists{/gist_id}","starred_url":"https://api.github.com/users/6hundreds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6hundreds/subscriptions","organizations_url":"https://api.github.com/users/6hundreds/orgs","repos_url":"https://api.github.com/users/6hundreds/repos","events_url":"https://api.github.com/users/6hundreds/events{/privacy}","received_events_url":"https://api.github.com/users/6hundreds/received_events","type":"User","site_admin":false},"repo":{"id":138994145,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5OTQxNDU=","name":"AdapterDelegates","full_name":"6hundreds/AdapterDelegates","owner":{"login":"6hundreds","id":16295835,"node_id":"MDQ6VXNlcjE2Mjk1ODM1","avatar_url":"https://avatars3.githubusercontent.com/u/16295835?v=4","gravatar_id":"","url":"https://api.github.com/users/6hundreds","html_url":"https://github.com/6hundreds","followers_url":"https://api.github.com/users/6hundreds/followers","following_url":"https://api.github.com/users/6hundreds/following{/other_user}","gists_url":"https://api.github.com/users/6hundreds/gists{/gist_id}","starred_url":"https://api.github.com/users/6hundreds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6hundreds/subscriptions","organizations_url":"https://api.github.com/users/6hundreds/orgs","repos_url":"https://api.github.com/users/6hundreds/repos","events_url":"https://api.github.com/users/6hundreds/events{/privacy}","received_events_url":"https://api.github.com/users/6hundreds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/6hundreds/AdapterDelegates","description":"\"Favor composition over inheritance\" for RecyclerView Adapters","fork":true,"url":"https://api.github.com/repos/6hundreds/AdapterDelegates","forks_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/forks","keys_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/teams","hooks_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/hooks","issue_events_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/issues/events{/number}","events_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/events","assignees_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/assignees{/user}","branches_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/branches{/branch}","tags_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/tags","blobs_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/git/refs{/sha}","trees_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/statuses/{sha}","languages_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/languages","stargazers_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/stargazers","contributors_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/contributors","subscribers_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/subscribers","subscription_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/subscription","commits_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/commits{/sha}","git_commits_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/git/commits{/sha}","comments_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/comments{/number}","issue_comment_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/issues/comments{/number}","contents_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/contents/{+path}","compare_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/merges","archive_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/downloads","issues_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/issues{/number}","pulls_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/pulls{/number}","milestones_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/milestones{/number}","notifications_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/labels{/name}","releases_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/releases{/id}","deployments_url":"https://api.github.com/repos/6hundreds/AdapterDelegates/deployments","created_at":"2018-06-28T09:07:13Z","updated_at":"2018-06-28T09:07:15Z","pushed_at":"2018-07-21T15:02:39Z","git_url":"git://github.com/6hundreds/AdapterDelegates.git","ssh_url":"git@github.com:6hundreds/AdapterDelegates.git","clone_url":"https://github.com/6hundreds/AdapterDelegates.git","svn_url":"https://github.com/6hundreds/AdapterDelegates","homepage":"http://hannesdorfmann.com/android/adapter-delegates","size":841,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sockeqwe:master","ref":"master","sha":"7c95b0c41019a7c54f6e989223f0ace0964b2537","user":{"login":"sockeqwe","id":583598,"node_id":"MDQ6VXNlcjU4MzU5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/583598?v=4","gravatar_id":"","url":"https://api.github.com/users/sockeqwe","html_url":"https://github.com/sockeqwe","followers_url":"https://api.github.com/users/sockeqwe/followers","following_url":"https://api.github.com/users/sockeqwe/following{/other_user}","gists_url":"https://api.github.com/users/sockeqwe/gists{/gist_id}","starred_url":"https://api.github.com/users/sockeqwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sockeqwe/subscriptions","organizations_url":"https://api.github.com/users/sockeqwe/orgs","repos_url":"https://api.github.com/users/sockeqwe/repos","events_url":"https://api.github.com/users/sockeqwe/events{/privacy}","received_events_url":"https://api.github.com/users/sockeqwe/received_events","type":"User","site_admin":false},"repo":{"id":39889599,"node_id":"MDEwOlJlcG9zaXRvcnkzOTg4OTU5OQ==","name":"AdapterDelegates","full_name":"sockeqwe/AdapterDelegates","owner":{"login":"sockeqwe","id":583598,"node_id":"MDQ6VXNlcjU4MzU5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/583598?v=4","gravatar_id":"","url":"https://api.github.com/users/sockeqwe","html_url":"https://github.com/sockeqwe","followers_url":"https://api.github.com/users/sockeqwe/followers","following_url":"https://api.github.com/users/sockeqwe/following{/other_user}","gists_url":"https://api.github.com/users/sockeqwe/gists{/gist_id}","starred_url":"https://api.github.com/users/sockeqwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sockeqwe/subscriptions","organizations_url":"https://api.github.com/users/sockeqwe/orgs","repos_url":"https://api.github.com/users/sockeqwe/repos","events_url":"https://api.github.com/users/sockeqwe/events{/privacy}","received_events_url":"https://api.github.com/users/sockeqwe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sockeqwe/AdapterDelegates","description":"\"Favor composition over inheritance\" for RecyclerView Adapters","fork":false,"url":"https://api.github.com/repos/sockeqwe/AdapterDelegates","forks_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/forks","keys_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/teams","hooks_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/hooks","issue_events_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/events{/number}","events_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/events","assignees_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/assignees{/user}","branches_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/branches{/branch}","tags_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/tags","blobs_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/git/refs{/sha}","trees_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/statuses/{sha}","languages_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/languages","stargazers_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/stargazers","contributors_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/contributors","subscribers_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/subscribers","subscription_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/subscription","commits_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/commits{/sha}","git_commits_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/git/commits{/sha}","comments_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/comments{/number}","issue_comment_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/comments{/number}","contents_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/contents/{+path}","compare_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/merges","archive_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/downloads","issues_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues{/number}","pulls_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls{/number}","milestones_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/milestones{/number}","notifications_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/labels{/name}","releases_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/releases{/id}","deployments_url":"https://api.github.com/repos/sockeqwe/AdapterDelegates/deployments","created_at":"2015-07-29T11:19:56Z","updated_at":"2018-07-24T06:18:23Z","pushed_at":"2018-07-21T15:02:40Z","git_url":"git://github.com/sockeqwe/AdapterDelegates.git","ssh_url":"git@github.com:sockeqwe/AdapterDelegates.git","clone_url":"https://github.com/sockeqwe/AdapterDelegates.git","svn_url":"https://github.com/sockeqwe/AdapterDelegates","homepage":"http://hannesdorfmann.com/android/adapter-delegates","size":821,"stargazers_count":1931,"watchers_count":1931,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":231,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":231,"open_issues":7,"watchers":1931,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54"},"html":{"href":"https://github.com/sockeqwe/AdapterDelegates/pull/54"},"issue":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/54"},"comments":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/sockeqwe/AdapterDelegates/statuses/dad8c4bfbce6031477523285a02d3d2c9314449d"}},"author_association":"NONE"}}
{"actor":{"display_login":"6hundreds"}}