{"action":"closed","number":3801,"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3801","id":61012631,"html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3801","diff_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3801.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3801.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3801","number":3801,"state":"closed","locked":false,"title":"Feature/3776 reader filtered recyclerview","user":{"login":"mzorz","id":6597771,"avatar_url":"https://avatars.githubusercontent.com/u/6597771?v=3","gravatar_id":"","url":"https://api.github.com/users/mzorz","html_url":"https://github.com/mzorz","followers_url":"https://api.github.com/users/mzorz/followers","following_url":"https://api.github.com/users/mzorz/following{/other_user}","gists_url":"https://api.github.com/users/mzorz/gists{/gist_id}","starred_url":"https://api.github.com/users/mzorz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzorz/subscriptions","organizations_url":"https://api.github.com/users/mzorz/orgs","repos_url":"https://api.github.com/users/mzorz/repos","events_url":"https://api.github.com/users/mzorz/events{/privacy}","received_events_url":"https://api.github.com/users/mzorz/received_events","type":"User","site_admin":false},"body":"Addresses  https://github.com/wordpress-mobile/WordPress-Android/issues/3776\r\n\r\n### Notes\r\n\r\nThe FilteredRecyclerView now is used on the Comments screen (to filter comments by status) and on the Reader screen (to filter posts by tag). As these two places had a different look and feel for the filter, and I intended to keep the Reader filter toolbar as close as “as is” as possible, the FilteredRecyclerView component API has been extended to expose a couple more methods to deal with look and feel customisation:\r\n- `setCustomEmptyView`  allows to use not only a custom empty message but also a full fledged custom empty view (as is used in Reader screen)\r\n- `addToolbarCustomControl` allows to add views with an associated onClickListener that are added to the right of the toolbar, inside an horizontally oriented LinearLayout. In the case of the Reader screen, this comes in handy as a generalisation of the settings icon on the right hand inside the original toolbar\r\n- `setToolbarBackgroundColor` allows to set a specific background color for the toolbar\r\n- `setToolbarSpinnerTextColor` to change the Spinner text color\r\n- `setToolbarSpinnerDrawable ` to change the Spinner right drawable, as the arrow icon is different for the light blue (`blue_medium`) coloured toolbar\r\n- padding convenience methods `setToolbarLeftPadding`, `setToolbarRightPadding`, and `setToolbarLeftAndRightPadding`\r\n\r\nOther methods that have been added, which add simplicity to the use of FilteredRecyclerView here:\r\n- `getInternalRecyclerView` allows to get the internal RecyclerView instance to manipulate it. You need access to this for example when item decoration need be added (and it didn’t make sense to re-expose the same API with the need to maintain it in the future)\r\n\r\n- `isFirstPostVisible` has been converted into the more general `isFirstItemVisible()`  inside FilteredRecyclerView\r\n\r\n- `refreshFilterCriteriaOptions` is  a new method that allows the FilterCriteria set asynchronous loading to be triggered in case of a refresh or fragment re-creation.\r\n\r\n\r\n####  Listeners\r\nThe FilteredRecyclerView’s FilterListener has been slightly changed with these additions:\r\n- `onLoadFilterCriteriaOptions` now returns a mutable `List<FilterCriteria>` type instead of the immutable `FilterCriteria[]`. This arms FilteredRecyclerView with the ability to handle dynamically changing filter criterias, as is the case for Reader tags that can be added/eliminated on the fly. Furthermore, there is a new method for loading these criterias asynchronously, called `onLoadFilterCriteriaOptionsAsync`\r\n- `onLoadFilterCriteriaOptionsAsync`  allows a new listener of type `FilterCriteriaAsyncLoaderListener` to be called once criterias have been asynchronously loaded.\r\n\r\nThe newly added `FilterCriteriaAsyncLoaderListener` is called internally by the FilteredRecyclerView component where you need to pass the newly created List<FilterCriteria> set that has been built asynchronously, through the `onFilterCriteriasLoaded` method.\r\n\r\n\r\nThe code in Stats and Comments screens have been adequated according to these changes.\r\n\r\n\r\n\r\n### Miscellaneous:\r\n\r\n- removed unused imports, so some unrelated files have been modified too\r\n- had a hard time dealing with toolbar themes and styles and making them look good on phones, tablets and pre/post Lollipop devices, so after spending several hours with no luck getting all together in one place I decided to go with the programmatic approach for L&F customisation of the toolbar. Now `CommentsListFragment`  and `ReaderPostListFragment` both end up calling the spinner text color and toolbar background color override methods.\r\n- in order to keep its basic structure, the `ReaderPostListActivity` class has new code in the `onResumeFragments` activity lifecycle call for disabling the toolbar altogether. This way we can still use the FilteredRecyclerView while disabling the unneeded functionality. Had some time figuring out whether we should place this as a feature/functionality within FilteredRecyclerView, but disabling filtering on it wouldn’t make sense for its core mission (which is filtering content), so I decided to keep it as outside code.\r\n\r\n","created_at":"2016-02-28T23:34:16Z","updated_at":"2016-03-07T17:55:10Z","closed_at":"2016-03-07T17:55:10Z","merged_at":"2016-03-07T17:55:10Z","merge_commit_sha":"668ecd70225bb9decf1c97633ac342dcff4350ef","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3801/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3801/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/3801/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/ecbeec5926714a5d1160c00cb74d57b534cb0fcc","head":{"label":"mzorz:feature/3776-reader-filtered-recyclerview","ref":"feature/3776-reader-filtered-recyclerview","sha":"ecbeec5926714a5d1160c00cb74d57b534cb0fcc","user":{"login":"mzorz","id":6597771,"avatar_url":"https://avatars.githubusercontent.com/u/6597771?v=3","gravatar_id":"","url":"https://api.github.com/users/mzorz","html_url":"https://github.com/mzorz","followers_url":"https://api.github.com/users/mzorz/followers","following_url":"https://api.github.com/users/mzorz/following{/other_user}","gists_url":"https://api.github.com/users/mzorz/gists{/gist_id}","starred_url":"https://api.github.com/users/mzorz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzorz/subscriptions","organizations_url":"https://api.github.com/users/mzorz/orgs","repos_url":"https://api.github.com/users/mzorz/repos","events_url":"https://api.github.com/users/mzorz/events{/privacy}","received_events_url":"https://api.github.com/users/mzorz/received_events","type":"User","site_admin":false},"repo":{"id":50452316,"name":"WordPress-Android","full_name":"mzorz/WordPress-Android","owner":{"login":"mzorz","id":6597771,"avatar_url":"https://avatars.githubusercontent.com/u/6597771?v=3","gravatar_id":"","url":"https://api.github.com/users/mzorz","html_url":"https://github.com/mzorz","followers_url":"https://api.github.com/users/mzorz/followers","following_url":"https://api.github.com/users/mzorz/following{/other_user}","gists_url":"https://api.github.com/users/mzorz/gists{/gist_id}","starred_url":"https://api.github.com/users/mzorz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzorz/subscriptions","organizations_url":"https://api.github.com/users/mzorz/orgs","repos_url":"https://api.github.com/users/mzorz/repos","events_url":"https://api.github.com/users/mzorz/events{/privacy}","received_events_url":"https://api.github.com/users/mzorz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzorz/WordPress-Android","description":"WordPress for Android","fork":true,"url":"https://api.github.com/repos/mzorz/WordPress-Android","forks_url":"https://api.github.com/repos/mzorz/WordPress-Android/forks","keys_url":"https://api.github.com/repos/mzorz/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzorz/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzorz/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/mzorz/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/mzorz/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/mzorz/WordPress-Android/events","assignees_url":"https://api.github.com/repos/mzorz/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/mzorz/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/mzorz/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/mzorz/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzorz/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzorz/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzorz/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzorz/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/mzorz/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/mzorz/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/mzorz/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/mzorz/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/mzorz/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/mzorz/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzorz/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzorz/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzorz/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/mzorz/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/mzorz/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzorz/WordPress-Android/merges","archive_url":"https://api.github.com/repos/mzorz/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzorz/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/mzorz/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/mzorz/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/mzorz/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/mzorz/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzorz/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/mzorz/WordPress-Android/releases{/id}","deployments_url":"https://api.github.com/repos/mzorz/WordPress-Android/deployments","created_at":"2016-01-26T19:12:38Z","updated_at":"2016-01-26T19:12:43Z","pushed_at":"2016-03-07T17:45:09Z","git_url":"git://github.com/mzorz/WordPress-Android.git","ssh_url":"git@github.com:mzorz/WordPress-Android.git","clone_url":"https://github.com/mzorz/WordPress-Android.git","svn_url":"https://github.com/mzorz/WordPress-Android","homepage":"http://android.wordpress.org","size":149230,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"61714a497b344b9c00d14b64f01567fc148ca015","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}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/deployments","created_at":"2013-04-08T20:52:40Z","updated_at":"2016-03-06T11:31:50Z","pushed_at":"2016-03-07T17:55:10Z","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":152096,"stargazers_count":1106,"watchers_count":1106,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":617,"mirror_url":null,"open_issues_count":143,"forks":617,"open_issues":143,"watchers":1106,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3801"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3801"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3801"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3801/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3801/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/3801/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/ecbeec5926714a5d1160c00cb74d57b534cb0fcc"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":6,"review_comments":9,"commits":23,"additions":552,"deletions":448,"changed_files":27}}