searchview

Change appcompat's SearchView text and hint color

坚强是说给别人听的谎言 提交于 2020-01-01 01:18:09
问题 Does anybody know how to change the text color of the appcompat SearchView? I've spent 2 hours and tried several suggestions from SO and none works. Here is my code: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:espacios="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/layer_switcher_button" android:icon="@drawable/b_categorias" android:title="@string/menu_layer_switcher_title" espacios:showAsAction="ifRoom|collapseActionView"/> <item android:id="@

Implement Searchview with Navigation Drawer and Fragment inside

蹲街弑〆低调 提交于 2019-12-31 06:56:07
问题 I want to implement SearchView on the toolbar in Navigation-Drawer and there is Fragment Activity like in the picture. I've tried SearchView on regular Activity and I succeeded, but when I implement it to Fragment Activity , why its code can not run. This is my Main Activity.java public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { public static final String MAKAN = "makanan"; public static String WHERE = "makanan"; public static int

Filter Data from RecyclerView Firebase

北城以北 提交于 2019-12-31 06:08:24
问题 I am trying to implement a searchview in my action bar and for that to filter the RecyclerView Data that I retrieved from Firebase. Right now I am looking for the code that I need to add to the recycleradapter to be able to filter the retrieved data. This is how I added the recyclerView to my MainActivity. Query query = mRef.orderByChild("city"); // everything else FirebaseRecyclerAdapter<City, CityViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<City, CityViewHolder>( City

Android searchView drop down menu screen width

ⅰ亾dé卋堺 提交于 2019-12-31 04:26:17
问题 Situation: I have a searchview widget in my appcompat toolbar that allows custom suggestions via sqlitedatabase. Problem: I am having trouble expanding the drop down suggestions list to be the full width of the screen. At best, the list width is almost the width of the screen except for small margin/padding problems on the left and right side. How do I make the drop down list have the same width as the screen? Things I've tried: SearchView results list width AutoCompleteText's setPadding,

Set SearchView clear button color

怎甘沉沦 提交于 2019-12-30 08:08:12
问题 I am creating a searchview in the toolbar using onCreateOptionsMenu , but can't get the clear X button to initially be white. It becomes white when starting to type letters. It also stays white after clearing. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.responsible_menu, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu

Android - ActionBar SearchView suggestions with a simple String array

允我心安 提交于 2019-12-29 14:15:11
问题 I want to implement an ActionBar Search Widget with suggestions ability. I already have a string array stored in my ORMLite database that I want to use for the suggestions. How can I do this without creating loads of classes (Provider, Searchable...!)? 回答1: It's a sample, I hope it can help you. To implements more features in this cursor, eg. open activity when press in suggestion item, take a look on this http://developer.android.com/guide/topics/search/adding-custom-suggestions.html package

SearchView onMenuItemActionCollapse Not Working

末鹿安然 提交于 2019-12-25 12:26:10
问题 I'm using SearchView while my activity is extanding Sherlock Library. @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // TODO Auto-generated method stub inflater.inflate(R.menu.countriesxml, menu); SearchView mSearchView = (SearchView) menu.findItem(R.id.searchall) .getActionView(); mSearchView.setQueryHint("Search for smartphones"); MenuItem menuItem = menu.findItem(R.id.searchall); menuItem.setOnActionExpandListener(new OnActionExpandListener() { @Override

SearchView onMenuItemActionCollapse Not Working

落爺英雄遲暮 提交于 2019-12-25 12:26:00
问题 I'm using SearchView while my activity is extanding Sherlock Library. @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // TODO Auto-generated method stub inflater.inflate(R.menu.countriesxml, menu); SearchView mSearchView = (SearchView) menu.findItem(R.id.searchall) .getActionView(); mSearchView.setQueryHint("Search for smartphones"); MenuItem menuItem = menu.findItem(R.id.searchall); menuItem.setOnActionExpandListener(new OnActionExpandListener() { @Override

Android searchview suggestions padding right

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 09:26:19
问题 I have a problem with my searchview. I'm trying to make search suggestions full width but the suggestions have a right padding. <-- language: lang-java --> public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); SearchManager searchManager=(SearchManager)getSystemService(Context.SEARCH_SERVICE); final MenuItem item=menu.findItem(R.id.procura); MenuItemCompat

How to add an android Searchbar1 [duplicate]

假装没事ソ 提交于 2019-12-25 06:28:16
问题 This question already has answers here : Search bar widget in android? [closed] (3 answers) Closed 3 years ago . I was wondering if anyone could break down for me step by step how to add a searchbar in an activity . I have tried to look it up online but I couldn't really understand how it's done. 回答1: Add this dependency in your gradle : dependencies { compile 'com.miguelcatalan:materialsearchview:1.0.0' } Add this to your Mani Activity: <RelativeLayout android:id="@+id/toolbar_container"