{"action":"created","comment":{"url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/comments/184189677","pull_request_review_id":115330259,"id":184189677,"diff_hunk":"@@ -0,0 +1,380 @@\n+package com.itis.android.firebasesimple.activity\n+\n+import android.content.Intent\n+import android.support.design.widget.Snackbar\n+import android.support.v7.app.AppCompatActivity\n+import android.os.Bundle\n+import android.text.TextUtils\n+import android.util.Log\n+import android.view.View\n+import android.view.ViewGroup\n+import android.widget.Button\n+import android.widget.EditText\n+import android.widget.TextView\n+\n+import com.google.android.gms.tasks.OnCompleteListener\n+import com.google.android.gms.tasks.Task\n+import com.google.firebase.FirebaseException\n+import com.google.firebase.FirebaseTooManyRequestsException\n+import com.google.firebase.auth.AuthResult\n+import com.google.firebase.auth.FirebaseAuth\n+import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException\n+import com.google.firebase.auth.FirebaseUser\n+import com.google.firebase.auth.PhoneAuthCredential\n+import com.google.firebase.auth.PhoneAuthProvider\n+import com.itis.android.firebasesimple.R\n+import com.itis.android.firebasesimple.utils.SoftKeyboard\n+\n+import java.util.concurrent.TimeUnit\n+\n+class PhoneAuthActivity : AppCompatActivity(), View.OnClickListener {\n+\n+    private var mAuth: FirebaseAuth? = null\n+\n+    private var mVerificationInProgress = false\n+    private var mVerificationId: String? = null\n+    private var mResendToken: PhoneAuthProvider.ForceResendingToken? = null\n+    private var mCallbacks: PhoneAuthProvider.OnVerificationStateChangedCallbacks? = null\n+\n+    private var mPhoneNumberViews: ViewGroup? = null\n+\n+    private var mStatusText: TextView? = null\n+    private var mDetailText: TextView? = null\n+\n+    private var mPhoneNumberField: EditText? = null\n+    private var mVerificationField: EditText? = null\n+\n+    private var mStartButton: Button? = null\n+    private var mVerifyButton: Button? = null\n+    private var mResendButton: Button? = null\n+\n+    override fun onCreate(savedInstanceState: Bundle?) {\n+        super.onCreate(savedInstanceState)\n+        setContentView(R.layout.activity_phone_auth)\n+\n+        // Restore instance state\n+        if (savedInstanceState != null) {\n+            onRestoreInstanceState(savedInstanceState)\n+        }\n+\n+        mAuth = FirebaseAuth.getInstance()\n+\n+        initFields()\n+        initClickListeners()\n+\n+        // Initialize phone auth callbacks\n+        mCallbacks = object : PhoneAuthProvider.OnVerificationStateChangedCallbacks() {\n+\n+            override fun onVerificationCompleted(credential: PhoneAuthCredential) {\n+                // This callback will be invoked in two situations:\n+                // 1 - Instant verification. In some cases the phone number can be instantly\n+                //     verified without needing to send or enter a verification code.\n+                // 2 - Auto-retrieval. On some devices Google Play services can automatically\n+                //     detect the incoming verification SMS and perform verification without\n+                //     user action.\n+                Log.d(TAG, \"onVerificationCompleted:$credential\")\n+\n+                mVerificationInProgress = false\n+\n+\n+                // Update the UI and attempt sign in with the phone credential\n+                updateUI(STATE_VERIFY_SUCCESS, credential)\n+\n+                signInWithPhoneAuthCredential(credential)\n+            }\n+\n+            override fun onVerificationFailed(e: FirebaseException) {\n+                // This callback is invoked in an invalid request for verification is made,\n+                // for instance if the the phone number format is not valid.\n+                Log.w(TAG, \"onVerificationFailed\", e)\n+\n+                mVerificationInProgress = false\n+\n+                if (e is FirebaseAuthInvalidCredentialsException) {\n+                    // Invalid request\n+                    mPhoneNumberField!!.error = \"Invalid phone number.\"","path":"app/src/main/java/com/itis/android/firebasesimple/activity/PhoneAuthActivity.kt","position":95,"original_position":95,"commit_id":"b1f6fdf21468a94675ca2ad2512162237d9fa589","original_commit_id":"b1f6fdf21468a94675ca2ad2512162237d9fa589","user":{"login":"NailShaykhrazievItis","id":36369179,"avatar_url":"https://avatars0.githubusercontent.com/u/36369179?v=4","gravatar_id":"","url":"https://api.github.com/users/NailShaykhrazievItis","html_url":"https://github.com/NailShaykhrazievItis","followers_url":"https://api.github.com/users/NailShaykhrazievItis/followers","following_url":"https://api.github.com/users/NailShaykhrazievItis/following{/other_user}","gists_url":"https://api.github.com/users/NailShaykhrazievItis/gists{/gist_id}","starred_url":"https://api.github.com/users/NailShaykhrazievItis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NailShaykhrazievItis/subscriptions","organizations_url":"https://api.github.com/users/NailShaykhrazievItis/orgs","repos_url":"https://api.github.com/users/NailShaykhrazievItis/repos","events_url":"https://api.github.com/users/NailShaykhrazievItis/events{/privacy}","received_events_url":"https://api.github.com/users/NailShaykhrazievItis/received_events","type":"User","site_admin":false},"body":"!!","created_at":"2018-04-25T20:06:28Z","updated_at":"2018-04-25T20:19:12Z","html_url":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8#discussion_r184189677","pull_request_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/comments/184189677"},"html":{"href":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8#discussion_r184189677"},"pull_request":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8","id":183554352,"html_url":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8","diff_url":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8.diff","patch_url":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8.patch","issue_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/8","number":8,"state":"open","locked":false,"title":"Kotlin HW(Zhestkov and Gayazov)","user":{"login":"IvanZhestkov","id":22200971,"avatar_url":"https://avatars0.githubusercontent.com/u/22200971?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanZhestkov","html_url":"https://github.com/IvanZhestkov","followers_url":"https://api.github.com/users/IvanZhestkov/followers","following_url":"https://api.github.com/users/IvanZhestkov/following{/other_user}","gists_url":"https://api.github.com/users/IvanZhestkov/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanZhestkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanZhestkov/subscriptions","organizations_url":"https://api.github.com/users/IvanZhestkov/orgs","repos_url":"https://api.github.com/users/IvanZhestkov/repos","events_url":"https://api.github.com/users/IvanZhestkov/events{/privacy}","received_events_url":"https://api.github.com/users/IvanZhestkov/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-23T20:53:24Z","updated_at":"2018-04-25T20:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cce6aef5b1ba8df3694ff3447a2100b93704100","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8/commits","review_comments_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8/comments","review_comment_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/8/comments","statuses_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/statuses/b1f6fdf21468a94675ca2ad2512162237d9fa589","head":{"label":"IvanZhestkov:master","ref":"master","sha":"b1f6fdf21468a94675ca2ad2512162237d9fa589","user":{"login":"IvanZhestkov","id":22200971,"avatar_url":"https://avatars0.githubusercontent.com/u/22200971?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanZhestkov","html_url":"https://github.com/IvanZhestkov","followers_url":"https://api.github.com/users/IvanZhestkov/followers","following_url":"https://api.github.com/users/IvanZhestkov/following{/other_user}","gists_url":"https://api.github.com/users/IvanZhestkov/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanZhestkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanZhestkov/subscriptions","organizations_url":"https://api.github.com/users/IvanZhestkov/orgs","repos_url":"https://api.github.com/users/IvanZhestkov/repos","events_url":"https://api.github.com/users/IvanZhestkov/events{/privacy}","received_events_url":"https://api.github.com/users/IvanZhestkov/received_events","type":"User","site_admin":false},"repo":{"id":128617075,"name":"firabase-sample","full_name":"IvanZhestkov/firabase-sample","owner":{"login":"IvanZhestkov","id":22200971,"avatar_url":"https://avatars0.githubusercontent.com/u/22200971?v=4","gravatar_id":"","url":"https://api.github.com/users/IvanZhestkov","html_url":"https://github.com/IvanZhestkov","followers_url":"https://api.github.com/users/IvanZhestkov/followers","following_url":"https://api.github.com/users/IvanZhestkov/following{/other_user}","gists_url":"https://api.github.com/users/IvanZhestkov/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanZhestkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanZhestkov/subscriptions","organizations_url":"https://api.github.com/users/IvanZhestkov/orgs","repos_url":"https://api.github.com/users/IvanZhestkov/repos","events_url":"https://api.github.com/users/IvanZhestkov/events{/privacy}","received_events_url":"https://api.github.com/users/IvanZhestkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IvanZhestkov/firabase-sample","description":null,"fork":true,"url":"https://api.github.com/repos/IvanZhestkov/firabase-sample","forks_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/forks","keys_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/teams","hooks_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/hooks","issue_events_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/issues/events{/number}","events_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/events","assignees_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/assignees{/user}","branches_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/branches{/branch}","tags_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/tags","blobs_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/git/refs{/sha}","trees_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/statuses/{sha}","languages_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/languages","stargazers_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/stargazers","contributors_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/contributors","subscribers_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/subscribers","subscription_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/subscription","commits_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/commits{/sha}","git_commits_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/git/commits{/sha}","comments_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/comments{/number}","issue_comment_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/issues/comments{/number}","contents_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/contents/{+path}","compare_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/merges","archive_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/downloads","issues_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/issues{/number}","pulls_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/pulls{/number}","milestones_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/milestones{/number}","notifications_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/labels{/name}","releases_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/releases{/id}","deployments_url":"https://api.github.com/repos/IvanZhestkov/firabase-sample/deployments","created_at":"2018-04-08T08:16:50Z","updated_at":"2018-04-23T20:50:38Z","pushed_at":"2018-04-23T20:50:37Z","git_url":"git://github.com/IvanZhestkov/firabase-sample.git","ssh_url":"git@github.com:IvanZhestkov/firabase-sample.git","clone_url":"https://github.com/IvanZhestkov/firabase-sample.git","svn_url":"https://github.com/IvanZhestkov/firabase-sample","homepage":null,"size":185,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NailShaykhrazievItis:master","ref":"master","sha":"33cc3f5ecdd496ad69931fb7f0de724303d71549","user":{"login":"NailShaykhrazievItis","id":36369179,"avatar_url":"https://avatars0.githubusercontent.com/u/36369179?v=4","gravatar_id":"","url":"https://api.github.com/users/NailShaykhrazievItis","html_url":"https://github.com/NailShaykhrazievItis","followers_url":"https://api.github.com/users/NailShaykhrazievItis/followers","following_url":"https://api.github.com/users/NailShaykhrazievItis/following{/other_user}","gists_url":"https://api.github.com/users/NailShaykhrazievItis/gists{/gist_id}","starred_url":"https://api.github.com/users/NailShaykhrazievItis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NailShaykhrazievItis/subscriptions","organizations_url":"https://api.github.com/users/NailShaykhrazievItis/orgs","repos_url":"https://api.github.com/users/NailShaykhrazievItis/repos","events_url":"https://api.github.com/users/NailShaykhrazievItis/events{/privacy}","received_events_url":"https://api.github.com/users/NailShaykhrazievItis/received_events","type":"User","site_admin":false},"repo":{"id":127764512,"name":"firabase-sample","full_name":"NailShaykhrazievItis/firabase-sample","owner":{"login":"NailShaykhrazievItis","id":36369179,"avatar_url":"https://avatars0.githubusercontent.com/u/36369179?v=4","gravatar_id":"","url":"https://api.github.com/users/NailShaykhrazievItis","html_url":"https://github.com/NailShaykhrazievItis","followers_url":"https://api.github.com/users/NailShaykhrazievItis/followers","following_url":"https://api.github.com/users/NailShaykhrazievItis/following{/other_user}","gists_url":"https://api.github.com/users/NailShaykhrazievItis/gists{/gist_id}","starred_url":"https://api.github.com/users/NailShaykhrazievItis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NailShaykhrazievItis/subscriptions","organizations_url":"https://api.github.com/users/NailShaykhrazievItis/orgs","repos_url":"https://api.github.com/users/NailShaykhrazievItis/repos","events_url":"https://api.github.com/users/NailShaykhrazievItis/events{/privacy}","received_events_url":"https://api.github.com/users/NailShaykhrazievItis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NailShaykhrazievItis/firabase-sample","description":null,"fork":false,"url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample","forks_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/forks","keys_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/teams","hooks_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/hooks","issue_events_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/events{/number}","events_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/events","assignees_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/assignees{/user}","branches_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/branches{/branch}","tags_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/tags","blobs_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/git/refs{/sha}","trees_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/statuses/{sha}","languages_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/languages","stargazers_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/stargazers","contributors_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/contributors","subscribers_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/subscribers","subscription_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/subscription","commits_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/commits{/sha}","git_commits_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/git/commits{/sha}","comments_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/comments{/number}","issue_comment_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/comments{/number}","contents_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/contents/{+path}","compare_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/merges","archive_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/downloads","issues_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues{/number}","pulls_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls{/number}","milestones_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/milestones{/number}","notifications_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/labels{/name}","releases_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/releases{/id}","deployments_url":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/deployments","created_at":"2018-04-02T14:05:38Z","updated_at":"2018-04-02T15:25:21Z","pushed_at":"2018-04-25T20:16:52Z","git_url":"git://github.com/NailShaykhrazievItis/firabase-sample.git","ssh_url":"git@github.com:NailShaykhrazievItis/firabase-sample.git","clone_url":"https://github.com/NailShaykhrazievItis/firabase-sample.git","svn_url":"https://github.com/NailShaykhrazievItis/firabase-sample","homepage":null,"size":150,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":7,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8"},"html":{"href":"https://github.com/NailShaykhrazievItis/firabase-sample/pull/8"},"issue":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/8"},"comments":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/NailShaykhrazievItis/firabase-sample/statuses/b1f6fdf21468a94675ca2ad2512162237d9fa589"}},"author_association":"NONE"}}
{"actor":{"display_login":"NailShaykhrazievItis"}}