Best practices to show a progress for Android JetPack?
up vote
1
down vote
favorite
We should init our ViewModel asynchronously. Loading the data right from a local SQLite DB could be quite fast(but not always). If we will pump data from some remote source it could be pretty notable delay. So user needs some visual feedback on it and main UI must not be available.
What are the best practices to show progress while data is preparing for ViewModel or when we send some data for processing(waiting for changes in the ViewModel)?
E.g., if LiveData value is null switch onto the Loading Progress fragment and prepare the ViewModel there and switch back when it will be ready? But ViewModel use to be bound to particular fragment...
Just make some root view invisible while data is loaded/processed? Other words add into each fragment some progress section to show it instead of main content?
But this approach requires too much boilerplate code for a lot of layouts.
Should we ever take care on it if know that data expected to be loaded almost immediately?
How do you handle long running operations UI in your JetPack apps?
add a comment |
up vote
1
down vote
favorite
We should init our ViewModel asynchronously. Loading the data right from a local SQLite DB could be quite fast(but not always). If we will pump data from some remote source it could be pretty notable delay. So user needs some visual feedback on it and main UI must not be available.
What are the best practices to show progress while data is preparing for ViewModel or when we send some data for processing(waiting for changes in the ViewModel)?
E.g., if LiveData value is null switch onto the Loading Progress fragment and prepare the ViewModel there and switch back when it will be ready? But ViewModel use to be bound to particular fragment...
Just make some root view invisible while data is loaded/processed? Other words add into each fragment some progress section to show it instead of main content?
But this approach requires too much boilerplate code for a lot of layouts.
Should we ever take care on it if know that data expected to be loaded almost immediately?
How do you handle long running operations UI in your JetPack apps?
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We should init our ViewModel asynchronously. Loading the data right from a local SQLite DB could be quite fast(but not always). If we will pump data from some remote source it could be pretty notable delay. So user needs some visual feedback on it and main UI must not be available.
What are the best practices to show progress while data is preparing for ViewModel or when we send some data for processing(waiting for changes in the ViewModel)?
E.g., if LiveData value is null switch onto the Loading Progress fragment and prepare the ViewModel there and switch back when it will be ready? But ViewModel use to be bound to particular fragment...
Just make some root view invisible while data is loaded/processed? Other words add into each fragment some progress section to show it instead of main content?
But this approach requires too much boilerplate code for a lot of layouts.
Should we ever take care on it if know that data expected to be loaded almost immediately?
How do you handle long running operations UI in your JetPack apps?
We should init our ViewModel asynchronously. Loading the data right from a local SQLite DB could be quite fast(but not always). If we will pump data from some remote source it could be pretty notable delay. So user needs some visual feedback on it and main UI must not be available.
What are the best practices to show progress while data is preparing for ViewModel or when we send some data for processing(waiting for changes in the ViewModel)?
E.g., if LiveData value is null switch onto the Loading Progress fragment and prepare the ViewModel there and switch back when it will be ready? But ViewModel use to be bound to particular fragment...
Just make some root view invisible while data is loaded/processed? Other words add into each fragment some progress section to show it instead of main content?
But this approach requires too much boilerplate code for a lot of layouts.
Should we ever take care on it if know that data expected to be loaded almost immediately?
How do you handle long running operations UI in your JetPack apps?
asked 15 hours ago
engilyin
300310
300310
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago
add a comment |
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53236742%2fbest-practices-to-show-a-progress-for-android-jetpack%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
how much data are you loading? is it a long list of some items?
– pskink
15 hours ago
there could be different cases. Couple of fields or long paged list. Also it could be from local DB or from the remote service.
– engilyin
5 hours ago
see developer.android.com/topic/libraries/architecture/paging
– pskink
5 hours ago