Screen Rotating when watching Canteen Plan fixed
This commit is contained in:
@@ -54,12 +54,13 @@ public class MainActivity extends AppCompatActivity
|
|||||||
private static final int FRAGMENT_CANTEENS_DETAILS = 6;
|
private static final int FRAGMENT_CANTEENS_DETAILS = 6;
|
||||||
private static final int FRAGMENT_PREFERENCES = 7;
|
private static final int FRAGMENT_PREFERENCES = 7;
|
||||||
|
|
||||||
//zum speichern des angezeigten FRAGMENTs bei einem erneuten login (z.B. Cookies abgelaufen)
|
//zum Speichern des angezeigten Fragments bei einem erneuten login (z.B. Cookies abgelaufen)
|
||||||
private int last_Fragment = FRAGMENT_NONE;
|
private int last_Fragment = FRAGMENT_NONE;
|
||||||
private String last_Fragment_id = "";
|
private String last_Fragment_id = "";
|
||||||
|
|
||||||
private static final String ARG_FRAGMENT_PAGE = "fragment_page";
|
private static final String ARG_FRAGMENT_PAGE = "fragment_page";
|
||||||
private static final String ARG_FRAGMENT_STATUS = "fragment_status";
|
private static final String ARG_FRAGMENT_STATUS = "fragment_status";
|
||||||
|
private static final String ARG_LOGIN_STATUS = "login_status";
|
||||||
|
|
||||||
private FragmentManager mFragmentManager;
|
private FragmentManager mFragmentManager;
|
||||||
private GoogleAuth mGoogleAuth;
|
private GoogleAuth mGoogleAuth;
|
||||||
@@ -97,24 +98,15 @@ public class MainActivity extends AppCompatActivity
|
|||||||
mFragmentManager = getSupportFragmentManager();
|
mFragmentManager = getSupportFragmentManager();
|
||||||
|
|
||||||
LoginToken loginToken = getKVV().easyLogin();
|
LoginToken loginToken = getKVV().easyLogin();
|
||||||
if (newFragmentPage != FRAGMENT_LOGIN && newFragmentPage != FRAGMENT_STARTUP && newFragmentPage != FRAGMENT_NONE) {
|
log.d(loginToken, last_Fragment, last_Fragment_id, newFragmentPage, newFragmentData);
|
||||||
if (loginToken != null)
|
if (loginToken == null) {
|
||||||
toLoginState(loginToken, newFragmentPage, newFragmentData);
|
|
||||||
else
|
|
||||||
checkAndDoLogin();
|
checkAndDoLogin();
|
||||||
} else {
|
} else {
|
||||||
if (loginToken != null)
|
if (newFragmentPage != FRAGMENT_LOGIN && newFragmentPage != FRAGMENT_STARTUP && newFragmentPage != FRAGMENT_NONE)
|
||||||
toLoginState(loginToken, getDefaultFragmentAfterLogin(), "");
|
toLoginState(loginToken, newFragmentPage, newFragmentData);
|
||||||
else
|
else
|
||||||
checkAndDoLogin();
|
toLoginState(loginToken, getDefaultFragmentAfterLogin(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*this.getCanteenBrowser().getCanteens(success -> {
|
|
||||||
Canteen canteen = success.get(0);
|
|
||||||
this.getCanteenBrowser().getCanteen(canteen, success1 -> {
|
|
||||||
this.getCanteenBrowser().getDay(canteen.get(0), log::d, log::e, true);
|
|
||||||
}, log::e, true);
|
|
||||||
}, log::e, true);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -382,7 +374,10 @@ public class MainActivity extends AppCompatActivity
|
|||||||
mNavigationView.inflateMenu(R.menu.activity_main_drawer);
|
mNavigationView.inflateMenu(R.menu.activity_main_drawer);
|
||||||
afterAnyMenuInflate();
|
afterAnyMenuInflate();
|
||||||
} // switch to login
|
} // switch to login
|
||||||
else if ((fragmentPage == FRAGMENT_STARTUP || fragmentPage == FRAGMENT_LOGIN || fragmentPage == FRAGMENT_NONE) && (newFragment != FRAGMENT_STARTUP && newFragment != FRAGMENT_LOGIN && newFragment != FRAGMENT_CANTEENS && newFragment != FRAGMENT_CANTEENS_DETAILS)) {
|
else if (
|
||||||
|
(fragmentPage == FRAGMENT_STARTUP || fragmentPage == FRAGMENT_LOGIN || fragmentPage == FRAGMENT_NONE) &&
|
||||||
|
((newFragment != FRAGMENT_STARTUP && newFragment != FRAGMENT_LOGIN) || (getKVV().easyLogin() != null))
|
||||||
|
) {
|
||||||
View header = mNavigationView.getHeaderView(0);
|
View header = mNavigationView.getHeaderView(0);
|
||||||
//header.findViewById(R.id.imageView).setVisibility(View.VISIBLE);
|
//header.findViewById(R.id.imageView).setVisibility(View.VISIBLE);
|
||||||
header.findViewById(R.id.login_name).setVisibility(View.VISIBLE);
|
header.findViewById(R.id.login_name).setVisibility(View.VISIBLE);
|
||||||
|
|||||||
Reference in New Issue
Block a user