B4J Library [custom view] SearchView

A custom view similar to B4A and B4i SearchView:

searchview.gif


Depends on jReflection and JavaObject (to override the default keyboard behavior).

You need to add the SearchView layout file, SearchView class and TextFlow class to your project.

Usage example:
B4X:
Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Private SearchView1 As SearchView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.RootPane.LoadLayout("1") 'Load the layout file.
   MainForm.Show
   SearchView1.SetItems(File.ReadList(File.DirAssets, "cities.txt"))
End Sub


Sub SearchView1_ItemClick (Value As String)
   Log($"ItemClick: ${Value}"$)
End Sub
 

Attachments

  • SearchView.zip
    8.2 KB · Views: 1,016
Top