forked from github/szkolny
[Login] Remove Login migration fragment (fix).
This commit is contained in:
parent
aa161b5b0e
commit
dcd355851d
@ -1,17 +1,18 @@
|
|||||||
package pl.szczodrzynski.edziennik.ui.modules.login;
|
package pl.szczodrzynski.edziennik.ui.modules.login;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.navigation.NavDestination;
|
||||||
|
import androidx.navigation.NavOptions;
|
||||||
|
import androidx.navigation.Navigation;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.navigation.NavDestination;
|
|
||||||
import androidx.navigation.NavOptions;
|
|
||||||
import androidx.navigation.Navigation;
|
|
||||||
import pl.szczodrzynski.edziennik.App;
|
import pl.szczodrzynski.edziennik.App;
|
||||||
import pl.szczodrzynski.edziennik.R;
|
import pl.szczodrzynski.edziennik.R;
|
||||||
import pl.szczodrzynski.edziennik.data.api.AppError;
|
import pl.szczodrzynski.edziennik.data.api.AppError;
|
||||||
@ -34,12 +35,6 @@ public class LoginActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
NavDestination destination = Navigation.findNavController(this, R.id.nav_host_fragment).getCurrentDestination();
|
NavDestination destination = Navigation.findNavController(this, R.id.nav_host_fragment).getCurrentDestination();
|
||||||
if (destination != null && destination.getId() == R.id.loginMigrationFragment) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (destination != null && destination.getId() == R.id.loginMigrationSyncFragment) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (destination != null && destination.getId() == R.id.loginSyncErrorFragment) {
|
if (destination != null && destination.getId() == R.id.loginSyncErrorFragment) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,11 @@ import androidx.databinding.DataBindingUtil;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.navigation.NavController;
|
import androidx.navigation.NavController;
|
||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
|
|
||||||
import pl.szczodrzynski.edziennik.App;
|
import pl.szczodrzynski.edziennik.App;
|
||||||
import pl.szczodrzynski.edziennik.ui.modules.feedback.FeedbackActivity;
|
|
||||||
import pl.szczodrzynski.edziennik.R;
|
import pl.szczodrzynski.edziennik.R;
|
||||||
import pl.szczodrzynski.edziennik.databinding.FragmentLoginChooserBinding;
|
import pl.szczodrzynski.edziennik.databinding.FragmentLoginChooserBinding;
|
||||||
|
import pl.szczodrzynski.edziennik.ui.modules.feedback.FeedbackActivity;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_CANCELED;
|
import static android.app.Activity.RESULT_CANCELED;
|
||||||
|
|
||||||
@ -57,9 +58,6 @@ public class LoginChooserFragment extends Fragment {
|
|||||||
b.cancelButton.setVisibility(View.VISIBLE);
|
b.cancelButton.setVisibility(View.VISIBLE);
|
||||||
b.cancelButton.setOnClickListener((v -> nav.navigateUp()));
|
b.cancelButton.setOnClickListener((v -> nav.navigateUp()));
|
||||||
}
|
}
|
||||||
else if (app.appConfig.lastAppVersion < 1991) {
|
|
||||||
nav.navigate(R.id.loginMigrationFragment, null, LoginActivity.navOptions);
|
|
||||||
}
|
|
||||||
else if (app.appConfig.loginFinished) {
|
else if (app.appConfig.loginFinished) {
|
||||||
// we are navigated here from AppDrawer
|
// we are navigated here from AppDrawer
|
||||||
b.cancelButton.setVisibility(View.VISIBLE);
|
b.cancelButton.setVisibility(View.VISIBLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user