Landry333 / Big-Owl

soen 490 project
2 stars 2 forks source link

BUG-273: Loading "Invite By Contact List" causes black screen when user has many contacts #273

Closed refatK closed 3 years ago

refatK commented 3 years ago

Related Issue(s):

117

Relevant File(s):

SearchContactsToSupervise.java

Describe the bug:

When the user has many contacts, when going to the page to invite a user using their contact list, going to that page can result in a long black screen, as if the app has froze.

To Reproduce:

Steps to reproduce the behavior:

  1. Add many contacts to the Android device (100 or greater)
  2. Run the app and login as any user if not already logged in
  3. Click "Add Users"
  4. Click "Invite from Contact List"

The screen will be frozen black but eventually load the contacts.

Expected behavior

We should get to the contacts page and see our contacts. At worst we should get to a normal page and the contacts would be loading.

Additional context:

https://stackoverflow.com/questions/26863223/android-black-screen-when-get-phone-contacts

Loading contacts is heavy, so we should probably consider loading them asynchronously, currently, this is not the case. Infinite scrolling and pagination might also need to be considered, as a long load time, while an improvement from a black screen, is also not great.