use of com.androidstudy.andelamedmanager.data.model.User in project Andela-Med-Manager by jumaallan.
the class AuthActivity method handleSignInResult.
private void handleSignInResult(GoogleSignInResult result) {
Timber.d("handleSignInResult:" + result.isSuccess() + " " + result.getStatus());
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
GoogleSignInAccount acct = result.getSignInAccount();
assert acct != null;
String name = acct.getDisplayName();
String imageUrl = String.valueOf(acct.getPhotoUrl());
/*
* Save to Room DB
* Set the Logged in status to true
* Navigate user to Main Activity
*/
addUserViewModel.addUser(new User("1", name, imageUrl));
Settings.setLoggedInSharedPref(true);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
finish();
}
}
use of com.androidstudy.andelamedmanager.data.model.User in project AndelaMedManager by jumaallan.
the class AuthActivity method handleSignInResult.
private void handleSignInResult(GoogleSignInResult result) {
Timber.d("handleSignInResult:" + result.isSuccess() + " " + result.getStatus());
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
GoogleSignInAccount acct = result.getSignInAccount();
assert acct != null;
String name = acct.getDisplayName();
String imageUrl = String.valueOf(acct.getPhotoUrl());
/*
* Save to Room DB
* Set the Logged in status to true
* Navigate user to Main Activity
*/
addUserViewModel.addUser(new User("1", name, imageUrl));
Settings.setLoggedInSharedPref(true);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
finish();
}
}
Aggregations