GithubHelp home page GithubHelp logo

miguelcatalan / materialsearchview Goto Github PK

View Code? Open in Web Editor NEW
3.8K 3.8K 614.0 4.56 MB

Cute library to implement SearchView in a Material Design Approach

Home Page: http://miguelcatalan.info/2015/09/23/MaterialSearchView/

License: Apache License 2.0

Java 100.00%

materialsearchview's People

Contributors

aballano avatar douglasjunior avatar dscottpi avatar kbiakov avatar kimbeejay avatar lgvalle avatar miguelcatalan avatar nadavfima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

materialsearchview's Issues

White line at the bottom of MaterialSearchView if set transparent background. (some devices)

Device: SGS3
Background for search view:

<?xml version="1.0" encoding="utf-8"?>
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:bottom="5dp"
        android:left="5dp"
        android:right="5dp"
        android:top="5dp">
        <shape>
            <solid android:color="@android:color/white"/>
            <corners android:radius="2dp"/>
        </shape>
    </item>
</layer-list>

White line at the bottom of search view.
It is because of View in search_view.xm at60 line.

            <View
                android:layout_width="match_parent"
                android:layout_height="1dip"
                android:layout_alignParentBottom="true"
                android:background="#fff"
                android:backgroundTint="#10000000" />

white_line_at_bottom_of_search_view

Problem in RTL layout

i try to use MaterialSearchView in my application but i have this problem ?

2016-01-15_18-53-37

the problem is the search icon and back icon is overlap each other.

and this is my menu :

 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
     <item android:id="@+id/searchview" android:title="جستجو" app:ico_icon="gmd-search"></item>
 </menu>

problem to add setSuggestions

when i add this code searchView.setSuggestions(getResources().getStringArray(R.array.query_suggestions));
search view fill other views of app on runtime but by tapping on search button and press back other views showing

searchview inside Fragment is null

i am using your library but i use fragments.
So i do not inflate main menu in activity but inside fragment.
How to obtain reference to searchview ?

i tried
searchView = (MaterialSearchView)findViewById(R.id.search_view); but it returns null

problem with lollipop and above

Hi!
good library, thanks for it!
but i got some problem with devices with lollipop and above.
when i am clicking on search icon the keyboard is open, search is working. but...
ordinary title is showing and edit text doesn't show...
try this problem on few devices with lollipop

Search history

Hi,

I would like to have more information about your provider. I'm trying to implement a custom provider in order to manage an history.

For now I'm just using your SearchAdapter to be able to add suggestions but if I restart the application I lost them. I would like to manage my own provider in order to save my queries but I was not able to add a provider and an xml with searchable config.

I don't understand why the application told me that you already have a provider.

Can you give me more information ?

Request: allow to enable&disable the SearchView EditText, for ActionMode

Suppose you start searching, and this causes the list of items to be filtered.
Now the user does multi-selection on the filtered items, which shows the actionMode on top of the action bar.
Sadly, in this case the keyboard is still shown, and it does work, yet the MaterialSearchView is behind so you can't see the query.

My request is to be able to let the query stay, temporarily disable entering text.

For now, a workaround is to find the EditText within the MaterialSearchView, and call setEnabled(false) on it.
Meaning:

            final MaterialSearchView searchView = ...
            final EditText searchEditText = (EditText) searchView.findViewById(com.miguelcatalan.materialsearchview.R.id.searchTextView);
            searchEditText.setEnabled(...);

Another workaround is to hide the keyboard, but this is not a full solution because you can still theoretically focus on the view and show the keyboard again

Show keyboard after VoiceSearch

why not expose a method like showKeyboard?
I need it for use after VoiceSearch?
Ex:

....
 if (matches != null && matches.size() > 0) {
                String searchWrd = matches.get(0);
                if (!TextUtils.isEmpty(searchWrd)) {
                    searchView.setQuery(searchWrd, false);
                    searchView.showKeyboard();
                }
            }
...

Just for future

I add extention fuction to your searchview. But in kotlin
Reactive:

