{"action":"created","comment":{"url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/comments/45103866","id":45103866,"diff_hunk":"@@ -0,0 +1,105 @@\n+package co.touchlab.droidconandroid\n+\n+import android.os.Bundle\n+import android.support.v4.app.DialogFragment\n+import android.view\n+import android.view.LayoutInflater\n+import android.view.View\n+import android.widget.RatingBar\n+import android.widget.TextView\n+import co.touchlab.android.threading.eventbus.EventBusExt\n+import co.touchlab.droidconandroid.data.DatabaseHelper\n+import co.touchlab.droidconandroid.data.TalkSubmission\n+import co.touchlab.droidconandroid.tasks.persisted.PersistedTaskQueueFactory\n+import co.touchlab.droidconandroid.tasks.persisted.UpdateVotePersisted\n+import co.touchlab.droidconandroid.ui.RemoveTalkListener\n+\n+\n+/**\n+ *\n+ * Created by toidiu on 8/5/15.\n+ */\n+class VoteDetailFragment : DialogFragment() {\n+\n+    companion object {\n+        val TALK = \"TALK\"\n+\n+        fun newInstance(talk: TalkSubmission): VoteDetailFragment {\n+            val fragment = VoteDetailFragment()\n+            val args = Bundle()\n+            args.putSerializable(TALK, talk)\n+            fragment.arguments = args\n+            fragment.isCancelable = true\n+            return fragment\n+        }\n+    }\n+\n+    var rating: RatingBar? = null\n+    var talk: TalkSubmission? = null\n+\n+    override fun onCreateView(inflater: LayoutInflater?, container: view.ViewGroup?, savedInstanceState: Bundle?): View? {\n+        return inflater!!.inflate(R.layout.fragment_vote_detail, null)\n+    }\n+\n+    override fun onCreate(savedInstanceState: Bundle?) {\n+        super<DialogFragment>.onCreate(savedInstanceState)\n+        talk = arguments.getSerializable(TALK) as TalkSubmission\n+\n+    }\n+\n+    override fun onActivityCreated(savedInstanceState: Bundle?) {\n+        super<DialogFragment>.onActivityCreated(savedInstanceState)\n+\n+        initEvent()\n+    }\n+\n+    fun initEvent() {\n+        val title = view.findViewById(R.id.title) as TextView\n+        val descrip = view.findViewById(R.id.description) as TextView\n+        val speaker = view.findViewById(R.id.speaker) as TextView\n+\n+\n+        val cancel = view.findViewById(R.id.cancel)\n+        val pass = view.findViewById(R.id.pass) as TextView\n+        val submit = view.findViewById(R.id.submit_vote) as TextView\n+\n+\n+        title.text = talk!!.title\n+        descrip.text = talk!!.description\n+        speaker.text = talk!!.speaker\n+\n+        cancel.setOnClickListener { dismiss() }\n+        pass.setOnClickListener {\n+            talk!!.vote = 0\n+            updateTalk()\n+            dismiss()\n+        }\n+        submit.setOnClickListener {\n+            updateTalk()\n+            dismiss()\n+        }\n+\n+        initRating()\n+    }\n+\n+    private fun updateTalk() {\n+        val dao = DatabaseHelper.getInstance(activity).talkSubDao\n+        PersistedTaskQueueFactory.getInstance(activity).execute(UpdateVotePersisted(talk!!.id, talk!!.vote))\n+        dao.update(talk)","path":"app/src/main/kotlin/co/touchlab/droidconandroid/VoteDetailFragment.kt","position":88,"original_position":88,"commit_id":"e743f541d841f7876c7d3ecca5c26d9f21f6fd3a","original_commit_id":"aba2b8a29ff9cc460a08a454e65be9b53c26f838","user":{"login":"toidiu","id":4350690,"avatar_url":"https://avatars.githubusercontent.com/u/4350690?v=3","gravatar_id":"","url":"https://api.github.com/users/toidiu","html_url":"https://github.com/toidiu","followers_url":"https://api.github.com/users/toidiu/followers","following_url":"https://api.github.com/users/toidiu/following{/other_user}","gists_url":"https://api.github.com/users/toidiu/gists{/gist_id}","starred_url":"https://api.github.com/users/toidiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toidiu/subscriptions","organizations_url":"https://api.github.com/users/toidiu/orgs","repos_url":"https://api.github.com/users/toidiu/repos","events_url":"https://api.github.com/users/toidiu/events{/privacy}","received_events_url":"https://api.github.com/users/toidiu/received_events","type":"User","site_admin":false},"body":"the app needs to work offline so we cant wait for the persisted task to happen before doing something. (what happens if there is no network)\r\n\r\nThat edge of the GetTalkSubmissionPersisited currently running is an edge case that kevin said not to worry about(good insight though!)","created_at":"2015-11-17T19:04:30Z","updated_at":"2015-11-17T19:04:30Z","html_url":"https://github.com/touchlab/DroidconApp/pull/27#discussion_r45103866","pull_request_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/comments/45103866"},"html":{"href":"https://github.com/touchlab/DroidconApp/pull/27#discussion_r45103866"},"pull_request":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27","id":50838581,"html_url":"https://github.com/touchlab/DroidconApp/pull/27","diff_url":"https://github.com/touchlab/DroidconApp/pull/27.diff","patch_url":"https://github.com/touchlab/DroidconApp/pull/27.patch","issue_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/27","number":27,"state":"open","locked":false,"title":"Ak1104 voting","user":{"login":"toidiu","id":4350690,"avatar_url":"https://avatars.githubusercontent.com/u/4350690?v=3","gravatar_id":"","url":"https://api.github.com/users/toidiu","html_url":"https://github.com/toidiu","followers_url":"https://api.github.com/users/toidiu/followers","following_url":"https://api.github.com/users/toidiu/following{/other_user}","gists_url":"https://api.github.com/users/toidiu/gists{/gist_id}","starred_url":"https://api.github.com/users/toidiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toidiu/subscriptions","organizations_url":"https://api.github.com/users/toidiu/orgs","repos_url":"https://api.github.com/users/toidiu/repos","events_url":"https://api.github.com/users/toidiu/events{/privacy}","received_events_url":"https://api.github.com/users/toidiu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-16T17:16:39Z","updated_at":"2015-11-17T19:04:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00d7502e71b2324552e59ac776752077dcf0995e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27/commits","review_comments_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27/comments","review_comment_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/27/comments","statuses_url":"https://api.github.com/repos/touchlab/DroidconApp/statuses/e743f541d841f7876c7d3ecca5c26d9f21f6fd3a","head":{"label":"touchlab:ak1104_voting","ref":"ak1104_voting","sha":"e743f541d841f7876c7d3ecca5c26d9f21f6fd3a","user":{"login":"touchlab","id":1178714,"avatar_url":"https://avatars.githubusercontent.com/u/1178714?v=3","gravatar_id":"","url":"https://api.github.com/users/touchlab","html_url":"https://github.com/touchlab","followers_url":"https://api.github.com/users/touchlab/followers","following_url":"https://api.github.com/users/touchlab/following{/other_user}","gists_url":"https://api.github.com/users/touchlab/gists{/gist_id}","starred_url":"https://api.github.com/users/touchlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/touchlab/subscriptions","organizations_url":"https://api.github.com/users/touchlab/orgs","repos_url":"https://api.github.com/users/touchlab/repos","events_url":"https://api.github.com/users/touchlab/events{/privacy}","received_events_url":"https://api.github.com/users/touchlab/received_events","type":"Organization","site_admin":false},"repo":{"id":21587291,"name":"DroidconApp","full_name":"touchlab/DroidconApp","owner":{"login":"touchlab","id":1178714,"avatar_url":"https://avatars.githubusercontent.com/u/1178714?v=3","gravatar_id":"","url":"https://api.github.com/users/touchlab","html_url":"https://github.com/touchlab","followers_url":"https://api.github.com/users/touchlab/followers","following_url":"https://api.github.com/users/touchlab/following{/other_user}","gists_url":"https://api.github.com/users/touchlab/gists{/gist_id}","starred_url":"https://api.github.com/users/touchlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/touchlab/subscriptions","organizations_url":"https://api.github.com/users/touchlab/orgs","repos_url":"https://api.github.com/users/touchlab/repos","events_url":"https://api.github.com/users/touchlab/events{/privacy}","received_events_url":"https://api.github.com/users/touchlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/touchlab/DroidconApp","description":"Droidcon NYC's Android app","fork":false,"url":"https://api.github.com/repos/touchlab/DroidconApp","forks_url":"https://api.github.com/repos/touchlab/DroidconApp/forks","keys_url":"https://api.github.com/repos/touchlab/DroidconApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/touchlab/DroidconApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/touchlab/DroidconApp/teams","hooks_url":"https://api.github.com/repos/touchlab/DroidconApp/hooks","issue_events_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/events{/number}","events_url":"https://api.github.com/repos/touchlab/DroidconApp/events","assignees_url":"https://api.github.com/repos/touchlab/DroidconApp/assignees{/user}","branches_url":"https://api.github.com/repos/touchlab/DroidconApp/branches{/branch}","tags_url":"https://api.github.com/repos/touchlab/DroidconApp/tags","blobs_url":"https://api.github.com/repos/touchlab/DroidconApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/touchlab/DroidconApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/touchlab/DroidconApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/touchlab/DroidconApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/touchlab/DroidconApp/statuses/{sha}","languages_url":"https://api.github.com/repos/touchlab/DroidconApp/languages","stargazers_url":"https://api.github.com/repos/touchlab/DroidconApp/stargazers","contributors_url":"https://api.github.com/repos/touchlab/DroidconApp/contributors","subscribers_url":"https://api.github.com/repos/touchlab/DroidconApp/subscribers","subscription_url":"https://api.github.com/repos/touchlab/DroidconApp/subscription","commits_url":"https://api.github.com/repos/touchlab/DroidconApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/touchlab/DroidconApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/touchlab/DroidconApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/touchlab/DroidconApp/contents/{+path}","compare_url":"https://api.github.com/repos/touchlab/DroidconApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/touchlab/DroidconApp/merges","archive_url":"https://api.github.com/repos/touchlab/DroidconApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/touchlab/DroidconApp/downloads","issues_url":"https://api.github.com/repos/touchlab/DroidconApp/issues{/number}","pulls_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls{/number}","milestones_url":"https://api.github.com/repos/touchlab/DroidconApp/milestones{/number}","notifications_url":"https://api.github.com/repos/touchlab/DroidconApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/touchlab/DroidconApp/labels{/name}","releases_url":"https://api.github.com/repos/touchlab/DroidconApp/releases{/id}","created_at":"2014-07-07T21:24:42Z","updated_at":"2015-11-03T11:27:08Z","pushed_at":"2015-11-17T16:57:21Z","git_url":"git://github.com/touchlab/DroidconApp.git","ssh_url":"git@github.com:touchlab/DroidconApp.git","clone_url":"https://github.com/touchlab/DroidconApp.git","svn_url":"https://github.com/touchlab/DroidconApp","homepage":"","size":7308,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":26,"default_branch":"master"}},"base":{"label":"touchlab:master","ref":"master","sha":"52342613e8273eca9bc85c92d498c206e2c98ed9","user":{"login":"touchlab","id":1178714,"avatar_url":"https://avatars.githubusercontent.com/u/1178714?v=3","gravatar_id":"","url":"https://api.github.com/users/touchlab","html_url":"https://github.com/touchlab","followers_url":"https://api.github.com/users/touchlab/followers","following_url":"https://api.github.com/users/touchlab/following{/other_user}","gists_url":"https://api.github.com/users/touchlab/gists{/gist_id}","starred_url":"https://api.github.com/users/touchlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/touchlab/subscriptions","organizations_url":"https://api.github.com/users/touchlab/orgs","repos_url":"https://api.github.com/users/touchlab/repos","events_url":"https://api.github.com/users/touchlab/events{/privacy}","received_events_url":"https://api.github.com/users/touchlab/received_events","type":"Organization","site_admin":false},"repo":{"id":21587291,"name":"DroidconApp","full_name":"touchlab/DroidconApp","owner":{"login":"touchlab","id":1178714,"avatar_url":"https://avatars.githubusercontent.com/u/1178714?v=3","gravatar_id":"","url":"https://api.github.com/users/touchlab","html_url":"https://github.com/touchlab","followers_url":"https://api.github.com/users/touchlab/followers","following_url":"https://api.github.com/users/touchlab/following{/other_user}","gists_url":"https://api.github.com/users/touchlab/gists{/gist_id}","starred_url":"https://api.github.com/users/touchlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/touchlab/subscriptions","organizations_url":"https://api.github.com/users/touchlab/orgs","repos_url":"https://api.github.com/users/touchlab/repos","events_url":"https://api.github.com/users/touchlab/events{/privacy}","received_events_url":"https://api.github.com/users/touchlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/touchlab/DroidconApp","description":"Droidcon NYC's Android app","fork":false,"url":"https://api.github.com/repos/touchlab/DroidconApp","forks_url":"https://api.github.com/repos/touchlab/DroidconApp/forks","keys_url":"https://api.github.com/repos/touchlab/DroidconApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/touchlab/DroidconApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/touchlab/DroidconApp/teams","hooks_url":"https://api.github.com/repos/touchlab/DroidconApp/hooks","issue_events_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/events{/number}","events_url":"https://api.github.com/repos/touchlab/DroidconApp/events","assignees_url":"https://api.github.com/repos/touchlab/DroidconApp/assignees{/user}","branches_url":"https://api.github.com/repos/touchlab/DroidconApp/branches{/branch}","tags_url":"https://api.github.com/repos/touchlab/DroidconApp/tags","blobs_url":"https://api.github.com/repos/touchlab/DroidconApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/touchlab/DroidconApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/touchlab/DroidconApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/touchlab/DroidconApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/touchlab/DroidconApp/statuses/{sha}","languages_url":"https://api.github.com/repos/touchlab/DroidconApp/languages","stargazers_url":"https://api.github.com/repos/touchlab/DroidconApp/stargazers","contributors_url":"https://api.github.com/repos/touchlab/DroidconApp/contributors","subscribers_url":"https://api.github.com/repos/touchlab/DroidconApp/subscribers","subscription_url":"https://api.github.com/repos/touchlab/DroidconApp/subscription","commits_url":"https://api.github.com/repos/touchlab/DroidconApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/touchlab/DroidconApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/touchlab/DroidconApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/touchlab/DroidconApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/touchlab/DroidconApp/contents/{+path}","compare_url":"https://api.github.com/repos/touchlab/DroidconApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/touchlab/DroidconApp/merges","archive_url":"https://api.github.com/repos/touchlab/DroidconApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/touchlab/DroidconApp/downloads","issues_url":"https://api.github.com/repos/touchlab/DroidconApp/issues{/number}","pulls_url":"https://api.github.com/repos/touchlab/DroidconApp/pulls{/number}","milestones_url":"https://api.github.com/repos/touchlab/DroidconApp/milestones{/number}","notifications_url":"https://api.github.com/repos/touchlab/DroidconApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/touchlab/DroidconApp/labels{/name}","releases_url":"https://api.github.com/repos/touchlab/DroidconApp/releases{/id}","created_at":"2014-07-07T21:24:42Z","updated_at":"2015-11-03T11:27:08Z","pushed_at":"2015-11-17T16:57:21Z","git_url":"git://github.com/touchlab/DroidconApp.git","ssh_url":"git@github.com:touchlab/DroidconApp.git","clone_url":"https://github.com/touchlab/DroidconApp.git","svn_url":"https://github.com/touchlab/DroidconApp","homepage":"","size":7308,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27"},"html":{"href":"https://github.com/touchlab/DroidconApp/pull/27"},"issue":{"href":"https://api.github.com/repos/touchlab/DroidconApp/issues/27"},"comments":{"href":"https://api.github.com/repos/touchlab/DroidconApp/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/touchlab/DroidconApp/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/touchlab/DroidconApp/statuses/e743f541d841f7876c7d3ecca5c26d9f21f6fd3a"}}}}