B4i Library [class] SearchView

Erel

Administrator
Staff member
Licensed User
This class is similar to B4A SearchView class. It allows the user to filter a list of items based on a term (prefix matches first followed by other matches).

It uses the new RichString class to highlight the matching terms. Note that the scrolling and filtering performance in release mode are very good. It can be a bit jumpy in debug mode.


New version of SearchView is now available. It is implemented as a custom view. It also properly handles the keyboard state.
 

Attachments

Last edited:

miker2069

Active Member
Licensed User
Is it possible to add an item with more than just one line? I believe with the equivalent in B4A you can add singleline and doubleline. Is it possible to add a custom view or something (i.e., an entry with a line and an icon?)
 

Shay

Well-Known Member
Licensed User
How do I put default text on it
there is no sv.text = "something"

and second question, how do I do sv2.enabled = false
since I want to enable it only after sv1.text has something in it
(sv1 = cities, sv2 = streets)
I wish to load only the relevant streets by city
 
Last edited:

narek adonts

Well-Known Member
Licensed User
I have updated Erel's SearchView with using the iOS native SearchViewController (like in iMessage, Whatsapp, Viber,...)

It is just the basic wrapping so you can contribute to it.

For current users of SearchView you do not need modify anything in your code.

Project attached.

Narek
 

Attachments

John Woodsmall

Active Member
Licensed User
This works very well on most text files. However I have 271 "Div/state" files...the entire list of cities
in the world. The 3 one I tested is "UK.TXT" which is a simple ascii list of the cities in the UK.
I get "encode-error" when I try to open it:"Error reading file. Incorrect encoding"

I have checked the file and can not find any weird letters?
 

Attachments

John Woodsmall

Active Member
Licensed User
In the "New" from:"narek-adonts" search view above (which I have added to my app) it does not seem to return a value to
the sv_ItemClick(Value As String)
.
On the first one (above) it works correctly. But on the new one which looks great(i would love to use it)
it does not seem to return a value. All i did was replace the new *.bas to my app.
 
Top