public fun MaterialSearchView.asObserver(): Observable{
return Observable.create { subscriber ->
var watcher= object: MaterialSearchView.OnQueryTextListener{
override fun onQueryTextSubmit(query: String?): Boolean {
if (!subscriber.isUnsubscribed) {
subscriber.onNext(query)
return true
}
return false
}

        override fun onQueryTextChange(newText: String?): Boolean {
            if (!subscriber.isUnsubscribed) {
                subscriber.onNext(newText)
                return true
            }
            return false
        }
    }
    this.setOnQueryTextListener(watcher)
}

}

Allow Submit query text without trigger query changes

I have the use case, that when filling the suggestion list using values that come from OnQueryTextListener when user click on a suggestion i want to trigger a full search, like Google Play and other apps using

 searchView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
     @Override
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {         
         searchView.setQuery(suggestion, true);
     }
 });

but with this trigger an OnQueryTextListener.onQueryTextChange() before OnQueryTextListener.onQueryTextSubmit() and that trigger is unnecessary in mostly cases

Digging in the code i see the function onSubmitQuery(); just allowing a String as parameter and provide a public method submitQuery(String query) that call onSubmitQuery internally that not trigger OnQueryTextListener.onQueryTextChange() solve the problem.

I could do it, but first i want to know your opinion.

Search isn't opening after it has closed

I have a scenario where I need to search view to be consistent on the activity I'm using it. After searching I noticed it disappears . I try to call showSearch for it to come back but that doesnt work. Any help?

AppBarLayout with suggestion takes up the whole page

When testing the library with a large suggestion list within AppBarLayout, the toolbar takes up the whole page. The screenshot is attached:
screenshot_20160111-180520
After clicking the search and back button, the page is back to normal state. When the search view is shown, the suggestion is working properly.

Problem error when render preview !

I'm use theme

<style name="ShortStoryTheme" parent="AppBaseTheme">
        <item name="android:textColorPrimary">@android:color/white</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
        <item name="android:windowTranslucentStatus" tools:targetApi="19">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="windowActionBar">false</item>
        <!-- Toolbar Theme / Apply white arrow -->
        <item name="colorControlNormal">@android:color/white</item>
        <item name="actionBarTheme">@style/ShortStory_AppTheme.ActionBarTheme</item>
        <item name="android:windowActionBarOverlay" tools:targetApi="21">true</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="windowNoTitle">true</item>

        <item name="android:windowBackground">@color/theme_background</item>
        <item name="actionMenuTextColor">@color/theme_icons</item>
        <item name="android:textColorSecondary">@color/theme_icons</item>

        <!-- Material Theme -->
        <item name="colorPrimary">@color/nliveo_red_colorPrimary</item>
        <item name="colorPrimaryDark">@color/nliveo_red_colorPrimaryDark</item>
        <item name="colorAccent">@color/nliveo_green_colorAccent</item>
        <item name="android:statusBarColor" tools:targetApi="21">@color/statusBarColor</item>
        <item name="android:navigationBarColor" tools:targetApi="21">@color/navigationBarColor
        </item>
        <item name="android:windowDrawsSystemBarBackgrounds" tools:targetApi="21">true</item>
    </style>

And occur error when preview.

java.lang.NullPointerException
    at com.miguelcatalan.materialsearchview.MaterialSearchView.setBackground(MaterialSearchView.java:297)
    at android.view.View.<init>(View.java:4328)
    at android.view.ViewGroup.<init>(ViewGroup.java:573)
    at android.widget.FrameLayout.<init>(FrameLayout.java:97)
    at android.widget.FrameLayout.<init>(FrameLayout.java:92)
    at android.widget.FrameLayout.<init>(FrameLayout.java:88)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.<init>(MaterialSearchView.java:87)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.<init>(MaterialSearchView.java:83)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:458)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:170)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:103)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:190)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:218)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:145)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:838)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:223)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
    at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:366)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:652)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:594)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
    at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:589)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

make typed bold

If the user types letters in search field it would be really nice that these letters are bold in the suggestion list.
That would be nice ux.

Bug at setSuggestions method

If searchView's setOnItemClickListener is called before setSuggestions(String[] suggestions) is called former listener won't get triggered because setSuggestions(String[] suggestions) has overridden setOnItemClickListener itself.

