{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/52475690","id":52475690,"diff_hunk":"@@ -183,6 +188,25 @@ public static void setStatsTimeframe(StatsTimeframe timeframe) {\n         }\n     }\n \n+    public static CommentStatus getCommentsStatusFilter() {\n+        int idx = getInt(DeletablePrefKey.COMMENTS_STATUS_TYPE_INDEX);\n+        CommentStatus[] commentStatusValues = CommentStatus.values();\n+        if (commentStatusValues.length < idx) {\n+            return commentStatusValues[0];\n+        } else {\n+            return commentStatusValues[idx];\n+        }\n+    }\n+    public static void setCommentsStatusFilter(CommentStatus commentstatus) {","path":"WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java","position":32,"original_position":32,"commit_id":"52ef3904b2caabf4c365d6989f6e20d3c5392924","original_commit_id":"16ca3149a56799d3c3e07e0ec7b832a2187ee402","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":"Coming to think of it, it might even be a good idea to remember the Comments filter set for each blog, rather than resetting it each time. A bit overkill though","created_at":"2016-02-10T15:49:24Z","updated_at":"2016-02-10T15:49:24Z","html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729#discussion_r52475690","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/52475690"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729#discussion_r52475690"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729","id":58825767,"html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729","diff_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3729","number":3729,"state":"open","locked":false,"title":"Feature/3704 new FilteredRecyclerView in Comments","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/3704\r\n\r\nRelated to https://github.com/wordpress-mobile/WordPress-Android/issues/3643 and comes based on the discussion held on https://github.com/wordpress-mobile/WordPress-Android/pull/3691.\r\n\r\n\r\n## Demo\r\nHere’s a video of the working implementation:\r\nhttps://www.dropbox.com/s/cebq28stv44t0u0/test.mp4?dl=0\r\n\r\n## Code\r\nImplemented a `FilteredRecyclerView` component that expects a `FilterCriteria` set of elements through which to filter the elements in its adapter.\r\nAn example of its usage is implemented here for the `Comments` section of the WordPress Android app.\r\n\r\nMade use of the native Spinner in this case, as it feels more the Android way. Will happily refactor and change it to use the `ReaderTagToolbar` if indicated to do so, as originally advised [here](https://github.com/wordpress-mobile/WordPress-Android/pull/3691#issuecomment-178853258) by @nbradbury.\r\n\r\nThe FilteredRecyclerView has its own lifecycle, which should be self explanative through the use of this following interface \r\n\r\n    public interface Listener {\r\n        FilterCriteria[] onLoadFilterCriteriaOptions();\r\n        void onLoadData();\r\n        void onFilterSelected(int position, FilterCriteria criteria);\r\n        FilterCriteria onRecallSelection();\r\n        String onShowEmptyViewMessage(EmptyViewMessageType emptyViewMsgType);\r\n    }\r\n\r\n\r\n## Design\r\nAs to the design, it’s been implemented following @mattmiklic ’s proposal here https://github.com/wordpress-mobile/WordPress-Android/pull/3691#issuecomment-179965189\r\nSizes have been considered following this:\r\nhttps://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing\r\nSpecifically, the toolbar has been set to a height of `48dp` as per the `subtitle` section indicated there.\r\n\r\n*@mattmiklic Please note the down-pointing arrow is not implemented on purpose* - we would need a 9-patch drawable to make it part of the background just like the drawable being used in other Spinners in the app (`@drawable/spinner_background_ab_wordpress`). Assuming you're the right person to ask for, can you provide these assets, please? If not please advise - I can probably help myself otherwise too.\r\nThanks in advance\r\n\r\n## Screenshots\r\n\r\n![screenshot_2016-02-09-19-40-28](https://cloud.githubusercontent.com/assets/6597771/12933911/9374a23a-cf69-11e5-94a7-24bdf1396030.png)\r\nFilter criteria selection\r\n\r\n![screenshot_2016-02-09-19-40-48](https://cloud.githubusercontent.com/assets/6597771/12933917/a1490266-cf69-11e5-8fb2-80a1637977c3.png)\r\nHidden\r\n\r\n![screenshot_2016-02-09-19-40-52](https://cloud.githubusercontent.com/assets/6597771/12933918/a14c6352-cf69-11e5-8742-97898f74f1ff.png)\r\nHiding\r\n\r\n","created_at":"2016-02-09T23:25:16Z","updated_at":"2016-02-10T15:49:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab1ebb49d100223502868e27f9d108c429c0e854","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729/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/3729/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/52ef3904b2caabf4c365d6989f6e20d3c5392924","head":{"label":"mzorz:feature/3704-comments-make-spinner-into-fragment","ref":"feature/3704-comments-make-spinner-into-fragment","sha":"52ef3904b2caabf4c365d6989f6e20d3c5392924","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-02-10T13:05:06Z","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":147792,"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":"3d4ae4709f8d52fac0dd35a67e4bdb4cc18dfe87","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-02-09T09:03:18Z","pushed_at":"2016-02-10T13:05:06Z","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":150214,"stargazers_count":1073,"watchers_count":1073,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":605,"mirror_url":null,"open_issues_count":145,"forks":605,"open_issues":145,"watchers":1073,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3729"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3729"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3729/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3729/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/3729/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/52ef3904b2caabf4c365d6989f6e20d3c5392924"}}}}