ContactsAutoCompleteTextView icon indicating copy to clipboard operation
ContactsAutoCompleteTextView copied to clipboard

Dropdown View not Displaying

Open goonerDroid opened this issue 9 years ago • 19 comments

Saw this weird bug where the dropdown view does not render when the Textview is selected.But writing the contact name and after some delay(10-15 mins) it shows the dropdown view.Noticed this weird bug on Lollipop devices although it works fine in pre-Lollipop devices.

PS.Also encountered this bug on Playstore sample app as well.

goonerDroid avatar Aug 24 '15 09:08 goonerDroid

Good morning @goonerDroid,

I do not understand what could be the reason of this bug but I'll have a look at it. Therefore could you give me roughly the number of your contacts and the option you selected (mail or phone). What do you have for phone?

The delay can be caused because it is asynchronous: the dropdown comes only when the data processing is finished.

lolobosse avatar Aug 24 '15 09:08 lolobosse

Tried searching multiple contacts as well as single contact(phone).Their is a considerable amount of delay, after some time it crashes randomly.Testing on Moto G

goonerDroid avatar Aug 24 '15 09:08 goonerDroid

@lolobosse is there any way we can optimize the Search thread in the Custom adapter class??and btw it is not OS specific issue,it is directly proportional to the number of contact result

goonerDroid avatar Aug 24 '15 13:08 goonerDroid

Yeah that's what I thought, I'll have a look but you can have a look at the search thread if you want. I'll be happy for any suggestion. The data are retrieved in CustomAdapter and the filter is done in AutoCompleteTextView

lolobosse avatar Aug 25 '15 08:08 lolobosse

Tried loading with async also.Same results!

goonerDroid avatar Aug 25 '15 09:08 goonerDroid

I discussed that with a friend (@matthieubulte) and he meant that there is no that much to do against that but a bit of profiling and see if there is a better data structure to deal with that problem (list is not that efficient).

Another way could be to make a call to the Android Contact DB as you type.

I need some time to solve that (and do not have that much: I'm studying and building my startup!)

lolobosse avatar Sep 01 '15 12:09 lolobosse

Cool.Me too will will be working on it.Will let you know if there is progress.Anyways best of luck for your startup!

goonerDroid avatar Sep 01 '15 13:09 goonerDroid

Can you test it again? I almost rewrote the whole lib (not on master branch but the one I referenced the commit from)

lolobosse avatar Sep 06 '15 16:09 lolobosse

Same results buddy!!The device i'm testing has approx 3000 contacts.Has a delay of 1-2 mins!

goonerDroid avatar Sep 12 '15 09:09 goonerDroid

You tested on the test branch right ^^?

lolobosse avatar Sep 13 '15 21:09 lolobosse

Tested on the properCustomAdapter branch!Still the same results.Can we pre-load all the contacts and cache them before they are requested??You are doing that i guess?

goonerDroid avatar Sep 14 '15 14:09 goonerDroid

Yes, they're cached... Do you have the same problem on Google contacts search? Or is it working fine?

lolobosse avatar Sep 18 '15 08:09 lolobosse

Why aren't you using Loader Callbacks?

goonerDroid avatar Sep 18 '15 08:09 goonerDroid

Because I didn't know they exist, I made Callbacks myself but it seems to be a good idea. Do you have a API ref about that topic? :smile: :+1:

lolobosse avatar Sep 18 '15 08:09 lolobosse

checkout his implementation of Loaders and weak references in Asyncs https://github.com/codinguser/android_contact_picker. Trying to hack these two together!

goonerDroid avatar Sep 18 '15 08:09 goonerDroid

Ok ok, I see, I'll implement that asap. That's a good idea, I started 4 years ago and these things didn't exist but it's a very good idea :+1: :+1: :stuck_out_tongue_winking_eye:

lolobosse avatar Sep 18 '15 08:09 lolobosse

Cool man even i' m doing it now!Let's close this goddamn issue!!

goonerDroid avatar Sep 18 '15 08:09 goonerDroid

I'm at work right now, so if you want to make a pull request, I'll be very happy to look at it :smile: If you want, @alexjlockwood did a great post about that topic: http://www.androiddesignpatterns.com/2012/07/loaders-and-loadermanager-background.html

lolobosse avatar Sep 18 '15 08:09 lolobosse

So I'm back on that project because I have a bit more time now.

I'll try the following:

  1. Implement the a LoaderManager in the adapter.
  2. Find a way to get 10K contacts on a device to be able to test it properly.
  3. Remove the fake async (it waits to have all the results). Let's try to stream the results.

lolobosse avatar Feb 10 '18 22:02 lolobosse