{"action":"created","comment":{"url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/comments/189470321","pull_request_review_id":121654783,"id":189470321,"diff_hunk":"@@ -50,24 +56,43 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,\n     public void onStart() {\n         super.onStart();\n         getPresenter().attach(this);\n-        binding.setLogin(getPresenter().getLogin());\n-        getPresenter().start();\n+\n+        //attaching the view model\n+        loginFragmentViewModel = ViewModelProviders.of(this, viewModelFactory).get(LoginViewModel.class);\n+        handleEmails();\n+\n+        //getPresenter().start();\n+        binding.setLogin(loginFragmentViewModel.getLogin());\n+\n         binding.btnLogin.setOnClickListener(view -> {\n             if (!validator.validate())\n                 return;\n \n             ViewUtils.hideKeyboard(view);\n \n             String url = binding.url.baseUrl.getText().toString().trim();\n-            getPresenter().setBaseUrl(url, binding.url.overrideUrl.isChecked());\n-            getPresenter().login();\n+            loginFragmentViewModel.setBaseUrl(url, binding.url.overrideUrl.isChecked());\n+            loginFragmentViewModel.login().observe(this, this::onResponse);\n         });\n \n         binding.signUpLink.setOnClickListener(view -> openSignUpPage());\n-\n         binding.forgotPasswordLink.setOnClickListener(view -> openForgotPasswordPage());\n     }\n \n+    private void handleEmails() {\n+        emailsList = loginFragmentViewModel.getEmailList();\n+        if(emailsList != null)","path":"app/src/main/java/org/fossasia/openevent/app/core/auth/login/LoginFragment.java","position":72,"original_position":72,"commit_id":"c96a03657d31e7b73a34958c54672364cbabba61","original_commit_id":"c96a03657d31e7b73a34958c54672364cbabba61","user":{"login":"iamareebjamal","id":3874064,"avatar_url":"https://avatars0.githubusercontent.com/u/3874064?v=4","gravatar_id":"","url":"https://api.github.com/users/iamareebjamal","html_url":"https://github.com/iamareebjamal","followers_url":"https://api.github.com/users/iamareebjamal/followers","following_url":"https://api.github.com/users/iamareebjamal/following{/other_user}","gists_url":"https://api.github.com/users/iamareebjamal/gists{/gist_id}","starred_url":"https://api.github.com/users/iamareebjamal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamareebjamal/subscriptions","organizations_url":"https://api.github.com/users/iamareebjamal/orgs","repos_url":"https://api.github.com/users/iamareebjamal/repos","events_url":"https://api.github.com/users/iamareebjamal/events{/privacy}","received_events_url":"https://api.github.com/users/iamareebjamal/received_events","type":"User","site_admin":false},"body":"Rather than proactively fetching, expose a live data instead. Also, only post if not null so that views don't have to apply logic","created_at":"2018-05-20T20:57:33Z","updated_at":"2018-05-20T20:57:34Z","html_url":"https://github.com/fossasia/open-event-orga-app/pull/965#discussion_r189470321","pull_request_url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/comments/189470321"},"html":{"href":"https://github.com/fossasia/open-event-orga-app/pull/965#discussion_r189470321"},"pull_request":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965"}}},"pull_request":{"url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965","id":189234555,"html_url":"https://github.com/fossasia/open-event-orga-app/pull/965","diff_url":"https://github.com/fossasia/open-event-orga-app/pull/965.diff","patch_url":"https://github.com/fossasia/open-event-orga-app/pull/965.patch","issue_url":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/965","number":965,"state":"open","locked":false,"title":"[WIP]: Add a LoginViewModel class","user":{"login":"sridharjajoo","id":20684618,"avatar_url":"https://avatars0.githubusercontent.com/u/20684618?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharjajoo","html_url":"https://github.com/sridharjajoo","followers_url":"https://api.github.com/users/sridharjajoo/followers","following_url":"https://api.github.com/users/sridharjajoo/following{/other_user}","gists_url":"https://api.github.com/users/sridharjajoo/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharjajoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharjajoo/subscriptions","organizations_url":"https://api.github.com/users/sridharjajoo/orgs","repos_url":"https://api.github.com/users/sridharjajoo/repos","events_url":"https://api.github.com/users/sridharjajoo/events{/privacy}","received_events_url":"https://api.github.com/users/sridharjajoo/received_events","type":"User","site_admin":false},"body":"Fixes #962 \r\n\r\n- The code related to LoginPresenter hasn't been remove for now (just been commented out).\r\n- The functionality present inside the onStart( ) of LoginPresenter needs to implemented in the ViewModel such as the emailList.\r\n ","created_at":"2018-05-20T13:47:45Z","updated_at":"2018-05-20T20:57:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d229dcf827f05f0ad152543c38649110ea7740d","assignee":{"login":"sridharjajoo","id":20684618,"avatar_url":"https://avatars0.githubusercontent.com/u/20684618?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharjajoo","html_url":"https://github.com/sridharjajoo","followers_url":"https://api.github.com/users/sridharjajoo/followers","following_url":"https://api.github.com/users/sridharjajoo/following{/other_user}","gists_url":"https://api.github.com/users/sridharjajoo/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharjajoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharjajoo/subscriptions","organizations_url":"https://api.github.com/users/sridharjajoo/orgs","repos_url":"https://api.github.com/users/sridharjajoo/repos","events_url":"https://api.github.com/users/sridharjajoo/events{/privacy}","received_events_url":"https://api.github.com/users/sridharjajoo/received_events","type":"User","site_admin":false},"assignees":[{"login":"sridharjajoo","id":20684618,"avatar_url":"https://avatars0.githubusercontent.com/u/20684618?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharjajoo","html_url":"https://github.com/sridharjajoo","followers_url":"https://api.github.com/users/sridharjajoo/followers","following_url":"https://api.github.com/users/sridharjajoo/following{/other_user}","gists_url":"https://api.github.com/users/sridharjajoo/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharjajoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharjajoo/subscriptions","organizations_url":"https://api.github.com/users/sridharjajoo/orgs","repos_url":"https://api.github.com/users/sridharjajoo/repos","events_url":"https://api.github.com/users/sridharjajoo/events{/privacy}","received_events_url":"https://api.github.com/users/sridharjajoo/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":634391022,"url":"https://api.github.com/repos/fossasia/open-event-orga-app/labels/needs-review","name":"needs-review","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965/commits","review_comments_url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965/comments","review_comment_url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/965/comments","statuses_url":"https://api.github.com/repos/fossasia/open-event-orga-app/statuses/c96a03657d31e7b73a34958c54672364cbabba61","head":{"label":"sridharjajoo:viewmodel","ref":"viewmodel","sha":"c96a03657d31e7b73a34958c54672364cbabba61","user":{"login":"sridharjajoo","id":20684618,"avatar_url":"https://avatars0.githubusercontent.com/u/20684618?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharjajoo","html_url":"https://github.com/sridharjajoo","followers_url":"https://api.github.com/users/sridharjajoo/followers","following_url":"https://api.github.com/users/sridharjajoo/following{/other_user}","gists_url":"https://api.github.com/users/sridharjajoo/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharjajoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharjajoo/subscriptions","organizations_url":"https://api.github.com/users/sridharjajoo/orgs","repos_url":"https://api.github.com/users/sridharjajoo/repos","events_url":"https://api.github.com/users/sridharjajoo/events{/privacy}","received_events_url":"https://api.github.com/users/sridharjajoo/received_events","type":"User","site_admin":false},"repo":{"id":125760454,"name":"open-event-orga-app","full_name":"sridharjajoo/open-event-orga-app","owner":{"login":"sridharjajoo","id":20684618,"avatar_url":"https://avatars0.githubusercontent.com/u/20684618?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharjajoo","html_url":"https://github.com/sridharjajoo","followers_url":"https://api.github.com/users/sridharjajoo/followers","following_url":"https://api.github.com/users/sridharjajoo/following{/other_user}","gists_url":"https://api.github.com/users/sridharjajoo/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharjajoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharjajoo/subscriptions","organizations_url":"https://api.github.com/users/sridharjajoo/orgs","repos_url":"https://api.github.com/users/sridharjajoo/repos","events_url":"https://api.github.com/users/sridharjajoo/events{/privacy}","received_events_url":"https://api.github.com/users/sridharjajoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sridharjajoo/open-event-orga-app","description":"Open Event Mobile App for Organizers and Entry Managers https://github.com/fossasia/open-event-orga-app/raw/apk/test-app-debug.apk","fork":true,"url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app","forks_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/forks","keys_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/teams","hooks_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/hooks","issue_events_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/issues/events{/number}","events_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/events","assignees_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/assignees{/user}","branches_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/branches{/branch}","tags_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/tags","blobs_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/statuses/{sha}","languages_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/languages","stargazers_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/stargazers","contributors_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/contributors","subscribers_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/subscribers","subscription_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/subscription","commits_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/contents/{+path}","compare_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/merges","archive_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/downloads","issues_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/issues{/number}","pulls_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/pulls{/number}","milestones_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/milestones{/number}","notifications_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/labels{/name}","releases_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/releases{/id}","deployments_url":"https://api.github.com/repos/sridharjajoo/open-event-orga-app/deployments","created_at":"2018-03-18T19:33:17Z","updated_at":"2018-04-26T14:48:05Z","pushed_at":"2018-05-20T20:12:11Z","git_url":"git://github.com/sridharjajoo/open-event-orga-app.git","ssh_url":"git@github.com:sridharjajoo/open-event-orga-app.git","clone_url":"https://github.com/sridharjajoo/open-event-orga-app.git","svn_url":"https://github.com/sridharjajoo/open-event-orga-app","homepage":"","size":19277,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"fossasia:development","ref":"development","sha":"b9217322e02fff99712f9e1ccb125698b2fe1d00","user":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"repo":{"id":65606855,"name":"open-event-orga-app","full_name":"fossasia/open-event-orga-app","owner":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fossasia/open-event-orga-app","description":"Open Event Mobile App for Organizers and Entry Managers https://github.com/fossasia/open-event-orga-app/raw/apk/test-app-debug.apk","fork":false,"url":"https://api.github.com/repos/fossasia/open-event-orga-app","forks_url":"https://api.github.com/repos/fossasia/open-event-orga-app/forks","keys_url":"https://api.github.com/repos/fossasia/open-event-orga-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fossasia/open-event-orga-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fossasia/open-event-orga-app/teams","hooks_url":"https://api.github.com/repos/fossasia/open-event-orga-app/hooks","issue_events_url":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/events{/number}","events_url":"https://api.github.com/repos/fossasia/open-event-orga-app/events","assignees_url":"https://api.github.com/repos/fossasia/open-event-orga-app/assignees{/user}","branches_url":"https://api.github.com/repos/fossasia/open-event-orga-app/branches{/branch}","tags_url":"https://api.github.com/repos/fossasia/open-event-orga-app/tags","blobs_url":"https://api.github.com/repos/fossasia/open-event-orga-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fossasia/open-event-orga-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fossasia/open-event-orga-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/fossasia/open-event-orga-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fossasia/open-event-orga-app/statuses/{sha}","languages_url":"https://api.github.com/repos/fossasia/open-event-orga-app/languages","stargazers_url":"https://api.github.com/repos/fossasia/open-event-orga-app/stargazers","contributors_url":"https://api.github.com/repos/fossasia/open-event-orga-app/contributors","subscribers_url":"https://api.github.com/repos/fossasia/open-event-orga-app/subscribers","subscription_url":"https://api.github.com/repos/fossasia/open-event-orga-app/subscription","commits_url":"https://api.github.com/repos/fossasia/open-event-orga-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/fossasia/open-event-orga-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/fossasia/open-event-orga-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/fossasia/open-event-orga-app/contents/{+path}","compare_url":"https://api.github.com/repos/fossasia/open-event-orga-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fossasia/open-event-orga-app/merges","archive_url":"https://api.github.com/repos/fossasia/open-event-orga-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fossasia/open-event-orga-app/downloads","issues_url":"https://api.github.com/repos/fossasia/open-event-orga-app/issues{/number}","pulls_url":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls{/number}","milestones_url":"https://api.github.com/repos/fossasia/open-event-orga-app/milestones{/number}","notifications_url":"https://api.github.com/repos/fossasia/open-event-orga-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fossasia/open-event-orga-app/labels{/name}","releases_url":"https://api.github.com/repos/fossasia/open-event-orga-app/releases{/id}","deployments_url":"https://api.github.com/repos/fossasia/open-event-orga-app/deployments","created_at":"2016-08-13T08:08:39Z","updated_at":"2018-05-20T03:22:23Z","pushed_at":"2018-05-20T20:12:12Z","git_url":"git://github.com/fossasia/open-event-orga-app.git","ssh_url":"git@github.com:fossasia/open-event-orga-app.git","clone_url":"https://github.com/fossasia/open-event-orga-app.git","svn_url":"https://github.com/fossasia/open-event-orga-app","homepage":"","size":20282,"stargazers_count":392,"watchers_count":392,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":125,"mirror_url":null,"archived":false,"open_issues_count":39,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":125,"open_issues":39,"watchers":392,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965"},"html":{"href":"https://github.com/fossasia/open-event-orga-app/pull/965"},"issue":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/965"},"comments":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/issues/965/comments"},"review_comments":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965/comments"},"review_comment":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/pulls/965/commits"},"statuses":{"href":"https://api.github.com/repos/fossasia/open-event-orga-app/statuses/c96a03657d31e7b73a34958c54672364cbabba61"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"iamareebjamal"}}