broakenmedia / MultiContactPicker

Launch a multi-select contact picker activity, useful for importing and inviting contacts to apps.
Apache License 2.0
143 stars 58 forks source link

Fix "infinite loading" if no contacts are loaded. #21

Closed atholbro closed 6 years ago

atholbro commented 6 years ago

Currently MutliContactPicker only hides it's progress bar (spinner) when the first contact is loaded. If the device has no contacts, then the progress spinner remains on screen forever. This gives the user the impression that the app is slow / not working.

This PR adds an additional call to hide the progress bar in the onComplete() callback. This way the progress bar is hidden when no contacts are loaded. The call to hide the progress bar when the first contact is loaded remains, so that the current behavior when contacts are present remains the same.

I also added a simple text view which is shown in the onComplete() callback if no contacts were loaded. It simply says "No contacts found", so that the user is aware of why nothing is shown on screen.

broakenmedia commented 6 years ago

Great stuff, thank you!