{"action":"created","comment":{"url":"https://api.github.com/repos/hieumai/cura/pulls/comments/69064828","id":69064828,"diff_hunk":"@@ -0,0 +1,204 @@\n+package com.kms.cura.utils;\n+\n+import android.app.Activity;\n+import android.content.Context;\n+import android.content.Intent;\n+import android.content.pm.ResolveInfo;\n+import android.content.res.AssetFileDescriptor;\n+import android.database.Cursor;\n+import android.graphics.Bitmap;\n+import android.graphics.BitmapFactory;\n+import android.graphics.Matrix;\n+import android.media.ExifInterface;\n+import android.net.Uri;\n+import android.os.Parcelable;\n+import android.provider.MediaStore;\n+import android.util.Log;\n+\n+import com.kms.cura.R;\n+\n+import java.io.File;\n+import java.io.FileNotFoundException;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+public class ImagePicker {\n+\n+    private static final int DEFAULT_MIN_WIDTH_QUALITY = 400;        // min pixels\n+    private static final String TAG = \"ImagePicker\";\n+    private static final String TEMP_IMAGE_NAME = \"tempImage\";\n+\n+    public static int minWidthQuality = DEFAULT_MIN_WIDTH_QUALITY;\n+\n+\n+    public static Intent getPickImageIntent(Context context) {\n+        Intent chooserIntent = null;\n+\n+        List<Intent> intentList = new ArrayList<>();\n+\n+        Intent pickIntent = new Intent(Intent.ACTION_PICK,\n+                android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n+        Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n+        takePhotoIntent.putExtra(\"return-data\", true);","path":"app/src/main/java/com/kms/cura/utils/ImagePicker.java","position":42,"original_position":42,"commit_id":"31f022451754a432be99c9cc3463e7a72fda192c","original_commit_id":"31f022451754a432be99c9cc3463e7a72fda192c","user":{"login":"hieumai","id":13411454,"avatar_url":"https://avatars.githubusercontent.com/u/13411454?v=3","gravatar_id":"","url":"https://api.github.com/users/hieumai","html_url":"https://github.com/hieumai","followers_url":"https://api.github.com/users/hieumai/followers","following_url":"https://api.github.com/users/hieumai/following{/other_user}","gists_url":"https://api.github.com/users/hieumai/gists{/gist_id}","starred_url":"https://api.github.com/users/hieumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieumai/subscriptions","organizations_url":"https://api.github.com/users/hieumai/orgs","repos_url":"https://api.github.com/users/hieumai/repos","events_url":"https://api.github.com/users/hieumai/events{/privacy}","received_events_url":"https://api.github.com/users/hieumai/received_events","type":"User","site_admin":false},"body":"Make \"return-data\" constant","created_at":"2016-06-30T03:30:36Z","updated_at":"2016-06-30T03:30:36Z","html_url":"https://github.com/hieumai/cura/pull/47#discussion_r69064828","pull_request_url":"https://api.github.com/repos/hieumai/cura/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/hieumai/cura/pulls/comments/69064828"},"html":{"href":"https://github.com/hieumai/cura/pull/47#discussion_r69064828"},"pull_request":{"href":"https://api.github.com/repos/hieumai/cura/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/hieumai/cura/pulls/47","id":75605012,"html_url":"https://github.com/hieumai/cura/pull/47","diff_url":"https://github.com/hieumai/cura/pull/47.diff","patch_url":"https://github.com/hieumai/cura/pull/47.patch","issue_url":"https://api.github.com/repos/hieumai/cura/issues/47","number":47,"state":"open","locked":false,"title":"KATI-67[Settings] Patient Settings UI","user":{"login":"huuduy216","id":10777843,"avatar_url":"https://avatars.githubusercontent.com/u/10777843?v=3","gravatar_id":"","url":"https://api.github.com/users/huuduy216","html_url":"https://github.com/huuduy216","followers_url":"https://api.github.com/users/huuduy216/followers","following_url":"https://api.github.com/users/huuduy216/following{/other_user}","gists_url":"https://api.github.com/users/huuduy216/gists{/gist_id}","starred_url":"https://api.github.com/users/huuduy216/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huuduy216/subscriptions","organizations_url":"https://api.github.com/users/huuduy216/orgs","repos_url":"https://api.github.com/users/huuduy216/repos","events_url":"https://api.github.com/users/huuduy216/events{/privacy}","received_events_url":"https://api.github.com/users/huuduy216/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-29T08:10:08Z","updated_at":"2016-06-30T03:30:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07413618191f5c4eabd41f756b21dfc72ed96bd5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hieumai/cura/pulls/47/commits","review_comments_url":"https://api.github.com/repos/hieumai/cura/pulls/47/comments","review_comment_url":"https://api.github.com/repos/hieumai/cura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hieumai/cura/issues/47/comments","statuses_url":"https://api.github.com/repos/hieumai/cura/statuses/31f022451754a432be99c9cc3463e7a72fda192c","head":{"label":"hieumai:KATI-67_PatientSettingsUI","ref":"KATI-67_PatientSettingsUI","sha":"31f022451754a432be99c9cc3463e7a72fda192c","user":{"login":"hieumai","id":13411454,"avatar_url":"https://avatars.githubusercontent.com/u/13411454?v=3","gravatar_id":"","url":"https://api.github.com/users/hieumai","html_url":"https://github.com/hieumai","followers_url":"https://api.github.com/users/hieumai/followers","following_url":"https://api.github.com/users/hieumai/following{/other_user}","gists_url":"https://api.github.com/users/hieumai/gists{/gist_id}","starred_url":"https://api.github.com/users/hieumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieumai/subscriptions","organizations_url":"https://api.github.com/users/hieumai/orgs","repos_url":"https://api.github.com/users/hieumai/repos","events_url":"https://api.github.com/users/hieumai/events{/privacy}","received_events_url":"https://api.github.com/users/hieumai/received_events","type":"User","site_admin":false},"repo":{"id":59467894,"name":"cura","full_name":"hieumai/cura","owner":{"login":"hieumai","id":13411454,"avatar_url":"https://avatars.githubusercontent.com/u/13411454?v=3","gravatar_id":"","url":"https://api.github.com/users/hieumai","html_url":"https://github.com/hieumai","followers_url":"https://api.github.com/users/hieumai/followers","following_url":"https://api.github.com/users/hieumai/following{/other_user}","gists_url":"https://api.github.com/users/hieumai/gists{/gist_id}","starred_url":"https://api.github.com/users/hieumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieumai/subscriptions","organizations_url":"https://api.github.com/users/hieumai/orgs","repos_url":"https://api.github.com/users/hieumai/repos","events_url":"https://api.github.com/users/hieumai/events{/privacy}","received_events_url":"https://api.github.com/users/hieumai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hieumai/cura","description":"","fork":false,"url":"https://api.github.com/repos/hieumai/cura","forks_url":"https://api.github.com/repos/hieumai/cura/forks","keys_url":"https://api.github.com/repos/hieumai/cura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hieumai/cura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hieumai/cura/teams","hooks_url":"https://api.github.com/repos/hieumai/cura/hooks","issue_events_url":"https://api.github.com/repos/hieumai/cura/issues/events{/number}","events_url":"https://api.github.com/repos/hieumai/cura/events","assignees_url":"https://api.github.com/repos/hieumai/cura/assignees{/user}","branches_url":"https://api.github.com/repos/hieumai/cura/branches{/branch}","tags_url":"https://api.github.com/repos/hieumai/cura/tags","blobs_url":"https://api.github.com/repos/hieumai/cura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hieumai/cura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hieumai/cura/git/refs{/sha}","trees_url":"https://api.github.com/repos/hieumai/cura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hieumai/cura/statuses/{sha}","languages_url":"https://api.github.com/repos/hieumai/cura/languages","stargazers_url":"https://api.github.com/repos/hieumai/cura/stargazers","contributors_url":"https://api.github.com/repos/hieumai/cura/contributors","subscribers_url":"https://api.github.com/repos/hieumai/cura/subscribers","subscription_url":"https://api.github.com/repos/hieumai/cura/subscription","commits_url":"https://api.github.com/repos/hieumai/cura/commits{/sha}","git_commits_url":"https://api.github.com/repos/hieumai/cura/git/commits{/sha}","comments_url":"https://api.github.com/repos/hieumai/cura/comments{/number}","issue_comment_url":"https://api.github.com/repos/hieumai/cura/issues/comments{/number}","contents_url":"https://api.github.com/repos/hieumai/cura/contents/{+path}","compare_url":"https://api.github.com/repos/hieumai/cura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hieumai/cura/merges","archive_url":"https://api.github.com/repos/hieumai/cura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hieumai/cura/downloads","issues_url":"https://api.github.com/repos/hieumai/cura/issues{/number}","pulls_url":"https://api.github.com/repos/hieumai/cura/pulls{/number}","milestones_url":"https://api.github.com/repos/hieumai/cura/milestones{/number}","notifications_url":"https://api.github.com/repos/hieumai/cura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hieumai/cura/labels{/name}","releases_url":"https://api.github.com/repos/hieumai/cura/releases{/id}","deployments_url":"https://api.github.com/repos/hieumai/cura/deployments","created_at":"2016-05-23T09:02:18Z","updated_at":"2016-05-24T04:22:09Z","pushed_at":"2016-06-30T03:16:46Z","git_url":"git://github.com/hieumai/cura.git","ssh_url":"git@github.com:hieumai/cura.git","clone_url":"https://github.com/hieumai/cura.git","svn_url":"https://github.com/hieumai/cura","homepage":null,"size":839,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"hieumai:master","ref":"master","sha":"edf7e04c256b33c88819079d36ec83b4fad4f95a","user":{"login":"hieumai","id":13411454,"avatar_url":"https://avatars.githubusercontent.com/u/13411454?v=3","gravatar_id":"","url":"https://api.github.com/users/hieumai","html_url":"https://github.com/hieumai","followers_url":"https://api.github.com/users/hieumai/followers","following_url":"https://api.github.com/users/hieumai/following{/other_user}","gists_url":"https://api.github.com/users/hieumai/gists{/gist_id}","starred_url":"https://api.github.com/users/hieumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieumai/subscriptions","organizations_url":"https://api.github.com/users/hieumai/orgs","repos_url":"https://api.github.com/users/hieumai/repos","events_url":"https://api.github.com/users/hieumai/events{/privacy}","received_events_url":"https://api.github.com/users/hieumai/received_events","type":"User","site_admin":false},"repo":{"id":59467894,"name":"cura","full_name":"hieumai/cura","owner":{"login":"hieumai","id":13411454,"avatar_url":"https://avatars.githubusercontent.com/u/13411454?v=3","gravatar_id":"","url":"https://api.github.com/users/hieumai","html_url":"https://github.com/hieumai","followers_url":"https://api.github.com/users/hieumai/followers","following_url":"https://api.github.com/users/hieumai/following{/other_user}","gists_url":"https://api.github.com/users/hieumai/gists{/gist_id}","starred_url":"https://api.github.com/users/hieumai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieumai/subscriptions","organizations_url":"https://api.github.com/users/hieumai/orgs","repos_url":"https://api.github.com/users/hieumai/repos","events_url":"https://api.github.com/users/hieumai/events{/privacy}","received_events_url":"https://api.github.com/users/hieumai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hieumai/cura","description":"","fork":false,"url":"https://api.github.com/repos/hieumai/cura","forks_url":"https://api.github.com/repos/hieumai/cura/forks","keys_url":"https://api.github.com/repos/hieumai/cura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hieumai/cura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hieumai/cura/teams","hooks_url":"https://api.github.com/repos/hieumai/cura/hooks","issue_events_url":"https://api.github.com/repos/hieumai/cura/issues/events{/number}","events_url":"https://api.github.com/repos/hieumai/cura/events","assignees_url":"https://api.github.com/repos/hieumai/cura/assignees{/user}","branches_url":"https://api.github.com/repos/hieumai/cura/branches{/branch}","tags_url":"https://api.github.com/repos/hieumai/cura/tags","blobs_url":"https://api.github.com/repos/hieumai/cura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hieumai/cura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hieumai/cura/git/refs{/sha}","trees_url":"https://api.github.com/repos/hieumai/cura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hieumai/cura/statuses/{sha}","languages_url":"https://api.github.com/repos/hieumai/cura/languages","stargazers_url":"https://api.github.com/repos/hieumai/cura/stargazers","contributors_url":"https://api.github.com/repos/hieumai/cura/contributors","subscribers_url":"https://api.github.com/repos/hieumai/cura/subscribers","subscription_url":"https://api.github.com/repos/hieumai/cura/subscription","commits_url":"https://api.github.com/repos/hieumai/cura/commits{/sha}","git_commits_url":"https://api.github.com/repos/hieumai/cura/git/commits{/sha}","comments_url":"https://api.github.com/repos/hieumai/cura/comments{/number}","issue_comment_url":"https://api.github.com/repos/hieumai/cura/issues/comments{/number}","contents_url":"https://api.github.com/repos/hieumai/cura/contents/{+path}","compare_url":"https://api.github.com/repos/hieumai/cura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hieumai/cura/merges","archive_url":"https://api.github.com/repos/hieumai/cura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hieumai/cura/downloads","issues_url":"https://api.github.com/repos/hieumai/cura/issues{/number}","pulls_url":"https://api.github.com/repos/hieumai/cura/pulls{/number}","milestones_url":"https://api.github.com/repos/hieumai/cura/milestones{/number}","notifications_url":"https://api.github.com/repos/hieumai/cura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hieumai/cura/labels{/name}","releases_url":"https://api.github.com/repos/hieumai/cura/releases{/id}","deployments_url":"https://api.github.com/repos/hieumai/cura/deployments","created_at":"2016-05-23T09:02:18Z","updated_at":"2016-05-24T04:22:09Z","pushed_at":"2016-06-30T03:16:46Z","git_url":"git://github.com/hieumai/cura.git","ssh_url":"git@github.com:hieumai/cura.git","clone_url":"https://github.com/hieumai/cura.git","svn_url":"https://github.com/hieumai/cura","homepage":null,"size":839,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hieumai/cura/pulls/47"},"html":{"href":"https://github.com/hieumai/cura/pull/47"},"issue":{"href":"https://api.github.com/repos/hieumai/cura/issues/47"},"comments":{"href":"https://api.github.com/repos/hieumai/cura/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/hieumai/cura/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/hieumai/cura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hieumai/cura/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/hieumai/cura/statuses/31f022451754a432be99c9cc3463e7a72fda192c"}}}}
{"actor":{"display_login":"hieumai"}}