{"action":"created","comment":{"url":"https://api.github.com/repos/hieumai/cura/pulls/comments/65654055","id":65654055,"diff_hunk":"@@ -0,0 +1,175 @@\n+package com.kms.cura.view;\n+\n+\n+import android.app.AlertDialog;\n+import android.app.DatePickerDialog;\n+import android.app.Dialog;\n+import android.content.Context;\n+import android.content.DialogInterface;\n+import android.os.Bundle;\n+import android.support.v4.app.DialogFragment;\n+import android.support.v4.app.Fragment;\n+import android.view.LayoutInflater;\n+import android.view.View;\n+import android.view.ViewGroup;\n+import android.widget.Button;\n+import android.widget.DatePicker;\n+import android.widget.EditText;\n+import android.widget.ImageButton;\n+import android.widget.LinearLayout;\n+import android.widget.Spinner;\n+import android.widget.TextView;\n+import android.widget.Toast;\n+\n+import com.kms.cura.R;\n+import com.kms.cura.utils.InputUtils;\n+\n+import java.text.SimpleDateFormat;\n+import java.util.ArrayList;\n+import java.util.Calendar;\n+import java.util.Date;\n+import java.util.List;\n+\n+/**\n+ * A simple {@link Fragment} subclass.\n+ */\n+public class RegDoc_PersonalFragment extends Fragment implements View.OnClickListener {\n+\n+    Context context;\n+    EditText edtFName, edtLName;\n+    String FName, LName;\n+    int sex;\n+    int day, month, year;\n+    Calendar calendar;\n+    TextView tvBirth;\n+    ImageButton btnChooseDate, btnNext;\n+    Spinner spnSex;\n+\n+    public RegDoc_PersonalFragment() {\n+        // Required empty public constructor\n+        this.context = context;\n+        calendar = Calendar.getInstance();\n+        day = calendar.get(Calendar.DAY_OF_MONTH);\n+        month = calendar.get(Calendar.MONTH) + 1;\n+        year = calendar.get(Calendar.YEAR)-24;\n+    }\n+\n+\n+    @Override\n+    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n+                             Bundle savedInstanceState) {\n+        // Inflate the layout for this fragment\n+        View myFragmentView = inflater.inflate(R.layout.fragment_reg_doc__personal, container, false);\n+        tvBirth = (TextView) myFragmentView.findViewById(R.id.tvBDate);\n+        btnChooseDate = (ImageButton) myFragmentView.findViewById(R.id.btnChooseDate);\n+        btnChooseDate.setOnClickListener(this);\n+        btnNext = (ImageButton) myFragmentView.findViewById(R.id.btnRegisterNext);\n+        btnNext.setOnClickListener(this);\n+        edtFName = (EditText) myFragmentView.findViewById(R.id.edtDocReg_FirstName);\n+        edtLName = (EditText) myFragmentView.findViewById(R.id.edtDocReg_LastName);\n+        spnSex = (Spinner) myFragmentView.findViewById(R.id.spnSex);\n+        // reform data if navigate from the next page\n+        Bundle bundle = getArguments();\n+        if (bundle != null) {\n+            setDateString(bundle.getInt(RegisterDoctorActivity.DOB_DAY, day), bundle.getInt(RegisterDoctorActivity.DOB_MONTH, month), bundle.getInt(RegisterDoctorActivity.DOB_YEAR, year));\n+            edtFName.setText(bundle.getString(RegisterDoctorActivity.FIRST_NAME, \"\"));\n+            edtLName.setText(bundle.getString(RegisterDoctorActivity.LAST_NAME, \"\"));\n+            String sex = bundle.getString(RegisterDoctorActivity.SEX, \"\");\n+            if (sex.equals(RegisterDoctorActivity.SEX_MALE))\n+                spnSex.setSelection(0);\n+            else if (sex.equals(RegisterDoctorActivity.SEX_FEMALE))\n+                spnSex.setSelection(1);\n+        } else {\n+            setDateString(day, month, year);\n+        }\n+        return myFragmentView;\n+    }\n+\n+    @Override\n+    public void onClick(View v) {\n+        if (v.getId() == R.id.btnChooseDate) {\n+            Dialog dateDialog = new DatePickerDialog(getActivity(),  AlertDialog.THEME_HOLO_LIGHT, myDateListener, year, month, day);\n+            //newFragment.show(getFragmentManager(), \"datePicker\");\n+            dateDialog.show();\n+        } else if (v.getId() == R.id.btnRegisterNext) {\n+            // check input\n+            if (checkInput()) {\n+                // process next page\n+                Bundle bundle = createBundle();\n+                Fragment professional = new RegDoc_ProfessionalFragment();\n+                professional.setArguments(bundle);\n+                getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.Fragment_DocReg, professional).commit();\n+            }\n+        }\n+    }\n+\n+    public void setDateString(int day, int month, int year)\n+    {\n+        StringBuilder builder = new StringBuilder();\n+        builder.append(\" \");\n+        if (month < 10)\n+            builder.append(\"0\");\n+        builder.append(\"\" + month + \"/\");\n+        if (day < 10)\n+            builder.append('0');\n+        builder.append(\"\" + day + \"/\");\n+        builder.append(\"\" + year);\n+        tvBirth.setText(builder.toString());\n+    }\n+\n+    private DatePickerDialog.OnDateSetListener myDateListener = new DatePickerDialog.OnDateSetListener() {\n+        @Override\n+        public void onDateSet(DatePicker arg0, int arg1, int arg2, int arg3) {\n+            // TODO Auto-generated method stub\n+            year = arg1;\n+            month = arg2 + 1;\n+            day = arg3;\n+            setDateString(arg3, arg2+1, arg1);\n+        }\n+    };\n+\n+    private boolean checkInput()\n+    {\n+        // check and show error\n+        boolean flag = true;\n+        if (!InputUtils.isNotEmpty(edtFName.getText().toString())) {\n+            edtFName.setError(getString(R.string.required_field));\n+            flag = false;","path":"app/src/main/java/com/kms/cura/view/RegDoc_PersonalFragment.java","position":137,"original_position":137,"commit_id":"0155f8e56dad6b1ed1e565456262a29b4021233e","original_commit_id":"0155f8e56dad6b1ed1e565456262a29b4021233e","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":"Should just return false here","created_at":"2016-06-03T03:59:05Z","updated_at":"2016-06-03T03:59:05Z","html_url":"https://github.com/hieumai/cura/pull/9#discussion_r65654055","pull_request_url":"https://api.github.com/repos/hieumai/cura/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/hieumai/cura/pulls/comments/65654055"},"html":{"href":"https://github.com/hieumai/cura/pull/9#discussion_r65654055"},"pull_request":{"href":"https://api.github.com/repos/hieumai/cura/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/hieumai/cura/pulls/9","id":72311124,"html_url":"https://github.com/hieumai/cura/pull/9","diff_url":"https://github.com/hieumai/cura/pull/9.diff","patch_url":"https://github.com/hieumai/cura/pull/9.patch","issue_url":"https://api.github.com/repos/hieumai/cura/issues/9","number":9,"state":"open","locked":false,"title":"KATI-18 Create doctor register UI","user":{"login":"toannguyen71195","id":18735110,"avatar_url":"https://avatars.githubusercontent.com/u/18735110?v=3","gravatar_id":"","url":"https://api.github.com/users/toannguyen71195","html_url":"https://github.com/toannguyen71195","followers_url":"https://api.github.com/users/toannguyen71195/followers","following_url":"https://api.github.com/users/toannguyen71195/following{/other_user}","gists_url":"https://api.github.com/users/toannguyen71195/gists{/gist_id}","starred_url":"https://api.github.com/users/toannguyen71195/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toannguyen71195/subscriptions","organizations_url":"https://api.github.com/users/toannguyen71195/orgs","repos_url":"https://api.github.com/users/toannguyen71195/repos","events_url":"https://api.github.com/users/toannguyen71195/events{/privacy}","received_events_url":"https://api.github.com/users/toannguyen71195/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-06-02T09:01:22Z","updated_at":"2016-06-03T03:59:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42ee36d1c4882c1de728f1e4be39140340352619","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hieumai/cura/pulls/9/commits","review_comments_url":"https://api.github.com/repos/hieumai/cura/pulls/9/comments","review_comment_url":"https://api.github.com/repos/hieumai/cura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hieumai/cura/issues/9/comments","statuses_url":"https://api.github.com/repos/hieumai/cura/statuses/0155f8e56dad6b1ed1e565456262a29b4021233e","head":{"label":"hieumai:KATI-18_Create-Doctor-Register-UI","ref":"KATI-18_Create-Doctor-Register-UI","sha":"0155f8e56dad6b1ed1e565456262a29b4021233e","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-02T09:01:22Z","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":326,"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":"hieumai:master","ref":"master","sha":"5bb3e50713a9de037094498570db07315adb71f1","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-02T09:01:22Z","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":326,"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/hieumai/cura/pulls/9"},"html":{"href":"https://github.com/hieumai/cura/pull/9"},"issue":{"href":"https://api.github.com/repos/hieumai/cura/issues/9"},"comments":{"href":"https://api.github.com/repos/hieumai/cura/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/hieumai/cura/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/hieumai/cura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hieumai/cura/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/hieumai/cura/statuses/0155f8e56dad6b1ed1e565456262a29b4021233e"}}}}
{"actor":{"display_login":"hieumai"}}