Canteen Plan Fixed 2
This commit is contained in:
@@ -376,7 +376,7 @@ public class MainActivity extends AppCompatActivity
|
||||
} // switch to login
|
||||
else if (
|
||||
(fragmentPage == FRAGMENT_STARTUP || fragmentPage == FRAGMENT_LOGIN || fragmentPage == FRAGMENT_NONE) &&
|
||||
((newFragment != FRAGMENT_STARTUP && newFragment != FRAGMENT_LOGIN) || (getKVV().easyLogin() != null))
|
||||
(newFragment != FRAGMENT_STARTUP && newFragment != FRAGMENT_LOGIN && getKVV().isLoggedIn())
|
||||
) {
|
||||
View header = mNavigationView.getHeaderView(0);
|
||||
//header.findViewById(R.id.imageView).setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.HashMap;
|
||||
import de.sebse.fuplanner.services.KVV.types.LoginToken;
|
||||
import de.sebse.fuplanner.services.KVV.types.Modules;
|
||||
import de.sebse.fuplanner.tools.MainAcitivityListener;
|
||||
import de.sebse.fuplanner.tools.logging.Logger;
|
||||
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
||||
import de.sebse.fuplanner.tools.network.NetworkErrorCallback;
|
||||
|
||||
@@ -25,6 +26,7 @@ public class KVV {
|
||||
private final ArrayList<LastTokenCallback> updatingList;
|
||||
private final HashMap<String, Object> addons = new HashMap<>();
|
||||
private final MainAcitivityListener mListener;
|
||||
private Logger log = new Logger(this);
|
||||
|
||||
public KVV(Context context) {
|
||||
mListener = (MainAcitivityListener) context;
|
||||
@@ -32,6 +34,11 @@ public class KVV {
|
||||
this.updatingList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean isLoggedIn() {
|
||||
log.d(this.lastToken, new KVVLogin(this.context).easyLogin());
|
||||
return this.lastToken != null;
|
||||
}
|
||||
|
||||
public LoginToken easyLogin() {
|
||||
KVVLogin login = new KVVLogin(this.context);
|
||||
lastToken = login.easyLogin();
|
||||
|
||||
Reference in New Issue
Block a user