{"action":"created","comment":{"url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/comments/50359364","id":50359364,"diff_hunk":"@@ -0,0 +1,64 @@\n+package com.visiontech.yummysmile.ui.presenter;\n+\n+import android.content.Context;\n+import android.util.Log;\n+\n+import com.google.gson.JsonObject;\n+import com.visiontech.yummysmile.R;\n+import com.visiontech.yummysmile.ui.controller.MealsControllerImpl;\n+\n+import java.io.File;\n+\n+/**\n+ * Class that is the intermediary between the view and model based on MVP Pattern.\n+ *\n+ * @author hetorres\n+ */\n+public class CreateMealPresenter extends BasePresenter {\n+    private static final String LOG_TAG = CreateMealPresenter.class.getName();\n+    private MealsControllerImpl mealsController;\n+    private CreateMealView createMealView;\n+    private Context context;\n+\n+    public CreateMealPresenter(CreateMealView createMealView, Context context) {\n+        this.createMealView = createMealView;\n+        this.context = context;\n+        this.mealsController = new MealsControllerImpl(this);\n+    }\n+\n+    public void createMeal(String name, File photo) {\n+        Log.d(LOG_TAG, \"createMeal()\");\n+        createMealView.showProgress(true);\n+\n+        //fixme create in a better way?\n+        JsonObject jsonObject = new JsonObject();\n+        jsonObject.addProperty(\"name\", name);\n+        mealsController.createMeal(jsonObject, photo);\n+    }\n+\n+    @Override\n+    public <T> void onNext(T data) {\n+        Log.d(LOG_TAG, \"onNext()\");\n+        JsonObject jsonResponse = (JsonObject) data;\n+        if (jsonResponse.has(\"objectId\") && jsonResponse.get(\"objectId\") != null) {","path":"app/src/main/java/com/visiontech/yummysmile/ui/presenter/CreateMealPresenter.java","position":43,"original_position":43,"commit_id":"1dd4b199bbb2d9d54b9172a54719bf6390951aec","original_commit_id":"1dd4b199bbb2d9d54b9172a54719bf6390951aec","user":{"login":"manuelortiz28","id":14357179,"avatar_url":"https://avatars.githubusercontent.com/u/14357179?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelortiz28","html_url":"https://github.com/manuelortiz28","followers_url":"https://api.github.com/users/manuelortiz28/followers","following_url":"https://api.github.com/users/manuelortiz28/following{/other_user}","gists_url":"https://api.github.com/users/manuelortiz28/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelortiz28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelortiz28/subscriptions","organizations_url":"https://api.github.com/users/manuelortiz28/orgs","repos_url":"https://api.github.com/users/manuelortiz28/repos","events_url":"https://api.github.com/users/manuelortiz28/events{/privacy}","received_events_url":"https://api.github.com/users/manuelortiz28/received_events","type":"User","site_admin":false},"body":"Please use constants","created_at":"2016-01-21T04:29:12Z","updated_at":"2016-01-21T04:29:12Z","html_url":"https://github.com/manuelortiz28/yummysmile/pull/5#discussion_r50359364","pull_request_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/comments/50359364"},"html":{"href":"https://github.com/manuelortiz28/yummysmile/pull/5#discussion_r50359364"},"pull_request":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5","id":56324186,"html_url":"https://github.com/manuelortiz28/yummysmile/pull/5","diff_url":"https://github.com/manuelortiz28/yummysmile/pull/5.diff","patch_url":"https://github.com/manuelortiz28/yummysmile/pull/5.patch","issue_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/5","number":5,"state":"open","locked":false,"title":"YUMMY-006 Create upload photo flow","user":{"login":"htorrex","id":4344204,"avatar_url":"https://avatars.githubusercontent.com/u/4344204?v=3","gravatar_id":"","url":"https://api.github.com/users/htorrex","html_url":"https://github.com/htorrex","followers_url":"https://api.github.com/users/htorrex/followers","following_url":"https://api.github.com/users/htorrex/following{/other_user}","gists_url":"https://api.github.com/users/htorrex/gists{/gist_id}","starred_url":"https://api.github.com/users/htorrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htorrex/subscriptions","organizations_url":"https://api.github.com/users/htorrex/orgs","repos_url":"https://api.github.com/users/htorrex/repos","events_url":"https://api.github.com/users/htorrex/events{/privacy}","received_events_url":"https://api.github.com/users/htorrex/received_events","type":"User","site_admin":false},"body":"add a new meal functionality and using text wrapper layout\r\nAdjusting the service call to use it properly\r\nAdding + button, adding toolbar with coordinator layout\r\nUpdating to Retrofit beta2.","created_at":"2016-01-18T10:24:34Z","updated_at":"2016-01-21T04:29:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de836d907f934393e7389443df52b2deca222fc6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5/commits","review_comments_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5/comments","review_comment_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/5/comments","statuses_url":"https://api.github.com/repos/manuelortiz28/yummysmile/statuses/1dd4b199bbb2d9d54b9172a54719bf6390951aec","head":{"label":"manuelortiz28:hetorres/fab_button/add_new_meal","ref":"hetorres/fab_button/add_new_meal","sha":"1dd4b199bbb2d9d54b9172a54719bf6390951aec","user":{"login":"manuelortiz28","id":14357179,"avatar_url":"https://avatars.githubusercontent.com/u/14357179?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelortiz28","html_url":"https://github.com/manuelortiz28","followers_url":"https://api.github.com/users/manuelortiz28/followers","following_url":"https://api.github.com/users/manuelortiz28/following{/other_user}","gists_url":"https://api.github.com/users/manuelortiz28/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelortiz28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelortiz28/subscriptions","organizations_url":"https://api.github.com/users/manuelortiz28/orgs","repos_url":"https://api.github.com/users/manuelortiz28/repos","events_url":"https://api.github.com/users/manuelortiz28/events{/privacy}","received_events_url":"https://api.github.com/users/manuelortiz28/received_events","type":"User","site_admin":false},"repo":{"id":42824916,"name":"yummysmile","full_name":"manuelortiz28/yummysmile","owner":{"login":"manuelortiz28","id":14357179,"avatar_url":"https://avatars.githubusercontent.com/u/14357179?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelortiz28","html_url":"https://github.com/manuelortiz28","followers_url":"https://api.github.com/users/manuelortiz28/followers","following_url":"https://api.github.com/users/manuelortiz28/following{/other_user}","gists_url":"https://api.github.com/users/manuelortiz28/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelortiz28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelortiz28/subscriptions","organizations_url":"https://api.github.com/users/manuelortiz28/orgs","repos_url":"https://api.github.com/users/manuelortiz28/repos","events_url":"https://api.github.com/users/manuelortiz28/events{/privacy}","received_events_url":"https://api.github.com/users/manuelortiz28/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manuelortiz28/yummysmile","description":"Android native project of yummy smile","fork":false,"url":"https://api.github.com/repos/manuelortiz28/yummysmile","forks_url":"https://api.github.com/repos/manuelortiz28/yummysmile/forks","keys_url":"https://api.github.com/repos/manuelortiz28/yummysmile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manuelortiz28/yummysmile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manuelortiz28/yummysmile/teams","hooks_url":"https://api.github.com/repos/manuelortiz28/yummysmile/hooks","issue_events_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/events{/number}","events_url":"https://api.github.com/repos/manuelortiz28/yummysmile/events","assignees_url":"https://api.github.com/repos/manuelortiz28/yummysmile/assignees{/user}","branches_url":"https://api.github.com/repos/manuelortiz28/yummysmile/branches{/branch}","tags_url":"https://api.github.com/repos/manuelortiz28/yummysmile/tags","blobs_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/refs{/sha}","trees_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manuelortiz28/yummysmile/statuses/{sha}","languages_url":"https://api.github.com/repos/manuelortiz28/yummysmile/languages","stargazers_url":"https://api.github.com/repos/manuelortiz28/yummysmile/stargazers","contributors_url":"https://api.github.com/repos/manuelortiz28/yummysmile/contributors","subscribers_url":"https://api.github.com/repos/manuelortiz28/yummysmile/subscribers","subscription_url":"https://api.github.com/repos/manuelortiz28/yummysmile/subscription","commits_url":"https://api.github.com/repos/manuelortiz28/yummysmile/commits{/sha}","git_commits_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/commits{/sha}","comments_url":"https://api.github.com/repos/manuelortiz28/yummysmile/comments{/number}","issue_comment_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/comments{/number}","contents_url":"https://api.github.com/repos/manuelortiz28/yummysmile/contents/{+path}","compare_url":"https://api.github.com/repos/manuelortiz28/yummysmile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manuelortiz28/yummysmile/merges","archive_url":"https://api.github.com/repos/manuelortiz28/yummysmile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manuelortiz28/yummysmile/downloads","issues_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues{/number}","pulls_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls{/number}","milestones_url":"https://api.github.com/repos/manuelortiz28/yummysmile/milestones{/number}","notifications_url":"https://api.github.com/repos/manuelortiz28/yummysmile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manuelortiz28/yummysmile/labels{/name}","releases_url":"https://api.github.com/repos/manuelortiz28/yummysmile/releases{/id}","created_at":"2015-09-20T18:47:40Z","updated_at":"2015-09-26T01:50:11Z","pushed_at":"2016-01-18T10:24:34Z","git_url":"git://github.com/manuelortiz28/yummysmile.git","ssh_url":"git@github.com:manuelortiz28/yummysmile.git","clone_url":"https://github.com/manuelortiz28/yummysmile.git","svn_url":"https://github.com/manuelortiz28/yummysmile","homepage":"","size":170,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"manuelortiz28:develop","ref":"develop","sha":"3ec84b267aa6ab6177770b98a57c2fa6256501e9","user":{"login":"manuelortiz28","id":14357179,"avatar_url":"https://avatars.githubusercontent.com/u/14357179?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelortiz28","html_url":"https://github.com/manuelortiz28","followers_url":"https://api.github.com/users/manuelortiz28/followers","following_url":"https://api.github.com/users/manuelortiz28/following{/other_user}","gists_url":"https://api.github.com/users/manuelortiz28/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelortiz28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelortiz28/subscriptions","organizations_url":"https://api.github.com/users/manuelortiz28/orgs","repos_url":"https://api.github.com/users/manuelortiz28/repos","events_url":"https://api.github.com/users/manuelortiz28/events{/privacy}","received_events_url":"https://api.github.com/users/manuelortiz28/received_events","type":"User","site_admin":false},"repo":{"id":42824916,"name":"yummysmile","full_name":"manuelortiz28/yummysmile","owner":{"login":"manuelortiz28","id":14357179,"avatar_url":"https://avatars.githubusercontent.com/u/14357179?v=3","gravatar_id":"","url":"https://api.github.com/users/manuelortiz28","html_url":"https://github.com/manuelortiz28","followers_url":"https://api.github.com/users/manuelortiz28/followers","following_url":"https://api.github.com/users/manuelortiz28/following{/other_user}","gists_url":"https://api.github.com/users/manuelortiz28/gists{/gist_id}","starred_url":"https://api.github.com/users/manuelortiz28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuelortiz28/subscriptions","organizations_url":"https://api.github.com/users/manuelortiz28/orgs","repos_url":"https://api.github.com/users/manuelortiz28/repos","events_url":"https://api.github.com/users/manuelortiz28/events{/privacy}","received_events_url":"https://api.github.com/users/manuelortiz28/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manuelortiz28/yummysmile","description":"Android native project of yummy smile","fork":false,"url":"https://api.github.com/repos/manuelortiz28/yummysmile","forks_url":"https://api.github.com/repos/manuelortiz28/yummysmile/forks","keys_url":"https://api.github.com/repos/manuelortiz28/yummysmile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manuelortiz28/yummysmile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manuelortiz28/yummysmile/teams","hooks_url":"https://api.github.com/repos/manuelortiz28/yummysmile/hooks","issue_events_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/events{/number}","events_url":"https://api.github.com/repos/manuelortiz28/yummysmile/events","assignees_url":"https://api.github.com/repos/manuelortiz28/yummysmile/assignees{/user}","branches_url":"https://api.github.com/repos/manuelortiz28/yummysmile/branches{/branch}","tags_url":"https://api.github.com/repos/manuelortiz28/yummysmile/tags","blobs_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/refs{/sha}","trees_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manuelortiz28/yummysmile/statuses/{sha}","languages_url":"https://api.github.com/repos/manuelortiz28/yummysmile/languages","stargazers_url":"https://api.github.com/repos/manuelortiz28/yummysmile/stargazers","contributors_url":"https://api.github.com/repos/manuelortiz28/yummysmile/contributors","subscribers_url":"https://api.github.com/repos/manuelortiz28/yummysmile/subscribers","subscription_url":"https://api.github.com/repos/manuelortiz28/yummysmile/subscription","commits_url":"https://api.github.com/repos/manuelortiz28/yummysmile/commits{/sha}","git_commits_url":"https://api.github.com/repos/manuelortiz28/yummysmile/git/commits{/sha}","comments_url":"https://api.github.com/repos/manuelortiz28/yummysmile/comments{/number}","issue_comment_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/comments{/number}","contents_url":"https://api.github.com/repos/manuelortiz28/yummysmile/contents/{+path}","compare_url":"https://api.github.com/repos/manuelortiz28/yummysmile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manuelortiz28/yummysmile/merges","archive_url":"https://api.github.com/repos/manuelortiz28/yummysmile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manuelortiz28/yummysmile/downloads","issues_url":"https://api.github.com/repos/manuelortiz28/yummysmile/issues{/number}","pulls_url":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls{/number}","milestones_url":"https://api.github.com/repos/manuelortiz28/yummysmile/milestones{/number}","notifications_url":"https://api.github.com/repos/manuelortiz28/yummysmile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manuelortiz28/yummysmile/labels{/name}","releases_url":"https://api.github.com/repos/manuelortiz28/yummysmile/releases{/id}","created_at":"2015-09-20T18:47:40Z","updated_at":"2015-09-26T01:50:11Z","pushed_at":"2016-01-18T10:24:34Z","git_url":"git://github.com/manuelortiz28/yummysmile.git","ssh_url":"git@github.com:manuelortiz28/yummysmile.git","clone_url":"https://github.com/manuelortiz28/yummysmile.git","svn_url":"https://github.com/manuelortiz28/yummysmile","homepage":"","size":170,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5"},"html":{"href":"https://github.com/manuelortiz28/yummysmile/pull/5"},"issue":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/5"},"comments":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/manuelortiz28/yummysmile/statuses/1dd4b199bbb2d9d54b9172a54719bf6390951aec"}}}}