From a6c0efcb8189de9bd01c2d8c017529b627a3ee5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Sun, 21 Nov 2021 08:47:23 +0100 Subject: [PATCH] Fix empty student list in LoginStudentSelect view (#1668) --- .../io/github/wulkanowy/ui/modules/login/LoginActivity.kt | 1 + .../ui/modules/login/symbol/LoginSymbolPresenter.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginActivity.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginActivity.kt index 0605fa2d8..e607cef15 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginActivity.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginActivity.kt @@ -74,6 +74,7 @@ class LoginActivity : BaseActivity(), Logi with(binding.loginViewpager) { adapter = pagerAdapter isUserInputEnabled = false + offscreenPageLimit = 2 setOnSelectPageListener(presenter::onViewSelected) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/symbol/LoginSymbolPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/symbol/LoginSymbolPresenter.kt index 7c84e1ec1..1ba7e5b32 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/symbol/LoginSymbolPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/symbol/LoginSymbolPresenter.kt @@ -50,7 +50,10 @@ class LoginSymbolPresenter @Inject constructor( } fun attemptLogin(symbol: String) { - if (loginData == null) throw IllegalArgumentException("Login data is null") + if (loginData == null) { + Timber.w("LoginSymbolPresenter - Login data is null") + return + } if (symbol.isBlank()) { view?.setErrorSymbolRequire()