hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
http://hanggrian.com/socialview/
Apache License 2.0
324 stars 81 forks source link

how to show custom mentions at @ #23

Closed parth-linkwok closed 1 year ago

parth-linkwok commented 6 years ago

how can i show mention at "@" @HendraAnggrian. i want to show all person list when user type char "@". i have tried setting setThreshold to 0 but it's not working.

hanggrian commented 6 years ago

Unfortunately, this is the default behavior of AutoCompleteTextView and MultiAutoCompleteTextView. When you set threshold to 0, 1 will be applied. Although some people have reported that you can just call showDropDown() to force display items, but I haven't tested it. Would you mind trying it out?

vanyasem commented 6 years ago

showDropDown() does the trick. It could be a good idea to integrate it into socialview

vanyasem commented 6 years ago

https://stackoverflow.com/a/43519879/5216112 is also a possible solution

hanggrian commented 6 years ago

Thanks for the note, I will be adding this feature in next version (assuming that any of that possible solutions is stable and do not interfere with minimum SDK requirement). But it might take some time since I'm also working on AndroidX support.

vanyasem commented 6 years ago

Take your time. I made a local fork of 0.8.0 version (I need it to work with one specific Google libs version), and incorporated all changes there. Everything seems to work fine, I haven't increased the min SDK version

hanggrian commented 6 years ago

@vanyasem after briefly adding such feature, I decided to completely removed it since I believe API 28 now allows you to have threshold lower than 1. We may never know this to be true until the source of API 28 is released. In the meantime, let's keep this issue open.

vanyasem commented 5 years ago

@hendraanggrian setThreshold(0); still doesn't seem to work, even after migrating to API 28

vanyasem commented 5 years ago

It seems like nothing has changed 2018-11-22-180127_870x477_scrot

hanggrian commented 5 years ago

I need to re-run my previous test to know why was I quite sure back then, thanks for the update.

hanggrian commented 5 years ago

Hi @vanyasem I'm back with a result:

ezgif-4-1bd5d30af053

If you see demo layout, I set the completionThreshold to 0. My guess is when you set the threshold via xml, it doesn't go through AutoCompleteTextView#setThreshold(int), thus the logic of if (threshold <= 0) is ignored.

I am waiting for your feedback, version 0.2 will be deployed after this issue is addressed.

vanyasem commented 5 years ago

I can confirm that setting the threshold via XML (and NOT via code) does the trick

hanggrian commented 5 years ago

Since threshold configuration has nothing to do with this library, and it can be tricked with XML anyway, no further action is being taken.

yu1ro commented 3 years ago

@hendraanggrian Hello! This issue should be re-opened. I set the completionThreshold to 0 in layout file. But, It's not work.

Libraly version: 0.3-rc1

hanggrian commented 3 years ago

@yu1ro thanks for the note. Yes I think the newer version of AndroidX changes this behavior. I will reassess the best way to implement this feature.

fukemy commented 2 years ago

hi, does Threshold worked now?

hanggrian commented 1 year ago

Last I checked version 0.1 has the threshold working (value set to 1). However, I didn't test it on many devices. You may open this issue again if the issue persists.