Android Question How to show the Search View result in front a custom view list

achtrade

Active Member
Licensed User
Longtime User
I have a CLV and a SearchView inside a panel, when I'm typing in the edittext, the result of the searchview is behind the CLV, I can't see it. How to bring the result of the searchview in front the CLV ?
 

achtrade

Active Member
Licensed User
Longtime User
Is the panel an item in CLV? It will not work. You can instead put a button that opens a panel above CLV with SearchView.

No. See my designer in the attached picture.

It is working as I need it, the only problem is the result of the SV is showing it behind the CLV. The SV edit text box is in the top and below is the CLV which I will display the selected item in the Search View.
 

Attachments

  • error.jpg
    error.jpg
    70.3 KB · Views: 364
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Well, now I have another issue, the SV is in the front and I can't see the CLV records. How to make the SV result available only when the user is typing in the edit box ?
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Not sure what is SV. SearchView uses a ListView to show the items. See the places in the code where the listview becomes visible.

SV = SearchView

I made lv public and tried this:

B4X:
Sub SearchView1_ItemClick(Value As String)
    SearchView1.lv.Visible = False
End Sub

and then this ...

B4X:
Sub SearchView1_ItemClick(Value As String)
    SearchView1.lv.SetLayout(0, SearchView1.lv.Top, SearchView1.lv.Width, 80dip)
End Sub

but none of them worked. The Search View is using the whole screen which is ok while I'm searching something but after I click the desired record the CustomViewList can't be seen.

What else can I do ?

thanks.
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Are you using the latest version of SearchView, that is implemented as a custom view?

You should hide mBase to hide everything.

Yes, I'm using the latest version. Also I tried this

B4X:
Sub SearchView1_ItemClick(Value As String)
    SearchView1.mBase.Visible = False
End Sub

It did what I want but the Search View EditText is no longer available for the next search.
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
That is expected. See how the code creates the layout. It is quite simple.

I understand, but how are the people using this SearchView ?.

My scenario is this:
1. User look at items table
2. User select an item from the listview
3. The app shows the selected item in a CustomListView below the Search View EditText
4. User repeat these steps n-times

any suggestion to achieve this ?
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Can you post a screenshot of the layout you are trying to implement?

screen1: SearchView Edit Text available to search an item
screen2: user type the item name. In this example: "parbo" and select the item "... Parboil Rice 6/5 lbs"
screen3: the app shows the selected item in a CustomListView below the SearchView Edit Text. In this case, I made the mbase.visibile = false after select the item, but It isn't available for the next search.

How to fix this ?

thanks.
screen1.jpeg
screen2.jpeg
screen3.jpeg
 
Last edited:
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
What happens if you only hide the listview (lv)?

I tried this

B4X:
Sub SearchView1_ItemClick(Value As String)
    SearchView1.lv.Visible = False
End Sub

and the SearchView is still covering the CustomListView, I can't see the CustomListView records.

If the ListView can be hide, that solve my problem
 
Upvote 0
Top