{"action":"created","comment":{"url":"https://api.github.com/repos/rock3r/squanchy/pulls/comments/109197249","pull_request_review_id":30287183,"id":109197249,"diff_hunk":"@@ -0,0 +1,61 @@\n+package net.squanchy.home;\n+\n+import android.support.design.widget.BaseTransientBottomBar;\n+import android.support.design.widget.Snackbar;\n+import android.view.View;\n+\n+import java.util.Locale;\n+\n+import net.squanchy.R;\n+import net.squanchy.schedule.domain.view.Event;\n+import net.squanchy.service.firebase.FirebaseAuthService;\n+import net.squanchy.service.repository.EventRepository;\n+import net.squanchy.support.system.CurrentTime;\n+\n+import org.joda.time.format.DateTimeFormat;\n+import org.joda.time.format.DateTimeFormatter;\n+\n+import io.reactivex.Maybe;\n+import io.reactivex.Observable;\n+\n+public class CurrentEventSnackbarService {\n+\n+    private static final String WHEN_DATE_TIME_FORMAT = \"HH:mm\";\n+    private final EventRepository eventRepository;\n+    private final FirebaseAuthService authService;\n+    private final CurrentTime currentTime;\n+\n+    public CurrentEventSnackbarService(EventRepository eventRepository, FirebaseAuthService authService, CurrentTime currentTime) {\n+        this.eventRepository = eventRepository;\n+        this.authService = authService;\n+        this.currentTime = currentTime;\n+    }\n+\n+    public Maybe<Event> eventIn(String placeId) {\n+        return authService.ifUserSignedInThenObservableFrom(eventRepository::events)\n+                .flatMap(Observable::fromIterable)\n+                .filter(event -> event.place().isPresent())\n+                .filter(event -> event.place().get().id().equals(placeId))\n+                .filter(event -> event.isDuring(currentTime.getLocalDateTime()))\n+                .firstElement();\n+    }\n+\n+    public Snackbar buildSnackbar(View view, Event event, View.OnClickListener listener) {\n+        Snackbar snackbar = Snackbar.make(view, buildString(event), BaseTransientBottomBar.LENGTH_INDEFINITE);\n+        snackbar.setAction(R.string.event_details, listener);\n+        snackbar.setActionTextColor(view.getResources().getColor(R.color.text_inverse));","path":"app/src/main/java/net/squanchy/home/CurrentEventSnackbarService.java","position":46,"original_position":46,"commit_id":"00abb8291f5f9abca03063fcaeb3b6b298534395","original_commit_id":"00abb8291f5f9abca03063fcaeb3b6b298534395","user":{"login":"rock3r","id":153802,"avatar_url":"https://avatars1.githubusercontent.com/u/153802?v=3","gravatar_id":"","url":"https://api.github.com/users/rock3r","html_url":"https://github.com/rock3r","followers_url":"https://api.github.com/users/rock3r/followers","following_url":"https://api.github.com/users/rock3r/following{/other_user}","gists_url":"https://api.github.com/users/rock3r/gists{/gist_id}","starred_url":"https://api.github.com/users/rock3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rock3r/subscriptions","organizations_url":"https://api.github.com/users/rock3r/orgs","repos_url":"https://api.github.com/users/rock3r/repos","events_url":"https://api.github.com/users/rock3r/events{/privacy}","received_events_url":"https://api.github.com/users/rock3r/received_events","type":"User","site_admin":false},"body":"This should not be necessary if the context is themed correctly... We should look into this (in a separate PR)","created_at":"2017-03-31T16:18:41Z","updated_at":"2017-03-31T16:25:30Z","html_url":"https://github.com/rock3r/squanchy/pull/221#discussion_r109197249","pull_request_url":"https://api.github.com/repos/rock3r/squanchy/pulls/221","_links":{"self":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/comments/109197249"},"html":{"href":"https://github.com/rock3r/squanchy/pull/221#discussion_r109197249"},"pull_request":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/221"}}},"pull_request":{"url":"https://api.github.com/repos/rock3r/squanchy/pulls/221","id":113677425,"html_url":"https://github.com/rock3r/squanchy/pull/221","diff_url":"https://github.com/rock3r/squanchy/pull/221.diff","patch_url":"https://github.com/rock3r/squanchy/pull/221.patch","issue_url":"https://api.github.com/repos/rock3r/squanchy/issues/221","number":221,"state":"open","locked":false,"title":"Speech details snackbar by room proximity","user":{"login":"catt-stefano","id":11888433,"avatar_url":"https://avatars0.githubusercontent.com/u/11888433?v=3","gravatar_id":"","url":"https://api.github.com/users/catt-stefano","html_url":"https://github.com/catt-stefano","followers_url":"https://api.github.com/users/catt-stefano/followers","following_url":"https://api.github.com/users/catt-stefano/following{/other_user}","gists_url":"https://api.github.com/users/catt-stefano/gists{/gist_id}","starred_url":"https://api.github.com/users/catt-stefano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catt-stefano/subscriptions","organizations_url":"https://api.github.com/users/catt-stefano/orgs","repos_url":"https://api.github.com/users/catt-stefano/repos","events_url":"https://api.github.com/users/catt-stefano/events{/privacy}","received_events_url":"https://api.github.com/users/catt-stefano/received_events","type":"User","site_admin":false},"body":"Proximity feature: passing near a room from any screen of the homeactivity, triggers a snackbar with info on the current speech in that room.","created_at":"2017-03-31T15:42:23Z","updated_at":"2017-03-31T16:25:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86b1b33af8b0e906009d14e748e712172b4adfab","assignee":{"login":"rock3r","id":153802,"avatar_url":"https://avatars1.githubusercontent.com/u/153802?v=3","gravatar_id":"","url":"https://api.github.com/users/rock3r","html_url":"https://github.com/rock3r","followers_url":"https://api.github.com/users/rock3r/followers","following_url":"https://api.github.com/users/rock3r/following{/other_user}","gists_url":"https://api.github.com/users/rock3r/gists{/gist_id}","starred_url":"https://api.github.com/users/rock3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rock3r/subscriptions","organizations_url":"https://api.github.com/users/rock3r/orgs","repos_url":"https://api.github.com/users/rock3r/repos","events_url":"https://api.github.com/users/rock3r/events{/privacy}","received_events_url":"https://api.github.com/users/rock3r/received_events","type":"User","site_admin":false},"assignees":[{"login":"rock3r","id":153802,"avatar_url":"https://avatars1.githubusercontent.com/u/153802?v=3","gravatar_id":"","url":"https://api.github.com/users/rock3r","html_url":"https://github.com/rock3r","followers_url":"https://api.github.com/users/rock3r/followers","following_url":"https://api.github.com/users/rock3r/following{/other_user}","gists_url":"https://api.github.com/users/rock3r/gists{/gist_id}","starred_url":"https://api.github.com/users/rock3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rock3r/subscriptions","organizations_url":"https://api.github.com/users/rock3r/orgs","repos_url":"https://api.github.com/users/rock3r/repos","events_url":"https://api.github.com/users/rock3r/events{/privacy}","received_events_url":"https://api.github.com/users/rock3r/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rock3r/squanchy/pulls/221/commits","review_comments_url":"https://api.github.com/repos/rock3r/squanchy/pulls/221/comments","review_comment_url":"https://api.github.com/repos/rock3r/squanchy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rock3r/squanchy/issues/221/comments","statuses_url":"https://api.github.com/repos/rock3r/squanchy/statuses/00abb8291f5f9abca03063fcaeb3b6b298534395","head":{"label":"nearit:proximity_room","ref":"proximity_room","sha":"00abb8291f5f9abca03063fcaeb3b6b298534395","user":{"login":"nearit","id":18052069,"avatar_url":"https://avatars3.githubusercontent.com/u/18052069?v=3","gravatar_id":"","url":"https://api.github.com/users/nearit","html_url":"https://github.com/nearit","followers_url":"https://api.github.com/users/nearit/followers","following_url":"https://api.github.com/users/nearit/following{/other_user}","gists_url":"https://api.github.com/users/nearit/gists{/gist_id}","starred_url":"https://api.github.com/users/nearit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearit/subscriptions","organizations_url":"https://api.github.com/users/nearit/orgs","repos_url":"https://api.github.com/users/nearit/repos","events_url":"https://api.github.com/users/nearit/events{/privacy}","received_events_url":"https://api.github.com/users/nearit/received_events","type":"Organization","site_admin":false},"repo":{"id":84953675,"name":"squanchy","full_name":"nearit/squanchy","owner":{"login":"nearit","id":18052069,"avatar_url":"https://avatars3.githubusercontent.com/u/18052069?v=3","gravatar_id":"","url":"https://api.github.com/users/nearit","html_url":"https://github.com/nearit","followers_url":"https://api.github.com/users/nearit/followers","following_url":"https://api.github.com/users/nearit/following{/other_user}","gists_url":"https://api.github.com/users/nearit/gists{/gist_id}","starred_url":"https://api.github.com/users/nearit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearit/subscriptions","organizations_url":"https://api.github.com/users/nearit/orgs","repos_url":"https://api.github.com/users/nearit/repos","events_url":"https://api.github.com/users/nearit/events{/privacy}","received_events_url":"https://api.github.com/users/nearit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nearit/squanchy","description":"Open source app for your conferences","fork":true,"url":"https://api.github.com/repos/nearit/squanchy","forks_url":"https://api.github.com/repos/nearit/squanchy/forks","keys_url":"https://api.github.com/repos/nearit/squanchy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nearit/squanchy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nearit/squanchy/teams","hooks_url":"https://api.github.com/repos/nearit/squanchy/hooks","issue_events_url":"https://api.github.com/repos/nearit/squanchy/issues/events{/number}","events_url":"https://api.github.com/repos/nearit/squanchy/events","assignees_url":"https://api.github.com/repos/nearit/squanchy/assignees{/user}","branches_url":"https://api.github.com/repos/nearit/squanchy/branches{/branch}","tags_url":"https://api.github.com/repos/nearit/squanchy/tags","blobs_url":"https://api.github.com/repos/nearit/squanchy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nearit/squanchy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nearit/squanchy/git/refs{/sha}","trees_url":"https://api.github.com/repos/nearit/squanchy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nearit/squanchy/statuses/{sha}","languages_url":"https://api.github.com/repos/nearit/squanchy/languages","stargazers_url":"https://api.github.com/repos/nearit/squanchy/stargazers","contributors_url":"https://api.github.com/repos/nearit/squanchy/contributors","subscribers_url":"https://api.github.com/repos/nearit/squanchy/subscribers","subscription_url":"https://api.github.com/repos/nearit/squanchy/subscription","commits_url":"https://api.github.com/repos/nearit/squanchy/commits{/sha}","git_commits_url":"https://api.github.com/repos/nearit/squanchy/git/commits{/sha}","comments_url":"https://api.github.com/repos/nearit/squanchy/comments{/number}","issue_comment_url":"https://api.github.com/repos/nearit/squanchy/issues/comments{/number}","contents_url":"https://api.github.com/repos/nearit/squanchy/contents/{+path}","compare_url":"https://api.github.com/repos/nearit/squanchy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nearit/squanchy/merges","archive_url":"https://api.github.com/repos/nearit/squanchy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nearit/squanchy/downloads","issues_url":"https://api.github.com/repos/nearit/squanchy/issues{/number}","pulls_url":"https://api.github.com/repos/nearit/squanchy/pulls{/number}","milestones_url":"https://api.github.com/repos/nearit/squanchy/milestones{/number}","notifications_url":"https://api.github.com/repos/nearit/squanchy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nearit/squanchy/labels{/name}","releases_url":"https://api.github.com/repos/nearit/squanchy/releases{/id}","deployments_url":"https://api.github.com/repos/nearit/squanchy/deployments","created_at":"2017-03-14T13:43:06Z","updated_at":"2017-03-14T13:43:07Z","pushed_at":"2017-03-31T16:13:46Z","git_url":"git://github.com/nearit/squanchy.git","ssh_url":"git@github.com:nearit/squanchy.git","clone_url":"https://github.com/nearit/squanchy.git","svn_url":"https://github.com/nearit/squanchy","homepage":"","size":21621,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"rock3r:SQ-60/onboarding_feature","ref":"SQ-60/onboarding_feature","sha":"477ecdcd1b98c1352ec46f0f79d49577aeba3d99","user":{"login":"rock3r","id":153802,"avatar_url":"https://avatars1.githubusercontent.com/u/153802?v=3","gravatar_id":"","url":"https://api.github.com/users/rock3r","html_url":"https://github.com/rock3r","followers_url":"https://api.github.com/users/rock3r/followers","following_url":"https://api.github.com/users/rock3r/following{/other_user}","gists_url":"https://api.github.com/users/rock3r/gists{/gist_id}","starred_url":"https://api.github.com/users/rock3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rock3r/subscriptions","organizations_url":"https://api.github.com/users/rock3r/orgs","repos_url":"https://api.github.com/users/rock3r/repos","events_url":"https://api.github.com/users/rock3r/events{/privacy}","received_events_url":"https://api.github.com/users/rock3r/received_events","type":"User","site_admin":false},"repo":{"id":72942055,"name":"squanchy","full_name":"rock3r/squanchy","owner":{"login":"rock3r","id":153802,"avatar_url":"https://avatars1.githubusercontent.com/u/153802?v=3","gravatar_id":"","url":"https://api.github.com/users/rock3r","html_url":"https://github.com/rock3r","followers_url":"https://api.github.com/users/rock3r/followers","following_url":"https://api.github.com/users/rock3r/following{/other_user}","gists_url":"https://api.github.com/users/rock3r/gists{/gist_id}","starred_url":"https://api.github.com/users/rock3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rock3r/subscriptions","organizations_url":"https://api.github.com/users/rock3r/orgs","repos_url":"https://api.github.com/users/rock3r/repos","events_url":"https://api.github.com/users/rock3r/events{/privacy}","received_events_url":"https://api.github.com/users/rock3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rock3r/squanchy","description":"Open source app for your conferences","fork":false,"url":"https://api.github.com/repos/rock3r/squanchy","forks_url":"https://api.github.com/repos/rock3r/squanchy/forks","keys_url":"https://api.github.com/repos/rock3r/squanchy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rock3r/squanchy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rock3r/squanchy/teams","hooks_url":"https://api.github.com/repos/rock3r/squanchy/hooks","issue_events_url":"https://api.github.com/repos/rock3r/squanchy/issues/events{/number}","events_url":"https://api.github.com/repos/rock3r/squanchy/events","assignees_url":"https://api.github.com/repos/rock3r/squanchy/assignees{/user}","branches_url":"https://api.github.com/repos/rock3r/squanchy/branches{/branch}","tags_url":"https://api.github.com/repos/rock3r/squanchy/tags","blobs_url":"https://api.github.com/repos/rock3r/squanchy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rock3r/squanchy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rock3r/squanchy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rock3r/squanchy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rock3r/squanchy/statuses/{sha}","languages_url":"https://api.github.com/repos/rock3r/squanchy/languages","stargazers_url":"https://api.github.com/repos/rock3r/squanchy/stargazers","contributors_url":"https://api.github.com/repos/rock3r/squanchy/contributors","subscribers_url":"https://api.github.com/repos/rock3r/squanchy/subscribers","subscription_url":"https://api.github.com/repos/rock3r/squanchy/subscription","commits_url":"https://api.github.com/repos/rock3r/squanchy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rock3r/squanchy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rock3r/squanchy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rock3r/squanchy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rock3r/squanchy/contents/{+path}","compare_url":"https://api.github.com/repos/rock3r/squanchy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rock3r/squanchy/merges","archive_url":"https://api.github.com/repos/rock3r/squanchy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rock3r/squanchy/downloads","issues_url":"https://api.github.com/repos/rock3r/squanchy/issues{/number}","pulls_url":"https://api.github.com/repos/rock3r/squanchy/pulls{/number}","milestones_url":"https://api.github.com/repos/rock3r/squanchy/milestones{/number}","notifications_url":"https://api.github.com/repos/rock3r/squanchy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rock3r/squanchy/labels{/name}","releases_url":"https://api.github.com/repos/rock3r/squanchy/releases{/id}","deployments_url":"https://api.github.com/repos/rock3r/squanchy/deployments","created_at":"2016-11-05T17:26:17Z","updated_at":"2017-03-16T15:23:45Z","pushed_at":"2017-03-31T16:13:47Z","git_url":"git://github.com/rock3r/squanchy.git","ssh_url":"git@github.com:rock3r/squanchy.git","clone_url":"https://github.com/rock3r/squanchy.git","svn_url":"https://github.com/rock3r/squanchy","homepage":"","size":21648,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":24,"forks":3,"open_issues":24,"watchers":7,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/221"},"html":{"href":"https://github.com/rock3r/squanchy/pull/221"},"issue":{"href":"https://api.github.com/repos/rock3r/squanchy/issues/221"},"comments":{"href":"https://api.github.com/repos/rock3r/squanchy/issues/221/comments"},"review_comments":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/221/comments"},"review_comment":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rock3r/squanchy/pulls/221/commits"},"statuses":{"href":"https://api.github.com/repos/rock3r/squanchy/statuses/00abb8291f5f9abca03063fcaeb3b6b298534395"}}}}
{"actor":{"display_login":"rock3r"}}