Created
July 16, 2017 21:13
-
-
Save azzeddineCH/219588d688d38926c3a014c3b1124e27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* a public method to handel the user sign in event from the auth fragment | |
* | |
* @param email a string holds the user email address | |
* @param password a string holds the user text password | |
* @param view a view holds the auth widgets to hide | |
*/ | |
public void handleSignIn(String email, String password, final View view){ | |
showProgress(true,view); | |
FirebaseUtils.auth.signInWithEmailAndPassword(email, password).addOnCompleteListener( | |
new OnCompleteListener<AuthResult>() { | |
@Override | |
public void onComplete(@NonNull Task<AuthResult> task) { | |
if (task.isSuccessful()){ | |
startChatActivity(); | |
}else{ | |
// displaying an error message toast | |
Toast.makeText(LauncherActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show(); | |
showProgress(false,view); | |
} | |
} | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment