searchview

SearchView in OptionsMenu not full width

烂漫一生 提交于 2019-12-17 09:19:11
问题 I have a working SearchView which expands in my OptionsMenu when the user taps on the search icon. However it only expands within the available space among the other OptionsMenu icons. On a wide screen this is fine, but with a narrow space there is only room to show 5-10 charaters in the search box. I want it to overlay the other icons such as it does for the Android Contacts app. Currently, I'm building with targetSdkVersion = 17. Hopefully I'm missing something simple :) (Note added later:

Applying Word Stemming in SearchView for fetch data from Firebase database

百般思念 提交于 2019-12-17 06:18:17
问题 I need to fetch list of users from Firebase database using SeachView or search dialog and I think word stemming will be best for my app. Not asking for code but please tell me the alorigthm for it. 回答1: To achieve what you want, you need to execute a query which should look like this: DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); DatabaseReference usersRef = rootRef.child("users"); Query query = usersRef.orderByChild("name").equalTo(newText); So everytime you

Is it possible to change the textcolor on an Android SearchView?

淺唱寂寞╮ 提交于 2019-12-17 03:57:31
问题 The SearchView element doesn't have any properties for changing the text color. The default text color is black and doesn't work on our dark background. Is there a way to change the color of the text without resorting to hacks? I found this similar question related to changing the text size, but so far, it doesn't have any answers: How to set SearchView TextSize? 回答1: Add <item name="android:editTextColor">@android:color/white</item> to the parent theme and that should change the entered text

searchview not closing correctly on FIRST back press (it's only loosing focus)

时光总嘲笑我的痴心妄想 提交于 2019-12-14 04:16:50
问题 I have to press the backbutton twice, to close the SearchView . Why? On the first press, the SearchView only looses focus... Setting setOnKeyListener on SearchView does not work either... Btw, I'm using the ABS implementation... My code is simple and looks like the following: mMenuItemSearch = menu.findItem(R.id.search); mSearchView = new SearchView(getSupportActionBar().getThemedContext()); mMenuItemSearch.setActionView(mSearchView); mSearchView.setOnQueryTextListener(new SearchView

Android: make CollapsingToolbarLayout title transparent to avoid overlap with SearchView

南笙酒味 提交于 2019-12-14 04:00:55
问题 I'm facing the same problem described in this SO question (if my searchview is open and I collapse my toolbar, the two overlaps). So I was trying to implement the approved answer, making my title transparent when it is collapsed. Solution is only partially working for me, because I'm having the same problem described in the message n. 11 in the report of this bug here. In short, the color of my title doesn't return to white if the searchview is open when the toolbar is collapsed. This is my

Android - Make whole search view clickable with query hint

≡放荡痞女 提交于 2019-12-14 03:59:35
问题 So i've been working on this inventory management system in Android Studio. In the fragment for Product Taking i have a search view and i want to make this search views whole body to be clickable. Part of this problem is solved here: Android - Make whole search bar clickable. But i want the search view to have a visible query hint. So basically i want it to be a button with search icon and a text. I want that because it is supposed to open a dialog where the user actually going to search for

mysterious line arround editText from searchview

强颜欢笑 提交于 2019-12-13 19:22:21
问题 I have a searchview and i changed the edittext box of them with a drawable (with java code). However I have a mysterious border that i can't remove. If you see the screenshot you will see the red line that is a border defined in drawable 'editext.xml' My problem is I doesn't know what is the black line arround the edittext. Anybody know what is and how i remove it? drawable (edittext): <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"

How to filter Recyclerview with SearchView on multiple parameters

岁酱吖の 提交于 2019-12-13 19:07:55
问题 I have implemented the SearchView example given here. How to filter a RecyclerView with a SearchView ....to filter and list company names based on the parameter "Product name". In my project, I want to extend this to further filter on the parameter on "city name" The below is the code for the onQueryTextSubmit which filters on the parameter "productname". @Override public boolean onQueryTextSubmit(String query) { return false; } private List<ExampleModel> filter(List<ExampleModel> models,

How to set the MenuItemClickListener for a SearchView at a secondary Toolbar

≡放荡痞女 提交于 2019-12-13 14:15:06
问题 i am trying for hours to setup a simple android.support.v7.widget.SearchView in a bottom (secondary) android.support.v7.widget.ToolBar. I am already using another Toolbar up top set up as an ActionBar, so i cannot use the onCreateOptionsMenu callback on activity, instead i have to set up an OnMenuItemClickListener() . I have read the Android SearchView Tutorial, this tutorial about Toolbars. Related Code, simplified HomepageActivity package something.somethingelse.activities; import android

How to change the SearchView icon position from left to right

纵然是瞬间 提交于 2019-12-13 11:13:19
问题 I have the following layout which contains a SearchView and i want its icon to be on the right side instead of the default left. I looked up multiple posts on here and their respective answers but none worked. Any ideas on how to do it? Is there an xml attribute i can add or do i have to do it programatically? <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android