Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
458562b1
Commit
458562b1
authored
Jun 27, 2018
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ProgressDialog for login
parent
e53c57e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/LoginActivity.java
.../main/java/in/ac/iitb/gymkhana/iitbapp/LoginActivity.java
+8
-5
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/LoginActivity.java
View file @
458562b1
...
...
@@ -3,6 +3,7 @@ package in.ac.iitb.gymkhana.iitbapp;
import
android.annotation.TargetApi
;
import
android.app.PendingIntent
;
import
android.app.ProgressDialog
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -52,6 +53,7 @@ public class LoginActivity extends AppCompatActivity {
private
AuthorizationService
mAuthService
;
private
BroadcastReceiver
mRegistrationBroadcastReceiver
;
private
boolean
isReceiverRegistered
;
private
ProgressDialog
progressDialog
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -162,17 +164,18 @@ public class LoginActivity extends AppCompatActivity {
}
private
void
handleAuthorizationResponse
(
@NonNull
Intent
intent
)
{
progressDialog
=
new
ProgressDialog
(
this
);
progressDialog
.
setMessage
(
"Logging In"
);
progressDialog
.
setCancelable
(
false
);
progressDialog
.
setIndeterminate
(
true
);
progressDialog
.
show
();
AuthorizationResponse
response
=
AuthorizationResponse
.
fromIntent
(
intent
);
AuthorizationException
error
=
AuthorizationException
.
fromIntent
(
intent
);
if
(
response
!=
null
)
{
authCode
=
response
.
authorizationCode
;
Log
.
d
(
TAG
,
"Received AuthorizationResponse: "
+
"AuthCode: "
+
authCode
);
Toast
.
makeText
(
this
,
"AuthCode: "
+
authCode
,
Toast
.
LENGTH_SHORT
)
.
show
();
if
(
checkPlayServices
())
{
Intent
registerIntent
=
new
Intent
(
this
,
RegistrationIntentService
.
class
);
startService
(
registerIntent
);
}
...
...
@@ -234,7 +237,7 @@ public class LoginActivity extends AppCompatActivity {
i
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
);
i
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
startActivity
(
i
);
progressDialog
.
dismiss
();
//Save credentials in AccountManager to keep user logged in
//Go to MainActivity
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment