When I log in, I want a loading bar to appear while the login is being done. How do I get the process (time, size ...) of Firebase to be able to increment in the progress bar?
Here is the login code:
private void efetuarLogin() {
final FirebaseAuth autenticacaoFirebase = ConfiguracaoFirebase.getFirebaseAuth();
autenticacaoFirebase.signInWithEmailAndPassword(
usuario.getEmail(),
usuario.getSenha()
).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// FirebaseUser firebaseUser = autenticacaoFirebase.getCurrentUser();
telaPrincipal();
} else {
String erroExcecao = "";
try {
throw task.getException();
} catch (FirebaseAuthInvalidCredentialsException e) {
erroExcecao = "E-mail inválido e/ou senha incorreta";
MetodosAuxiliares.Alert(LoginActivity.this, erroExcecao);
} catch (Exception e) {
e.printStackTrace();
MetodosAuxiliares.Alert(LoginActivity.this, "Verifique seu e-mail e/ou senha");
}
}
}
});
}