I have an App with retrofit and I make some calls to an Api
(like a LogIn in this case), some of them take a few seconds to load, so I want to know when I should make a loading screen and lock the interaction with the user. I see that ProgressDialog
is deprecated now, and they don't display it but they lock the interaction with the view. What should be better?
Asked
Active
Viewed 217 times
0

Sumit Shukla
- 4,116
- 5
- 38
- 57

David
- 414
- 7
- 17
-
Can you query only a percentage of the data first, then load more as the users requires it? – JakeB Jul 31 '19 at 15:20
-
Check "inderteminate progress bar". Show it on call and hide it when api call success. Use match parent for width and height. Use frame laout as the viewgroup – nfl-x Jul 31 '19 at 15:23
-
They are deprecated, but unlikely to go away any time soon. They are usable, but just to be on the safe side, do what @nfl-x said. – Gaurav Mall Jul 31 '19 at 15:41
-
@nfl-x but an "indeterminate progress bar" dont block the ui interaction, and in a Login should be better to locked to prevent the user interaction with the ui meanwhile the request being done. – David Jul 31 '19 at 15:53
-
1`ProgressBar` is not deprecated, you are wrong – Vladyslav Matviienko Jul 31 '19 at 16:03
-
Thanks @David. Glad it helped you!! – Sumit Shukla Jul 31 '19 at 16:18
-
Thanks to you @SumitShukla ! – David Jul 31 '19 at 16:24
1 Answers
3
- First of all it is not
ProgressBar
but it isProgressDialog
because it locks down user interaction until it hides. You can use a progress indicator like
ProgressBar
, which can be embedded in your app's UI. Alternatively, you can use anotification
to inform the user of the task's progress.HereA
skeleton screen
helps load a user interface gradually, a little at a time. This means that the barebones UI displays first. Then the loaded content is gradually populated on-screen.Shimmer effect
was created byFacebook
to indicate a loading status, so instead of usingProgressBar
or usual loader useShimmer
for a better design and user interface.

Sumit Shukla
- 4,116
- 5
- 38
- 57
-
If i want to lock the user interaction in a login to prevent that the user click again login button (or any other button in the view) what should i do? – David Jul 31 '19 at 15:55
-
-
You can disable or hide login button once it is clicked until response as success or not is received something like that. And there are many more things you can do!! – Sumit Shukla Jul 31 '19 at 16:07