From dcd355851df2dbb5b626294a07e94122d741cb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 2 Nov 2019 19:25:44 +0100 Subject: [PATCH] [Login] Remove Login migration fragment (fix). --- .../edziennik/ui/modules/login/LoginActivity.java | 15 +++++---------- .../ui/modules/login/LoginChooserFragment.java | 6 ++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java index 5d5b210d..6b8e5ac1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java @@ -1,17 +1,18 @@ package pl.szczodrzynski.edziennik.ui.modules.login; -import androidx.databinding.DataBindingUtil; import android.os.Bundle; + 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 java.util.ArrayList; 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.R; import pl.szczodrzynski.edziennik.data.api.AppError; @@ -34,12 +35,6 @@ public class LoginActivity extends AppCompatActivity { @Override public void onBackPressed() { 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) { return; } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java index a2547b3a..7f5a2c49 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginChooserFragment.java @@ -12,10 +12,11 @@ import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; + import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.ui.modules.feedback.FeedbackActivity; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginChooserBinding; +import pl.szczodrzynski.edziennik.ui.modules.feedback.FeedbackActivity; import static android.app.Activity.RESULT_CANCELED; @@ -57,9 +58,6 @@ public class LoginChooserFragment extends Fragment { b.cancelButton.setVisibility(View.VISIBLE); 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) { // we are navigated here from AppDrawer b.cancelButton.setVisibility(View.VISIBLE);