public void setSuggestions(String[] suggestions) {
    if (suggestions != null && suggestions.length > 0) {
        mTintView.setVisibility(VISIBLE);
        final SearchAdapter adapter = new SearchAdapter(mContext, suggestions, suggestionIcon);
        setAdapter(adapter);

        setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                setQuery((String) adapter.getItem(position), false);
            }
        });
    } else {
        mTintView.setVisibility(GONE);
    }
}

Please check mSuggestionsListView has no onItemClickListener attached before setting new one in the setSuggestions(String[] suggestions) method.

Line below the search view

I guess this issue is quite similar to #14 but in case I'm setting a coloured background to the SearchView yet seeing a line below it. I tried setting elevation="0dp" which didn't seem to work

Check the screenshot below.

device-2015-12-11-201121

Include custom values for Animation for SearchView

It was wondering to change animation speed values, as going through the source code. Animation fields are constants and cannot be override, It would be best if you include tag or methods for passing custom values for animation.

searchView.setVoiceSearch(true); //or false dosn

setVoiceSearch dosn't declar in this source code . please check this .

my code is :
searchView = (MaterialSearchView) findViewById(R.id.search_view);
searchView.showVoice(false);
searchView.setVoiceSearch(true); //or false // Error
searchView.setOnQuery.....

Any way to download jar/aar?

My company has a build server without Internet access. Any 3rd-party library needs to be uploaded separately. I've searched Maven but I couldn't find it. Where and how can I download the jar/aar file of your library?

NullPointerException at MaterialSearchView.java:268

java.lang.NullPointerException
    at com.miguelcatalan.materialsearchview.MaterialSearchView.isVoiceAvailable(MaterialSearchView.java:268)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.showVoice(MaterialSearchView.java:444)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.initiateView(MaterialSearchView.java:159)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.<init>(MaterialSearchView.java:90)
    at com.miguelcatalan.materialsearchview.MaterialSearchView.<init>(MaterialSearchView.java:82)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:466)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:173)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:106)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:168)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:413)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:959)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
    at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:361)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
    at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

what is wrong?
is see this on the layout file

Usage with TabLayout and AppBarLayout

I'm using the MaterialSearchView with TabLayout, AppBarLayout and RecyclerView. The toolbar is hidden when the list is scrolling. I tried the following layouts:

A. The search view is below tabs:

AppBarLayout
  ToolBar
  TabLayout
  MaterialSearchView
/AppBarLayout

B. The toolbar scrolling doesn't work anymore:

AppBarLayout
  FrameLayout  
    ToolBar
    MaterialSearchView
  /FrameLayout  
  TabLayout
/AppBarLayout

What I expect is the effect like the "My apps" section in the Play Store app. The search view is actually placed above the activity though. Any suggestions?

Allow empty query string

It would be nice to have the option to allow empty query string (Ex: app:empty_allowed='true')

Bug: reveal animation doesn't always start from the search menu item

modify the sample to have more action items on the right of the search menu item, and then click the search menu item.
The reveal animation still starts from the most right area, instead of from the search menu item.

Here's an example of the modification that's needed to do it:
menu_main.xml

<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">
    <item
        android:id="@+id/action_search"
        android:icon="@drawable/ic_action_action_search"
        android:title="@string/abc_search_hint"
        app:showAsAction="always"/>
    <item
        android:icon="@android:drawable/ic_menu_edit"
        android:title="edit"
        app:showAsAction="always"/>
</menu>

Please fix this.

Search not only from beginning

Do think you about searching not only from beginning and displaying the suggestions?
I have nothing seen in the readme about it. Only in your sample app.

Voice is invalid

Voice voice is invalid, the right ICONS don't show this is why, I have realized the following code

    searchView.setVoiceSearch(true);

Stickiness + shadow

Hello!

First of all thanks for sharing this library, I was looking for something similar to use in my projects! :)

Currently I made a fork of it and I´m adding some personal changes that might be useful for you also, so I could make a PR if you´re interested:

  • Stickiness: basically to stick it in the toolbar and remain there until dismissed (like Whatsapp search). This is useful if you don´t need suggestions (actually I´m thinking in enabling the "stickiness" when there are no suggestions) and you want to filter or to search the content directly in your layout.
  • I could probably add some 9patch to the view so it has a shadow to fake the elevation in lower versions.

I hope you like the changes, I will create the PR soon so you can review/merge if you like them.

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.