{"action":"created","comment":{"url":"https://api.github.com/repos/kickstarter/android-oss/pulls/comments/95179833","pull_request_review_id":15725225,"id":95179833,"diff_hunk":"@@ -301,4 +181,87 @@ private void saveLastSeenActivityId(final @Nullable Activity activity) {\n       activitySamplePreference.set((int) activity.id());\n     }\n   }\n+\n+  private final PublishSubject<Boolean> activityClick = PublishSubject.create();\n+  private final PublishSubject<Project> activitySampleProjectClick = PublishSubject.create();\n+  private final PublishSubject<Activity> activityUpdateClick = PublishSubject.create();\n+  private final PublishSubject<Void> clearPage = PublishSubject.create();\n+  private final PublishSubject<Project> clickProject = PublishSubject.create();\n+  private final PublishSubject<Boolean> discoveryOnboardingLoginToutClick = PublishSubject.create();\n+  private final PublishSubject<Void> nextPage = PublishSubject.create();\n+  private final PublishSubject<DiscoveryParams> paramsFromActivity = PublishSubject.create();\n+  private final PublishSubject<List<Category>> rootCategories = PublishSubject.create();\n+\n+  private final BehaviorSubject<Activity> activity = BehaviorSubject.create();\n+  private final BehaviorSubject<List<Project>> projects = BehaviorSubject.create();\n+  private final Observable<Boolean> showActivityFeed;\n+  private final Observable<Activity> showActivityUpdate;\n+  private final Observable<Boolean> showLoginTout;\n+  private final PublishSubject<Pair<Project, RefTag>> showProject = PublishSubject.create();\n+  private final BehaviorSubject<Boolean> shouldShowOnboardingView = BehaviorSubject.create();\n+\n+  public final DiscoveryFragmentViewModelInputs inputs = this;\n+  public final DiscoveryFragmentViewModelOutputs outputs = this;\n+\n+  @Override public void activitySampleFriendBackingViewHolderProjectClicked(final @NonNull ActivitySampleFriendBackingViewHolder viewHolder,\n+    final @NonNull Project project) {\n+    activitySampleProjectClick.onNext(project);\n+  }\n+  @Override public void activitySampleFriendBackingViewHolderSeeActivityClicked(final @NonNull ActivitySampleFriendBackingViewHolder viewHolder) {\n+    activityClick.onNext(true);\n+  }\n+  @Override public void activitySampleFriendFollowViewHolderSeeActivityClicked(final @NonNull ActivitySampleFriendFollowViewHolder viewHolder) {\n+    activityClick.onNext(true);\n+  }\n+  @Override public void activitySampleProjectViewHolderProjectClicked(final @NonNull ActivitySampleProjectViewHolder viewHolder,\n+    final @NonNull Project project) {\n+    activitySampleProjectClick.onNext(project);\n+  }\n+  @Override public void activitySampleProjectViewHolderSeeActivityClicked(final @NonNull ActivitySampleProjectViewHolder viewHolder) {\n+    activityClick.onNext(true);\n+  }\n+  @Override public void activitySampleProjectViewHolderUpdateClicked(final @NonNull ActivitySampleProjectViewHolder viewHolder,\n+    final @NonNull Activity activity) {\n+    activityUpdateClick.onNext(activity);\n+  }\n+  @Override public void rootCategories(final @NonNull List<Category> rootCategories) {\n+    this.rootCategories.onNext(rootCategories);\n+  }\n+  @Override public void clearPage() {\n+    clearPage.onNext(null);\n+  }\n+  @Override public void discoveryOnboardingViewHolderLoginToutClick(final @NonNull DiscoveryOnboardingViewHolder viewHolder) {\n+    discoveryOnboardingLoginToutClick.onNext(true);\n+  }\n+  @Override public void nextPage() {\n+    nextPage.onNext(null);\n+  }\n+  @Override public void paramsFromActivity(final @NonNull DiscoveryParams params) {\n+    paramsFromActivity.onNext(params);\n+  }\n+  @Override public void projectCardViewHolderClick(final @NonNull ProjectCardViewHolder viewHolder, final Project project) {\n+    clickProject.onNext(project);\n+  }\n+\n+  @Override public Observable<Activity> activity() {","path":"app/src/main/java/com/kickstarter/viewmodels/DiscoveryFragmentViewModel.java","position":217,"original_position":217,"commit_id":"20cd2cba8095035126aa27416625942662941301","original_commit_id":"20cd2cba8095035126aa27416625942662941301","user":{"login":"christopherwright","id":75171,"avatar_url":"https://avatars.githubusercontent.com/u/75171?v=3","gravatar_id":"","url":"https://api.github.com/users/christopherwright","html_url":"https://github.com/christopherwright","followers_url":"https://api.github.com/users/christopherwright/followers","following_url":"https://api.github.com/users/christopherwright/following{/other_user}","gists_url":"https://api.github.com/users/christopherwright/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherwright/subscriptions","organizations_url":"https://api.github.com/users/christopherwright/orgs","repos_url":"https://api.github.com/users/christopherwright/repos","events_url":"https://api.github.com/users/christopherwright/events{/privacy}","received_events_url":"https://api.github.com/users/christopherwright/received_events","type":"User","site_admin":false},"body":"I think all the outputs could also have non null annotations on the return type.","created_at":"2017-01-09T15:43:27Z","updated_at":"2017-01-09T15:57:26Z","html_url":"https://github.com/kickstarter/android-oss/pull/44#discussion_r95179833","pull_request_url":"https://api.github.com/repos/kickstarter/android-oss/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/comments/95179833"},"html":{"href":"https://github.com/kickstarter/android-oss/pull/44#discussion_r95179833"},"pull_request":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/kickstarter/android-oss/pulls/44","id":100526669,"html_url":"https://github.com/kickstarter/android-oss/pull/44","diff_url":"https://github.com/kickstarter/android-oss/pull/44.diff","patch_url":"https://github.com/kickstarter/android-oss/pull/44.patch","issue_url":"https://api.github.com/repos/kickstarter/android-oss/issues/44","number":44,"state":"open","locked":false,"title":"Pass categories from DiscoveryActivity to Fragment","user":{"login":"luoser","id":4934046,"avatar_url":"https://avatars.githubusercontent.com/u/4934046?v=3","gravatar_id":"","url":"https://api.github.com/users/luoser","html_url":"https://github.com/luoser","followers_url":"https://api.github.com/users/luoser/followers","following_url":"https://api.github.com/users/luoser/following{/other_user}","gists_url":"https://api.github.com/users/luoser/gists{/gist_id}","starred_url":"https://api.github.com/users/luoser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luoser/subscriptions","organizations_url":"https://api.github.com/users/luoser/orgs","repos_url":"https://api.github.com/users/luoser/repos","events_url":"https://api.github.com/users/luoser/events{/privacy}","received_events_url":"https://api.github.com/users/luoser/received_events","type":"User","site_admin":false},"body":"## what\r\nThis is some much needed infrastructural cleanup in our `DiscoveryViewModel` and `DiscoveryFragmentViewModel`. It paves a clearer route for tackling our blank sorts Discovery bug, trust me.\r\n\r\n## changes\r\nThe main change is passing `rootCategories` as an `output` from `DiscoveryActivity` to the `DiscoveryFragment` via an `input`, rather than calling `fetchCategories` again in the fragment.\r\n\r\nWe need the categories in the fragment for our `DiscoveryUtils.fillRootCategoryForFeaturedProjects` function:\r\n```java\r\n  /**\r\n   * Given a list of projects and root categories this will determine if the first project is featured\r\n   * and is in need of its root category. If that is the case we will find its root and fill in that\r\n   * data and return a new list of projects.\r\n   */\r\n```\r\n\r\nBefore: 4 fetch categories requests on app startup\r\n![image](https://cloud.githubusercontent.com/assets/4934046/21732847/910db714-d429-11e6-86fc-6cb90ba7646d.png)\r\n\r\nAfter: 1 fetch categories request on app startup\r\n![image](https://cloud.githubusercontent.com/assets/4934046/21732850/9665d192-d429-11e6-9c64-e77b7d538db7.png)\r\n\r\nWhy didn't we do this earlier? Good question. An oversight in a large (sorts) project, my responsibility.\r\n\r\n* Another major win is disentangling our `params` logic. I will explain below.\r\n* A lot of noise is from modernizing the two Discovery VMs, i.e. moving inputs and outputs to the bottom of the file.","created_at":"2017-01-06T21:15:06Z","updated_at":"2017-01-09T15:57:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c77c4df37669697ff56eb50c9fd10ea3282fdf7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kickstarter/android-oss/pulls/44/commits","review_comments_url":"https://api.github.com/repos/kickstarter/android-oss/pulls/44/comments","review_comment_url":"https://api.github.com/repos/kickstarter/android-oss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kickstarter/android-oss/issues/44/comments","statuses_url":"https://api.github.com/repos/kickstarter/android-oss/statuses/20cd2cba8095035126aa27416625942662941301","head":{"label":"kickstarter:blanks","ref":"blanks","sha":"20cd2cba8095035126aa27416625942662941301","user":{"login":"kickstarter","id":120676,"avatar_url":"https://avatars.githubusercontent.com/u/120676?v=3","gravatar_id":"","url":"https://api.github.com/users/kickstarter","html_url":"https://github.com/kickstarter","followers_url":"https://api.github.com/users/kickstarter/followers","following_url":"https://api.github.com/users/kickstarter/following{/other_user}","gists_url":"https://api.github.com/users/kickstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/kickstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kickstarter/subscriptions","organizations_url":"https://api.github.com/users/kickstarter/orgs","repos_url":"https://api.github.com/users/kickstarter/repos","events_url":"https://api.github.com/users/kickstarter/events{/privacy}","received_events_url":"https://api.github.com/users/kickstarter/received_events","type":"Organization","site_admin":false},"repo":{"id":76278501,"name":"android-oss","full_name":"kickstarter/android-oss","owner":{"login":"kickstarter","id":120676,"avatar_url":"https://avatars.githubusercontent.com/u/120676?v=3","gravatar_id":"","url":"https://api.github.com/users/kickstarter","html_url":"https://github.com/kickstarter","followers_url":"https://api.github.com/users/kickstarter/followers","following_url":"https://api.github.com/users/kickstarter/following{/other_user}","gists_url":"https://api.github.com/users/kickstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/kickstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kickstarter/subscriptions","organizations_url":"https://api.github.com/users/kickstarter/orgs","repos_url":"https://api.github.com/users/kickstarter/repos","events_url":"https://api.github.com/users/kickstarter/events{/privacy}","received_events_url":"https://api.github.com/users/kickstarter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kickstarter/android-oss","description":"Kickstarter for Android. Bring new ideas to life, anywhere.","fork":false,"url":"https://api.github.com/repos/kickstarter/android-oss","forks_url":"https://api.github.com/repos/kickstarter/android-oss/forks","keys_url":"https://api.github.com/repos/kickstarter/android-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kickstarter/android-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kickstarter/android-oss/teams","hooks_url":"https://api.github.com/repos/kickstarter/android-oss/hooks","issue_events_url":"https://api.github.com/repos/kickstarter/android-oss/issues/events{/number}","events_url":"https://api.github.com/repos/kickstarter/android-oss/events","assignees_url":"https://api.github.com/repos/kickstarter/android-oss/assignees{/user}","branches_url":"https://api.github.com/repos/kickstarter/android-oss/branches{/branch}","tags_url":"https://api.github.com/repos/kickstarter/android-oss/tags","blobs_url":"https://api.github.com/repos/kickstarter/android-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kickstarter/android-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kickstarter/android-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/kickstarter/android-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kickstarter/android-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/kickstarter/android-oss/languages","stargazers_url":"https://api.github.com/repos/kickstarter/android-oss/stargazers","contributors_url":"https://api.github.com/repos/kickstarter/android-oss/contributors","subscribers_url":"https://api.github.com/repos/kickstarter/android-oss/subscribers","subscription_url":"https://api.github.com/repos/kickstarter/android-oss/subscription","commits_url":"https://api.github.com/repos/kickstarter/android-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/kickstarter/android-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/kickstarter/android-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/kickstarter/android-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/kickstarter/android-oss/contents/{+path}","compare_url":"https://api.github.com/repos/kickstarter/android-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kickstarter/android-oss/merges","archive_url":"https://api.github.com/repos/kickstarter/android-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kickstarter/android-oss/downloads","issues_url":"https://api.github.com/repos/kickstarter/android-oss/issues{/number}","pulls_url":"https://api.github.com/repos/kickstarter/android-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/kickstarter/android-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/kickstarter/android-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kickstarter/android-oss/labels{/name}","releases_url":"https://api.github.com/repos/kickstarter/android-oss/releases{/id}","deployments_url":"https://api.github.com/repos/kickstarter/android-oss/deployments","created_at":"2016-12-12T17:15:41Z","updated_at":"2017-01-09T15:08:13Z","pushed_at":"2017-01-06T23:53:00Z","git_url":"git://github.com/kickstarter/android-oss.git","ssh_url":"git@github.com:kickstarter/android-oss.git","clone_url":"https://github.com/kickstarter/android-oss.git","svn_url":"https://github.com/kickstarter/android-oss","homepage":"https://www.kickstarter.com/mobile","size":15754,"stargazers_count":3145,"watchers_count":3145,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":448,"mirror_url":null,"open_issues_count":17,"forks":448,"open_issues":17,"watchers":3145,"default_branch":"master"}},"base":{"label":"kickstarter:master","ref":"master","sha":"93288fa5b89bb7229a5d0528d503a1a711972854","user":{"login":"kickstarter","id":120676,"avatar_url":"https://avatars.githubusercontent.com/u/120676?v=3","gravatar_id":"","url":"https://api.github.com/users/kickstarter","html_url":"https://github.com/kickstarter","followers_url":"https://api.github.com/users/kickstarter/followers","following_url":"https://api.github.com/users/kickstarter/following{/other_user}","gists_url":"https://api.github.com/users/kickstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/kickstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kickstarter/subscriptions","organizations_url":"https://api.github.com/users/kickstarter/orgs","repos_url":"https://api.github.com/users/kickstarter/repos","events_url":"https://api.github.com/users/kickstarter/events{/privacy}","received_events_url":"https://api.github.com/users/kickstarter/received_events","type":"Organization","site_admin":false},"repo":{"id":76278501,"name":"android-oss","full_name":"kickstarter/android-oss","owner":{"login":"kickstarter","id":120676,"avatar_url":"https://avatars.githubusercontent.com/u/120676?v=3","gravatar_id":"","url":"https://api.github.com/users/kickstarter","html_url":"https://github.com/kickstarter","followers_url":"https://api.github.com/users/kickstarter/followers","following_url":"https://api.github.com/users/kickstarter/following{/other_user}","gists_url":"https://api.github.com/users/kickstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/kickstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kickstarter/subscriptions","organizations_url":"https://api.github.com/users/kickstarter/orgs","repos_url":"https://api.github.com/users/kickstarter/repos","events_url":"https://api.github.com/users/kickstarter/events{/privacy}","received_events_url":"https://api.github.com/users/kickstarter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kickstarter/android-oss","description":"Kickstarter for Android. Bring new ideas to life, anywhere.","fork":false,"url":"https://api.github.com/repos/kickstarter/android-oss","forks_url":"https://api.github.com/repos/kickstarter/android-oss/forks","keys_url":"https://api.github.com/repos/kickstarter/android-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kickstarter/android-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kickstarter/android-oss/teams","hooks_url":"https://api.github.com/repos/kickstarter/android-oss/hooks","issue_events_url":"https://api.github.com/repos/kickstarter/android-oss/issues/events{/number}","events_url":"https://api.github.com/repos/kickstarter/android-oss/events","assignees_url":"https://api.github.com/repos/kickstarter/android-oss/assignees{/user}","branches_url":"https://api.github.com/repos/kickstarter/android-oss/branches{/branch}","tags_url":"https://api.github.com/repos/kickstarter/android-oss/tags","blobs_url":"https://api.github.com/repos/kickstarter/android-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kickstarter/android-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kickstarter/android-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/kickstarter/android-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kickstarter/android-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/kickstarter/android-oss/languages","stargazers_url":"https://api.github.com/repos/kickstarter/android-oss/stargazers","contributors_url":"https://api.github.com/repos/kickstarter/android-oss/contributors","subscribers_url":"https://api.github.com/repos/kickstarter/android-oss/subscribers","subscription_url":"https://api.github.com/repos/kickstarter/android-oss/subscription","commits_url":"https://api.github.com/repos/kickstarter/android-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/kickstarter/android-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/kickstarter/android-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/kickstarter/android-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/kickstarter/android-oss/contents/{+path}","compare_url":"https://api.github.com/repos/kickstarter/android-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kickstarter/android-oss/merges","archive_url":"https://api.github.com/repos/kickstarter/android-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kickstarter/android-oss/downloads","issues_url":"https://api.github.com/repos/kickstarter/android-oss/issues{/number}","pulls_url":"https://api.github.com/repos/kickstarter/android-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/kickstarter/android-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/kickstarter/android-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kickstarter/android-oss/labels{/name}","releases_url":"https://api.github.com/repos/kickstarter/android-oss/releases{/id}","deployments_url":"https://api.github.com/repos/kickstarter/android-oss/deployments","created_at":"2016-12-12T17:15:41Z","updated_at":"2017-01-09T15:08:13Z","pushed_at":"2017-01-06T23:53:00Z","git_url":"git://github.com/kickstarter/android-oss.git","ssh_url":"git@github.com:kickstarter/android-oss.git","clone_url":"https://github.com/kickstarter/android-oss.git","svn_url":"https://github.com/kickstarter/android-oss","homepage":"https://www.kickstarter.com/mobile","size":15754,"stargazers_count":3145,"watchers_count":3145,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":448,"mirror_url":null,"open_issues_count":17,"forks":448,"open_issues":17,"watchers":3145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/44"},"html":{"href":"https://github.com/kickstarter/android-oss/pull/44"},"issue":{"href":"https://api.github.com/repos/kickstarter/android-oss/issues/44"},"comments":{"href":"https://api.github.com/repos/kickstarter/android-oss/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kickstarter/android-oss/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/kickstarter/android-oss/statuses/20cd2cba8095035126aa27416625942662941301"}}}}
{"actor":{"display_login":"christopherwright"}}