diff --git a/app/src/main/java/com/alexandr7035/gitstat/view/login/LoginFragment.kt b/app/src/main/java/com/alexandr7035/gitstat/view/login/LoginFragment.kt index ac5820f7..c0a20ff6 100644 --- a/app/src/main/java/com/alexandr7035/gitstat/view/login/LoginFragment.kt +++ b/app/src/main/java/com/alexandr7035/gitstat/view/login/LoginFragment.kt @@ -75,9 +75,10 @@ class LoginFragment: Fragment() { return } else { - ////Log.d(LOG_TAG, "do login request") token = binding!!.tokenEditText.text.toString() -// viewModel.doLoginRequest(token) + + // Show progress stub and do login + binding?.loginProgressView?.visibility = View.VISIBLE viewModel.saveToken(token) viewModel.authorize() @@ -89,6 +90,9 @@ class LoginFragment: Fragment() { viewModel.getAuthResultLiveData().observe(viewLifecycleOwner, { status -> + // Hide progress + binding?.loginProgressView?.visibility = View.GONE + when (status) { AuthStatus.SUCCESS -> { // FIXME Not good. Find better solution diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index 7b21438f..b5f8a426 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -83,4 +83,28 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + \ No newline at end of file