SearchableSpinner
SearchableSpinner copied to clipboard
Support for more than Strings
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.
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 .
Any updates on this yet? Thank you.
Any update on the library yet
Updates please?
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 .