SearchableSpinner icon indicating copy to clipboard operation
SearchableSpinner copied to clipboard

Support for more than Strings

Open cfoket opened this issue 5 years ago • 5 comments

Would it be possible to adapt the SpinnerDialog to support a list of Objects, rather than Strings? More specifically, I would like to see the type of the item parameter in public void onClick(String item, int position) be changed to Object.

I think PR #24 would be a good starting point. The first argument of onSpinerItemClick.onClick(...) could then just be listView.getItemAtPosition(i).

The reason I am asking is because currently I have to resort to using two lists; one for the items I actually want to display, and a second one that contains their 'labels' (i.e. Strings), which I use when creating the spinner dialog. Then, I use the position I receive from the onClick(String item,int position) callback to determine which object (from the first list) was actually selected. However, this does not seem to work when the results of the spinner dialog are filtered. In that case I get the position in the filtered list, rather than the position in the unfiltered list, which is what I need. I think it would be much easier if the callback just returned the object that was selected.

cfoket avatar Jul 19 '19 12:07 cfoket

Yes it's possible. For that i have to update my library and publish it.

I will update you once its done.

Thanks.

On Fri, 19 Jul, 2019, 6:13 PM cfoket, [email protected] wrote:

Would it be possible to adapt the SpinnerDialog to support a list of Objects, rather than Strings? More specifically, I would like to see the type of the item parameter in public void onClick(String item, int position) be changed to Object.

I think PR #24 https://github.com/MdFarhanRaja/SearchableSpinner/pull/24 would be a good starting point. The first argument of onSpinerItemClick.onClick(...) could then just be listView.getItemAtPosition(i).

The reason I am asking is because currently I have to resort to using two lists; one for the items I actually want to display, and a second one that contains their 'labels' (i.e. Strings), which I use when creating the spinner dialog. Then, I use the position I receive from the onClick(String item,int position) callback to determine which object (from the first list) was actually selected. However, this does not seem to work when the results of the spinner dialog are filtered. In that case I get the position in the filtered list, rather than the position in the unfiltered list, which is what I need. I think it would be much easier if the callback just returned the object that was selected.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MdFarhanRaja/SearchableSpinner/issues/31?email_source=notifications&email_token=AELU5EF5CF7LACZ7MEWKZD3QAGZGJA5CNFSM4IFFS4JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAIJIKQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AELU5EGVMQDXGPU4YUY6Z4TQAGZGJANCNFSM4IFFS4JA .

MdFarhanRaja avatar Jul 19 '19 12:07 MdFarhanRaja

Any updates on this yet? Thank you.

cfoket avatar Aug 21 '19 11:08 cfoket

Any update on the library yet

ALI-SAMPSON avatar Sep 12 '19 08:09 ALI-SAMPSON

Updates please?

vamfixed avatar Mar 19 '20 05:03 vamfixed

Currently it's only supports string

On Thu, 19 Mar, 2020, 11:17 AM vamfixed, [email protected] wrote:

Updates please?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MdFarhanRaja/SearchableSpinner/issues/31#issuecomment-601000293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELU5EHW4WI4QWZSAKCWVSLRIGWYLANCNFSM4IFFS4JA .

MdFarhanRaja avatar Mar 19 '20 05:03 MdFarhanRaja