{"action":"created","comment":{"url":"https://api.github.com/repos/square/flow/pulls/comments/49684914","id":49684914,"diff_hunk":"@@ -0,0 +1,53 @@\n+package flow.sample.basic;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.support.annotation.LayoutRes;\n+import android.util.Log;\n+import android.view.LayoutInflater;\n+import android.view.View;\n+import android.view.ViewGroup;\n+import flow.Flow;\n+\n+final class BasicDispatcher implements Flow.Dispatcher {\n+\n+  private final Activity activity;\n+\n+  BasicDispatcher(Activity activity) {\n+    this.activity = activity;\n+  }\n+\n+  @Override public void dispatch(Flow.Traversal traversal, Flow.TraversalCallback callback) {\n+    Log.d(\"BasicDispatcher\", \"dispatching \" + traversal);\n+    Object dest = traversal.destination.top();\n+\n+    ViewGroup frame = (ViewGroup) activity.findViewById(R.id.basic_activity_frame);\n+\n+    if (traversal.origin != null) {\n+      if (frame.getChildCount() > 0) {\n+        traversal.origin.topViewState().save(frame.getChildAt(0));\n+        frame.removeAllViews();\n+      }\n+    }\n+\n+    @LayoutRes final int layout;\n+    if (dest instanceof HelloScreen) {\n+      layout = R.layout.hello_screen;\n+    } else if (dest instanceof WelcomeScreen) {\n+      layout = R.layout.welcome_screen;\n+    } else {\n+      throw new AssertionError(\"Unrecognized screen \" + dest);\n+    }\n+\n+    Context screenContext = new Screens.ContextWrapper(frame.getContext(), dest);\n+\n+    View incomingView = LayoutInflater.from(frame.getContext()) //","path":"flow-sample-basic/src/main/java/flow/sample/basic/BasicDispatcher.java","position":44,"original_position":44,"commit_id":"928a46881c60450ce459cbc4fd33bb92cc9870a6","original_commit_id":"6317a351b0f53e2e2fd83b672415b293a941434c","user":{"login":"rjrjr","id":1884445,"avatar_url":"https://avatars.githubusercontent.com/u/1884445?v=3","gravatar_id":"","url":"https://api.github.com/users/rjrjr","html_url":"https://github.com/rjrjr","followers_url":"https://api.github.com/users/rjrjr/followers","following_url":"https://api.github.com/users/rjrjr/following{/other_user}","gists_url":"https://api.github.com/users/rjrjr/gists{/gist_id}","starred_url":"https://api.github.com/users/rjrjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjrjr/subscriptions","organizations_url":"https://api.github.com/users/rjrjr/orgs","repos_url":"https://api.github.com/users/rjrjr/repos","events_url":"https://api.github.com/users/rjrjr/events{/privacy}","received_events_url":"https://api.github.com/users/rjrjr/received_events","type":"User","site_admin":false},"body":"The `LAYOUT_INFLATER_SERVICE` thing above.","created_at":"2016-01-14T03:43:21Z","updated_at":"2016-01-14T03:43:21Z","html_url":"https://github.com/square/flow/pull/118#discussion_r49684914","pull_request_url":"https://api.github.com/repos/square/flow/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/square/flow/pulls/comments/49684914"},"html":{"href":"https://github.com/square/flow/pull/118#discussion_r49684914"},"pull_request":{"href":"https://api.github.com/repos/square/flow/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/square/flow/pulls/118","id":55948379,"html_url":"https://github.com/square/flow/pull/118","diff_url":"https://github.com/square/flow/pull/118.diff","patch_url":"https://github.com/square/flow/pull/118.patch","issue_url":"https://api.github.com/repos/square/flow/issues/118","number":118,"state":"open","locked":false,"title":"integration/API improvements","user":{"login":"loganj","id":18877,"avatar_url":"https://avatars.githubusercontent.com/u/18877?v=3","gravatar_id":"","url":"https://api.github.com/users/loganj","html_url":"https://github.com/loganj","followers_url":"https://api.github.com/users/loganj/followers","following_url":"https://api.github.com/users/loganj/following{/other_user}","gists_url":"https://api.github.com/users/loganj/gists{/gist_id}","starred_url":"https://api.github.com/users/loganj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganj/subscriptions","organizations_url":"https://api.github.com/users/loganj/orgs","repos_url":"https://api.github.com/users/loganj/repos","events_url":"https://api.github.com/users/loganj/events{/privacy}","received_events_url":"https://api.github.com/users/loganj/received_events","type":"User","site_admin":false},"body":"Biggest wins here are in the integration touchpoints. Should be much easier to get started.\r\n\r\nAdded Hello World sample and a basic configured sample to demonstrate.","created_at":"2016-01-13T20:06:48Z","updated_at":"2016-01-14T03:43:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2677af00f2b10582d3fbb1cee542726ea859299","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/flow/pulls/118/commits","review_comments_url":"https://api.github.com/repos/square/flow/pulls/118/comments","review_comment_url":"https://api.github.com/repos/square/flow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/flow/issues/118/comments","statuses_url":"https://api.github.com/repos/square/flow/statuses/928a46881c60450ce459cbc4fd33bb92cc9870a6","head":{"label":"square:loganj/api","ref":"loganj/api","sha":"928a46881c60450ce459cbc4fd33bb92cc9870a6","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":12796207,"name":"flow","full_name":"square/flow","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/flow","description":"A small library that helps with describing an app as a collection of moderately independent screens. ","fork":false,"url":"https://api.github.com/repos/square/flow","forks_url":"https://api.github.com/repos/square/flow/forks","keys_url":"https://api.github.com/repos/square/flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/flow/teams","hooks_url":"https://api.github.com/repos/square/flow/hooks","issue_events_url":"https://api.github.com/repos/square/flow/issues/events{/number}","events_url":"https://api.github.com/repos/square/flow/events","assignees_url":"https://api.github.com/repos/square/flow/assignees{/user}","branches_url":"https://api.github.com/repos/square/flow/branches{/branch}","tags_url":"https://api.github.com/repos/square/flow/tags","blobs_url":"https://api.github.com/repos/square/flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/flow/statuses/{sha}","languages_url":"https://api.github.com/repos/square/flow/languages","stargazers_url":"https://api.github.com/repos/square/flow/stargazers","contributors_url":"https://api.github.com/repos/square/flow/contributors","subscribers_url":"https://api.github.com/repos/square/flow/subscribers","subscription_url":"https://api.github.com/repos/square/flow/subscription","commits_url":"https://api.github.com/repos/square/flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/flow/contents/{+path}","compare_url":"https://api.github.com/repos/square/flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/flow/merges","archive_url":"https://api.github.com/repos/square/flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/flow/downloads","issues_url":"https://api.github.com/repos/square/flow/issues{/number}","pulls_url":"https://api.github.com/repos/square/flow/pulls{/number}","milestones_url":"https://api.github.com/repos/square/flow/milestones{/number}","notifications_url":"https://api.github.com/repos/square/flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/flow/labels{/name}","releases_url":"https://api.github.com/repos/square/flow/releases{/id}","created_at":"2013-09-12T22:20:16Z","updated_at":"2016-01-12T06:48:32Z","pushed_at":"2016-01-13T22:45:48Z","git_url":"git://github.com/square/flow.git","ssh_url":"git@github.com:square/flow.git","clone_url":"https://github.com/square/flow.git","svn_url":"https://github.com/square/flow","homepage":"","size":736,"stargazers_count":1315,"watchers_count":1315,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":136,"mirror_url":null,"open_issues_count":19,"forks":136,"open_issues":19,"watchers":1315,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"7d398f6c9fcca5e675bc6d51a634cad8bcb2b22c","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":12796207,"name":"flow","full_name":"square/flow","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/flow","description":"A small library that helps with describing an app as a collection of moderately independent screens. ","fork":false,"url":"https://api.github.com/repos/square/flow","forks_url":"https://api.github.com/repos/square/flow/forks","keys_url":"https://api.github.com/repos/square/flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/flow/teams","hooks_url":"https://api.github.com/repos/square/flow/hooks","issue_events_url":"https://api.github.com/repos/square/flow/issues/events{/number}","events_url":"https://api.github.com/repos/square/flow/events","assignees_url":"https://api.github.com/repos/square/flow/assignees{/user}","branches_url":"https://api.github.com/repos/square/flow/branches{/branch}","tags_url":"https://api.github.com/repos/square/flow/tags","blobs_url":"https://api.github.com/repos/square/flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/flow/statuses/{sha}","languages_url":"https://api.github.com/repos/square/flow/languages","stargazers_url":"https://api.github.com/repos/square/flow/stargazers","contributors_url":"https://api.github.com/repos/square/flow/contributors","subscribers_url":"https://api.github.com/repos/square/flow/subscribers","subscription_url":"https://api.github.com/repos/square/flow/subscription","commits_url":"https://api.github.com/repos/square/flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/flow/contents/{+path}","compare_url":"https://api.github.com/repos/square/flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/flow/merges","archive_url":"https://api.github.com/repos/square/flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/flow/downloads","issues_url":"https://api.github.com/repos/square/flow/issues{/number}","pulls_url":"https://api.github.com/repos/square/flow/pulls{/number}","milestones_url":"https://api.github.com/repos/square/flow/milestones{/number}","notifications_url":"https://api.github.com/repos/square/flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/flow/labels{/name}","releases_url":"https://api.github.com/repos/square/flow/releases{/id}","created_at":"2013-09-12T22:20:16Z","updated_at":"2016-01-12T06:48:32Z","pushed_at":"2016-01-13T22:45:48Z","git_url":"git://github.com/square/flow.git","ssh_url":"git@github.com:square/flow.git","clone_url":"https://github.com/square/flow.git","svn_url":"https://github.com/square/flow","homepage":"","size":736,"stargazers_count":1315,"watchers_count":1315,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":136,"mirror_url":null,"open_issues_count":19,"forks":136,"open_issues":19,"watchers":1315,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/flow/pulls/118"},"html":{"href":"https://github.com/square/flow/pull/118"},"issue":{"href":"https://api.github.com/repos/square/flow/issues/118"},"comments":{"href":"https://api.github.com/repos/square/flow/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/square/flow/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/square/flow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/flow/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/square/flow/statuses/928a46881c60450ce459cbc4fd33bb92cc9870a6"}}}}