diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatus.java | 8 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatus.java b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatus.java index edfed8d6..90ad0ffd 100644 --- a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatus.java @@ -92,6 +92,14 @@ public class UserStatus extends Observable { return session_status == SessionStatus.LOGGED_OUT; } + public boolean notLoggedIn() { + return session_status == SessionStatus.NOT_LOGGED_IN; + } + + public boolean didntLogOut() { + return session_status == SessionStatus.DIDNT_LOG_OUT; + } + public static void updateStatus(SessionStatus session_status, Resources resources) { current_status = getInstance(resources); current_status.sessionStatus(session_status); diff --git a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java index f670553f..20189904 100644 --- a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java @@ -138,10 +138,10 @@ public class UserStatusFragment extends Fragment implements Observer, SessionDia } private void updateButton() { - if(status.isLoggedIn()) + if(status.isLoggedIn() || status.didntLogOut()) button.setText(dashboard.getString(R.string.logout_button)); else if(allows_registration) { - if (status.isLoggedOut()) + if (status.isLoggedOut() || status.notLoggedIn()) button.setText(dashboard.getString(R.string.login_button)); else if (status.inProgress()) button.setText(dashboard.getString(android.R.string.cancel)); |