searchview

RecyclerView behavior - Goes empty when keyboard is opened/closed

给你一囗甜甜゛ 提交于 2021-02-18 21:53:32
问题 I have implemented a RecyclerView with SearchView and Filterable ; all classes from v7 . Now there is this behavior that is annoying. Whenever the keyboard is brought up or closed the contents of the RecyclerView goes blank. The count is still correct but the view is empty. My guess, it has something to do with the Layout size change. Is this behavior normal or something is wrong? How to deal with it? I can show the code but don't quite know which part will be relevant so tell me what can I

How to handle back arrow event in a SearchView

只愿长相守 提交于 2021-02-10 20:40:45
问题 How can I handle the click event on the back arrow in the searchview widget: I tried this code but it doesn't work: searchtollbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "back arrow clicked"); } }); also I tried this one: MenuItemCompat.setOnActionExpandListener(item_search, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionCollapse(MenuItem item) { // Do something when collapsed return

How to handle back arrow event in a SearchView

亡梦爱人 提交于 2021-02-10 20:35:11
问题 How can I handle the click event on the back arrow in the searchview widget: I tried this code but it doesn't work: searchtollbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "back arrow clicked"); } }); also I tried this one: MenuItemCompat.setOnActionExpandListener(item_search, new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionCollapse(MenuItem item) { // Do something when collapsed return

Is there a way to limit the number of displayed suggestions when using the default search suggestions adapter?

孤街醉人 提交于 2021-02-10 06:57:41
问题 Is there a way to limit the number of displayed suggestions when using the default search suggestions adapter as described here? 来源: https://stackoverflow.com/questions/42560501/is-there-a-way-to-limit-the-number-of-displayed-suggestions-when-using-the-defau

Search activity not being launched when pressing enter

喜你入骨 提交于 2021-02-07 12:14:36
问题 Search activity not being launched when pressing enter.The search view is shown nicely on the action bar. But when i type the search query and press enter AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.punit.rateit" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="17" /> <uses-permission android:name="android.permission.INTERNET"/>

SearchView with border and text

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 10:25:11
问题 I want to make my SearchView like this: How can I implement in Java ? 回答1: What you see in the image is the Material TextInput with OutLined style. You can read more about that and the Filled style in the official docs here. Also, don't forget you'll need material library for this. For that, do implementation 'com.google.android.material:material:1.2.0-alpha06' Now, what you can do with it is to make it like above by adding startDrawable and CornerRadius : Create the XML widget as below and

Scroll SearchView to the top - searchView is in the middle of fragment

六眼飞鱼酱① 提交于 2021-01-29 09:49:35
问题 I have a searchView in the middle of fragment. When I tap on it, it expand a keyboard which cover list (which is under the searchView) and place for writing queries (searchView). Is there any possibility to somehow scroll to the top whole layout when tap on search icon? Currently I set all the views above searchView to myViews.visibility = View.GONE and I've received proper behaviour but I am not sure if this is correct - especially since above searchView I have a map. What's your opinion?

i have recyclerview with searchview how to send details data about item i searched about

蹲街弑〆低调 提交于 2021-01-29 02:24:17
问题 I have recyclerview with searchview and have details data sended when select item in recyclerview problem is when i search about item and select it the details data not change always appears the first item's details data how can i send details data about the items that i searched about i think it not big issue so pls help me this my code: in my Main avtivity private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.recyclerView); // adapter = new RecyclerViewAdapter

i have recyclerview with searchview how to send details data about item i searched about

怎甘沉沦 提交于 2021-01-29 02:22:39
问题 I have recyclerview with searchview and have details data sended when select item in recyclerview problem is when i search about item and select it the details data not change always appears the first item's details data how can i send details data about the items that i searched about i think it not big issue so pls help me this my code: in my Main avtivity private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.recyclerView); // adapter = new RecyclerViewAdapter

SearchView in ActionBar using Fragments

只愿长相守 提交于 2021-01-29 01:31:16
问题 I have a navigation drawer in HomeActivity. Inside the navigation I have fragments that contain different RecycleViews each. I want to implement SearchView in ActionBar so it will search in the RecycleView according to the active fragment. This is on of the fragments code: public class HomeFragment extends Fragment { private static BackEnd backEnd; private RecyclerView rvBooks; private BookAdapter adapter; private MenuItem mSearchAction; private SearchView searchView; private ActionBar