Workaround: The add account button always works from the main menu

This commit is contained in:
Mathias-Boulay 2022-11-20 12:53:31 +01:00
parent 0c080aad19
commit e53a30c77e

View File

@ -81,10 +81,10 @@ public class LauncherActivity extends BaseActivity {
/* Listener for the auth method selection screen */ /* Listener for the auth method selection screen */
private final ExtraListener<Boolean> mSelectAuthMethod = (key, value) -> { private final ExtraListener<Boolean> mSelectAuthMethod = (key, value) -> {
if(isFragmentVisible(SelectAuthFragment.TAG) Fragment fragment = getSupportFragmentManager().findFragmentById(mFragmentView.getId());
|| isFragmentVisible(LocalLoginFragment.TAG) // Allow starting the add account only from the main menu, should it be moved to fragment itself ?
|| isFragmentVisible(MicrosoftLoginFragment.TAG) if(!(fragment instanceof MainMenuFragment)) return false;
) return false;
Tools.swapFragment(this, SelectAuthFragment.class, SelectAuthFragment.TAG, true, null); Tools.swapFragment(this, SelectAuthFragment.class, SelectAuthFragment.TAG, true, null);
return false; return false;
}; };