Show a progress indicator while logging in account using saved password.

On slower devices the white screen is shown for a few seconds after the
status logo. It looks like that something is wrong with the app.

This commit adds a simple progress screen (full-screen with an animated
activity indicator) that is shown before the main screen is loaded.
This commit is contained in:
Igor Mandrigin 2018-08-28 16:08:40 +02:00 committed by Roman Volosovskyi
parent aef1050924
commit 6de53a5e9c
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
4 changed files with 24 additions and 0 deletions

View File

@ -77,5 +77,6 @@
(if password
(handlers-macro/merge-fx cofx
{:db (assoc-in db [:accounts/login :password] password)}
(navigation/navigate-to-cofx :progress nil)
(user-login))
(navigation/navigate-to-cofx :login nil cofx)))

View File

@ -0,0 +1,10 @@
(ns status-im.ui.screens.progress.styles
(:require [status-im.ui.components.colors :as colors]
[status-im.ui.components.toolbar.styles :as toolbar.styles]))
(def container
{:flex 1
:align-items :center
:justify-content :center
:background-color colors/white})

View File

@ -0,0 +1,10 @@
(ns status-im.ui.screens.progress.views
(:require-macros [status-im.utils.views :refer [defview letsubs]])
(:require [status-im.ui.screens.progress.styles :as styles]
[status-im.ui.components.react :as react]
[status-im.ui.components.react :as components]))
;; a simple view with animated progress indicator in its center
(defview progress [_]
[react/keyboard-avoiding-view {:style styles/container}
[components/activity-indicator {:animating true}]])

View File

@ -11,6 +11,8 @@
[status-im.ui.screens.accounts.recover.views :refer [recover]]
[status-im.ui.screens.accounts.views :refer [accounts]]
[status-im.ui.screens.progress.views :refer [progress]]
[status-im.chat.screen :refer [chat]]
[status-im.ui.screens.add-new.views :refer [add-new]]
[status-im.ui.screens.add-new.new-chat.views :refer [new-chat]]
@ -87,6 +89,7 @@
:profile-photo-capture profile-photo-capture
:accounts accounts
:login login
:progress progress
:recover recover
:network-settings network-settings
:extensions-settings extensions-settings