{"action":"created","comment":{"url":"https://api.github.com/repos/at-ync/Painter/pulls/comments/77483523","id":77483523,"diff_hunk":"@@ -1,16 +1,83 @@\n package com.asiantech.intern.painter.activities;\n \n+import android.content.Intent;\n+import android.database.Cursor;\n+import android.graphics.Bitmap;\n+import android.graphics.BitmapFactory;\n+import android.net.Uri;\n+import android.provider.MediaStore;\n+import android.util.Log;\n+\n import com.asiantech.intern.painter.R;\n \n+import org.androidannotations.annotations.Click;\n import org.androidannotations.annotations.EActivity;\n import org.androidannotations.annotations.Fullscreen;\n+import org.androidannotations.annotations.OnActivityResult;\n+\n+import java.io.IOException;\n \n @Fullscreen\n @EActivity(R.layout.activity_main)\n public class MainActivity extends BaseActivity {\n+    private static final int REQUEST_CAMERA = 101;\n+    private static final int REQUEST_PHOTO = 202;\n+    private static final String TAG = MainActivity.class.getName();\n \n     @Override\n     void afterViews() {\n \n     }\n+\n+    @Click(R.id.circleImageViewCamera)\n+    void openCamera() {\n+        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n+        startActivityForResult(intent, REQUEST_CAMERA);\n+    }\n+\n+    @Click(R.id.circleImageViewPhoto)\n+    void selectPhotoFromGallery() {\n+        Intent intent = new Intent();\n+        intent.setType(\"image/*\");\n+        intent.setAction(Intent.ACTION_GET_CONTENT);\n+        startActivityForResult(intent, REQUEST_PHOTO);\n+    }\n+\n+    @OnActivityResult(REQUEST_CAMERA)\n+    void captureImageResult(int resultCode, Intent data) {\n+        if (resultCode == RESULT_OK) {\n+            HomeActivity_.intent(this).setData(onCaptureImageResult(data)).start();\n+        }\n+    }\n+\n+    @OnActivityResult(REQUEST_PHOTO)\n+    void selectFromGalleryResult(int resultCode, Intent data) {\n+        if (resultCode == RESULT_OK) {\n+            HomeActivity_.intent(this).setData(onSelectFromGalleryResult(data)).start();\n+        }\n+    }\n+\n+    public Bitmap onCaptureImageResult(Intent data) {","path":"app/src/main/java/com/asiantech/intern/painter/activities/MainActivity.java","position":60,"original_position":60,"commit_id":"c9240a592440f0d2987f1cb0ae7e845f337014c3","original_commit_id":"c9240a592440f0d2987f1cb0ae7e845f337014c3","user":{"login":"at-binc","id":16132112,"avatar_url":"https://avatars.githubusercontent.com/u/16132112?v=3","gravatar_id":"","url":"https://api.github.com/users/at-binc","html_url":"https://github.com/at-binc","followers_url":"https://api.github.com/users/at-binc/followers","following_url":"https://api.github.com/users/at-binc/following{/other_user}","gists_url":"https://api.github.com/users/at-binc/gists{/gist_id}","starred_url":"https://api.github.com/users/at-binc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-binc/subscriptions","organizations_url":"https://api.github.com/users/at-binc/orgs","repos_url":"https://api.github.com/users/at-binc/repos","events_url":"https://api.github.com/users/at-binc/events{/privacy}","received_events_url":"https://api.github.com/users/at-binc/received_events","type":"User","site_admin":false},"body":"hàm nj nên dùng private","created_at":"2016-09-05T08:08:45Z","updated_at":"2016-09-05T08:08:45Z","html_url":"https://github.com/at-ync/Painter/pull/11#discussion_r77483523","pull_request_url":"https://api.github.com/repos/at-ync/Painter/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/comments/77483523"},"html":{"href":"https://github.com/at-ync/Painter/pull/11#discussion_r77483523"},"pull_request":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/at-ync/Painter/pulls/11","id":83963283,"html_url":"https://github.com/at-ync/Painter/pull/11","diff_url":"https://github.com/at-ync/Painter/pull/11.diff","patch_url":"https://github.com/at-ync/Painter/pull/11.patch","issue_url":"https://api.github.com/repos/at-ync/Painter/issues/11","number":11,"state":"open","locked":false,"title":"Open camera","user":{"login":"at-ync","id":7977161,"avatar_url":"https://avatars.githubusercontent.com/u/7977161?v=3","gravatar_id":"","url":"https://api.github.com/users/at-ync","html_url":"https://github.com/at-ync","followers_url":"https://api.github.com/users/at-ync/followers","following_url":"https://api.github.com/users/at-ync/following{/other_user}","gists_url":"https://api.github.com/users/at-ync/gists{/gist_id}","starred_url":"https://api.github.com/users/at-ync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-ync/subscriptions","organizations_url":"https://api.github.com/users/at-ync/orgs","repos_url":"https://api.github.com/users/at-ync/repos","events_url":"https://api.github.com/users/at-ync/events{/privacy}","received_events_url":"https://api.github.com/users/at-ync/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-05T08:00:51Z","updated_at":"2016-09-05T08:08:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00f0ed23b95e1e6eb033cc437feb1ad23ce63cb4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/at-ync/Painter/pulls/11/commits","review_comments_url":"https://api.github.com/repos/at-ync/Painter/pulls/11/comments","review_comment_url":"https://api.github.com/repos/at-ync/Painter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/at-ync/Painter/issues/11/comments","statuses_url":"https://api.github.com/repos/at-ync/Painter/statuses/c9240a592440f0d2987f1cb0ae7e845f337014c3","head":{"label":"at-ync:feature/20160830-YNC_open_camera","ref":"feature/20160830-YNC_open_camera","sha":"c9240a592440f0d2987f1cb0ae7e845f337014c3","user":{"login":"at-ync","id":7977161,"avatar_url":"https://avatars.githubusercontent.com/u/7977161?v=3","gravatar_id":"","url":"https://api.github.com/users/at-ync","html_url":"https://github.com/at-ync","followers_url":"https://api.github.com/users/at-ync/followers","following_url":"https://api.github.com/users/at-ync/following{/other_user}","gists_url":"https://api.github.com/users/at-ync/gists{/gist_id}","starred_url":"https://api.github.com/users/at-ync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-ync/subscriptions","organizations_url":"https://api.github.com/users/at-ync/orgs","repos_url":"https://api.github.com/users/at-ync/repos","events_url":"https://api.github.com/users/at-ync/events{/privacy}","received_events_url":"https://api.github.com/users/at-ync/received_events","type":"User","site_admin":false},"repo":{"id":66896057,"name":"Painter","full_name":"at-ync/Painter","owner":{"login":"at-ync","id":7977161,"avatar_url":"https://avatars.githubusercontent.com/u/7977161?v=3","gravatar_id":"","url":"https://api.github.com/users/at-ync","html_url":"https://github.com/at-ync","followers_url":"https://api.github.com/users/at-ync/followers","following_url":"https://api.github.com/users/at-ync/following{/other_user}","gists_url":"https://api.github.com/users/at-ync/gists{/gist_id}","starred_url":"https://api.github.com/users/at-ync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-ync/subscriptions","organizations_url":"https://api.github.com/users/at-ync/orgs","repos_url":"https://api.github.com/users/at-ync/repos","events_url":"https://api.github.com/users/at-ync/events{/privacy}","received_events_url":"https://api.github.com/users/at-ync/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/at-ync/Painter","description":null,"fork":false,"url":"https://api.github.com/repos/at-ync/Painter","forks_url":"https://api.github.com/repos/at-ync/Painter/forks","keys_url":"https://api.github.com/repos/at-ync/Painter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/at-ync/Painter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/at-ync/Painter/teams","hooks_url":"https://api.github.com/repos/at-ync/Painter/hooks","issue_events_url":"https://api.github.com/repos/at-ync/Painter/issues/events{/number}","events_url":"https://api.github.com/repos/at-ync/Painter/events","assignees_url":"https://api.github.com/repos/at-ync/Painter/assignees{/user}","branches_url":"https://api.github.com/repos/at-ync/Painter/branches{/branch}","tags_url":"https://api.github.com/repos/at-ync/Painter/tags","blobs_url":"https://api.github.com/repos/at-ync/Painter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/at-ync/Painter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/at-ync/Painter/git/refs{/sha}","trees_url":"https://api.github.com/repos/at-ync/Painter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/at-ync/Painter/statuses/{sha}","languages_url":"https://api.github.com/repos/at-ync/Painter/languages","stargazers_url":"https://api.github.com/repos/at-ync/Painter/stargazers","contributors_url":"https://api.github.com/repos/at-ync/Painter/contributors","subscribers_url":"https://api.github.com/repos/at-ync/Painter/subscribers","subscription_url":"https://api.github.com/repos/at-ync/Painter/subscription","commits_url":"https://api.github.com/repos/at-ync/Painter/commits{/sha}","git_commits_url":"https://api.github.com/repos/at-ync/Painter/git/commits{/sha}","comments_url":"https://api.github.com/repos/at-ync/Painter/comments{/number}","issue_comment_url":"https://api.github.com/repos/at-ync/Painter/issues/comments{/number}","contents_url":"https://api.github.com/repos/at-ync/Painter/contents/{+path}","compare_url":"https://api.github.com/repos/at-ync/Painter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/at-ync/Painter/merges","archive_url":"https://api.github.com/repos/at-ync/Painter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/at-ync/Painter/downloads","issues_url":"https://api.github.com/repos/at-ync/Painter/issues{/number}","pulls_url":"https://api.github.com/repos/at-ync/Painter/pulls{/number}","milestones_url":"https://api.github.com/repos/at-ync/Painter/milestones{/number}","notifications_url":"https://api.github.com/repos/at-ync/Painter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/at-ync/Painter/labels{/name}","releases_url":"https://api.github.com/repos/at-ync/Painter/releases{/id}","deployments_url":"https://api.github.com/repos/at-ync/Painter/deployments","created_at":"2016-08-30T01:46:01Z","updated_at":"2016-08-31T22:56:46Z","pushed_at":"2016-09-05T08:00:51Z","git_url":"git://github.com/at-ync/Painter.git","ssh_url":"git@github.com:at-ync/Painter.git","clone_url":"https://github.com/at-ync/Painter.git","svn_url":"https://github.com/at-ync/Painter","homepage":null,"size":548,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"at-ync:master","ref":"master","sha":"86d8f3546035dc0c4097a426262c190658714593","user":{"login":"at-ync","id":7977161,"avatar_url":"https://avatars.githubusercontent.com/u/7977161?v=3","gravatar_id":"","url":"https://api.github.com/users/at-ync","html_url":"https://github.com/at-ync","followers_url":"https://api.github.com/users/at-ync/followers","following_url":"https://api.github.com/users/at-ync/following{/other_user}","gists_url":"https://api.github.com/users/at-ync/gists{/gist_id}","starred_url":"https://api.github.com/users/at-ync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-ync/subscriptions","organizations_url":"https://api.github.com/users/at-ync/orgs","repos_url":"https://api.github.com/users/at-ync/repos","events_url":"https://api.github.com/users/at-ync/events{/privacy}","received_events_url":"https://api.github.com/users/at-ync/received_events","type":"User","site_admin":false},"repo":{"id":66896057,"name":"Painter","full_name":"at-ync/Painter","owner":{"login":"at-ync","id":7977161,"avatar_url":"https://avatars.githubusercontent.com/u/7977161?v=3","gravatar_id":"","url":"https://api.github.com/users/at-ync","html_url":"https://github.com/at-ync","followers_url":"https://api.github.com/users/at-ync/followers","following_url":"https://api.github.com/users/at-ync/following{/other_user}","gists_url":"https://api.github.com/users/at-ync/gists{/gist_id}","starred_url":"https://api.github.com/users/at-ync/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-ync/subscriptions","organizations_url":"https://api.github.com/users/at-ync/orgs","repos_url":"https://api.github.com/users/at-ync/repos","events_url":"https://api.github.com/users/at-ync/events{/privacy}","received_events_url":"https://api.github.com/users/at-ync/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/at-ync/Painter","description":null,"fork":false,"url":"https://api.github.com/repos/at-ync/Painter","forks_url":"https://api.github.com/repos/at-ync/Painter/forks","keys_url":"https://api.github.com/repos/at-ync/Painter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/at-ync/Painter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/at-ync/Painter/teams","hooks_url":"https://api.github.com/repos/at-ync/Painter/hooks","issue_events_url":"https://api.github.com/repos/at-ync/Painter/issues/events{/number}","events_url":"https://api.github.com/repos/at-ync/Painter/events","assignees_url":"https://api.github.com/repos/at-ync/Painter/assignees{/user}","branches_url":"https://api.github.com/repos/at-ync/Painter/branches{/branch}","tags_url":"https://api.github.com/repos/at-ync/Painter/tags","blobs_url":"https://api.github.com/repos/at-ync/Painter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/at-ync/Painter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/at-ync/Painter/git/refs{/sha}","trees_url":"https://api.github.com/repos/at-ync/Painter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/at-ync/Painter/statuses/{sha}","languages_url":"https://api.github.com/repos/at-ync/Painter/languages","stargazers_url":"https://api.github.com/repos/at-ync/Painter/stargazers","contributors_url":"https://api.github.com/repos/at-ync/Painter/contributors","subscribers_url":"https://api.github.com/repos/at-ync/Painter/subscribers","subscription_url":"https://api.github.com/repos/at-ync/Painter/subscription","commits_url":"https://api.github.com/repos/at-ync/Painter/commits{/sha}","git_commits_url":"https://api.github.com/repos/at-ync/Painter/git/commits{/sha}","comments_url":"https://api.github.com/repos/at-ync/Painter/comments{/number}","issue_comment_url":"https://api.github.com/repos/at-ync/Painter/issues/comments{/number}","contents_url":"https://api.github.com/repos/at-ync/Painter/contents/{+path}","compare_url":"https://api.github.com/repos/at-ync/Painter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/at-ync/Painter/merges","archive_url":"https://api.github.com/repos/at-ync/Painter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/at-ync/Painter/downloads","issues_url":"https://api.github.com/repos/at-ync/Painter/issues{/number}","pulls_url":"https://api.github.com/repos/at-ync/Painter/pulls{/number}","milestones_url":"https://api.github.com/repos/at-ync/Painter/milestones{/number}","notifications_url":"https://api.github.com/repos/at-ync/Painter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/at-ync/Painter/labels{/name}","releases_url":"https://api.github.com/repos/at-ync/Painter/releases{/id}","deployments_url":"https://api.github.com/repos/at-ync/Painter/deployments","created_at":"2016-08-30T01:46:01Z","updated_at":"2016-08-31T22:56:46Z","pushed_at":"2016-09-05T08:00:51Z","git_url":"git://github.com/at-ync/Painter.git","ssh_url":"git@github.com:at-ync/Painter.git","clone_url":"https://github.com/at-ync/Painter.git","svn_url":"https://github.com/at-ync/Painter","homepage":null,"size":548,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/11"},"html":{"href":"https://github.com/at-ync/Painter/pull/11"},"issue":{"href":"https://api.github.com/repos/at-ync/Painter/issues/11"},"comments":{"href":"https://api.github.com/repos/at-ync/Painter/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/at-ync/Painter/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/at-ync/Painter/statuses/c9240a592440f0d2987f1cb0ae7e845f337014c3"}}}}
{"actor":{"display_login":"at-binc"}}