Added failed login toasts & password visibility toggle & no server field auto correct
This commit is contained in:
parent
b236e7a9cd
commit
bcd17d4853
4 changed files with 21 additions and 2 deletions
|
|
@ -107,6 +107,11 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
return;
|
||||
}
|
||||
|
||||
if(username.getText().toString().trim().length()==0){
|
||||
Toast.makeText(context, context.getResources().getString(R.string.error_no_username), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
connectionManager.Connect(server.getText().toString(), new Response<ConnectionResult>() {
|
||||
@Override
|
||||
public void onResponse(ConnectionResult result) {
|
||||
|
|
@ -115,6 +120,7 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
List<ServerInfo> servers = result.getServers();
|
||||
|
||||
if (servers.size() < 1) {
|
||||
Toast.makeText(context, context.getResources().getString(R.string.error_unreachable_server), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +131,11 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
if (result.getAccessToken() == null) return;
|
||||
check(context, serverCredentials, result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
Toast.makeText(context, context.getResources().getString(R.string.error_login_credentials), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue