{"action":"closed","number":3026,"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026","id":41172537,"html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3026","diff_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3026.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3026.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3026","number":3026,"state":"closed","locked":false,"title":"Feature/reader adapter enhancements","user":{"login":"nbradbury","id":3903757,"avatar_url":"https://avatars.githubusercontent.com/u/3903757?v=3","gravatar_id":"","url":"https://api.github.com/users/nbradbury","html_url":"https://github.com/nbradbury","followers_url":"https://api.github.com/users/nbradbury/followers","following_url":"https://api.github.com/users/nbradbury/following{/other_user}","gists_url":"https://api.github.com/users/nbradbury/gists{/gist_id}","starred_url":"https://api.github.com/users/nbradbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbradbury/subscriptions","organizations_url":"https://api.github.com/users/nbradbury/orgs","repos_url":"https://api.github.com/users/nbradbury/repos","events_url":"https://api.github.com/users/nbradbury/events{/privacy}","received_events_url":"https://api.github.com/users/nbradbury/received_events","type":"User","site_admin":false},"body":"## Adds two related enhancements to ReaderPostAdapter\r\n\r\n### 1. #2590 - Use a [SortedList](https://developer.android.com/reference/android/support/v7/util/SortedList.html) to maintain the list of posts\r\n\r\nSwitching to a SortedList provides these benefits:\r\n\r\n* Batch upating - wrap multiple changes between `beginBatchedUpdate`...`endBatchedUpdate` for more efficient handling\r\n* It takes care of telling the RecyclerView when (and what) to update, so we don't ever have to call `notifyDataSetChanged` or `notifyItemChanged`\r\n* It takes care of de-duping and sorting\r\n\r\n### 2. #3025 - Use a separate view type for the toolbar spacer\r\n\r\nIn the current code, we show a transparent \"spacer\" at the top of the first post (the one at position 0) to avoid overlapping the toolbar. This means that when new posts are added we have to hide the previous spacer and make sure the post that's now at position 0 shows it.\r\n\r\nThat approach won't work now that we've switched to a SortedList, and it was cumbersome to start with. This new approach relies on `getItemViewType()` to always show the spacer at position 0.","created_at":"2015-07-29T21:10:11Z","updated_at":"2015-07-31T23:25:46Z","closed_at":"2015-07-31T23:25:46Z","merged_at":null,"merge_commit_sha":"6fc2aa13f9ded1a1663bf7ecb2bc30e06a8a131a","assignee":null,"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones/44","html_url":"https://github.com/wordpress-mobile/WordPress-Android/milestones/4.5","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones/44/labels","id":1208149,"number":44,"title":"4.5","description":"","creator":{"login":"tonyr59h","id":4031052,"avatar_url":"https://avatars.githubusercontent.com/u/4031052?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyr59h","html_url":"https://github.com/tonyr59h","followers_url":"https://api.github.com/users/tonyr59h/followers","following_url":"https://api.github.com/users/tonyr59h/following{/other_user}","gists_url":"https://api.github.com/users/tonyr59h/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyr59h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyr59h/subscriptions","organizations_url":"https://api.github.com/users/tonyr59h/orgs","repos_url":"https://api.github.com/users/tonyr59h/repos","events_url":"https://api.github.com/users/tonyr59h/events{/privacy}","received_events_url":"https://api.github.com/users/tonyr59h/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":10,"state":"open","created_at":"2015-07-14T21:25:52Z","updated_at":"2015-07-31T23:25:46Z","due_on":"2015-08-09T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3026/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/125940df2fc70a9c1fdd6f4b8fc9401d4d5fdad6","head":{"label":"wordpress-mobile:feature/reader-adapter-enhancements","ref":"feature/reader-adapter-enhancements","sha":"125940df2fc70a9c1fdd6f4b8fc9401d4d5fdad6","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","created_at":"2013-04-08T20:52:40Z","updated_at":"2015-07-31T13:49:04Z","pushed_at":"2015-07-31T18:46:25Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":236654,"stargazers_count":871,"watchers_count":871,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":514,"mirror_url":null,"open_issues_count":143,"forks":514,"open_issues":143,"watchers":871,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"99464896bf0063b5f7aa00fec0f6ea54584133dd","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","created_at":"2013-04-08T20:52:40Z","updated_at":"2015-07-31T13:49:04Z","pushed_at":"2015-07-31T18:46:25Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":236654,"stargazers_count":871,"watchers_count":871,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":514,"mirror_url":null,"open_issues_count":143,"forks":514,"open_issues":143,"watchers":871,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3026"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3026"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3026/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3026/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/125940df2fc70a9c1fdd6f4b8fc9401d4d5fdad6"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":6,"additions":290,"deletions":296,"changed_files":5}}