Git Product home page Git Product logo

Comments (13)

mancj avatar mancj commented on May 31, 2024 1

Not yet. Sorry, I do not have the time to do it.

from materialsearchbar.

shubhdo avatar shubhdo commented on May 31, 2024

@AruLNadhaN
In menu resource file change showAsAction attribute to always like in example
e.g.
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/example" android:icon="@drawable/example" android:title="@string/example" android:showAsAction="always"/>

from materialsearchbar.

AruLNadhaN avatar AruLNadhaN commented on May 31, 2024

This is how my menu resource looks like. But still I can't view the icon ?

<item android:id="@+id/menu_shopcart" android:title="@string/action_cart" android:icon="@drawable/cart" app:showAsAction="always"/>

from materialsearchbar.

shubhdo avatar shubhdo commented on May 31, 2024

@AruLNadhaN you can try this post on stackoverflow to resolve your issue
http://stackoverflow.com/questions/18380085/menu-items-doesnt-show-up-on-the-actionbar
see if it works.

from materialsearchbar.

AruLNadhaN avatar AruLNadhaN commented on May 31, 2024

Thanks. But still it is not working :(

from materialsearchbar.

mancj avatar mancj commented on May 31, 2024

you can't change the popup menu icon in MaterialSearchBar. If you need an item with a custom icon, you can set the speechMode = true and set setOnSearchActionListener. then in onButtonClicked you can handle action. here is a small example:

@Override
public void onButtonClicked(int buttonCode) {
    switch (buttonCode){
        case MaterialSearchBar.BUTTON_NAVIGATION:
            drawer.openDrawer(Gravity.LEFT);
            break;
        case MaterialSearchBar.BUTTON_SPEECH:
            openVoiceRecognizer();
    }
}

from materialsearchbar.

AruLNadhaN avatar AruLNadhaN commented on May 31, 2024

I got it! But I need to have a custom Icon near the Speech Icon ?
How can i achieve it ?

from materialsearchbar.

mancj avatar mancj commented on May 31, 2024

It is impossible in current version.

from materialsearchbar.

AruLNadhaN avatar AruLNadhaN commented on May 31, 2024

Can i atleast change the drawable of speech Icon ?

from materialsearchbar.

mancj avatar mancj commented on May 31, 2024

no, you can't. I will add this possibility soon.

from materialsearchbar.

AruLNadhaN avatar AruLNadhaN commented on May 31, 2024

Thanks. I'm waiting for this feature!

from materialsearchbar.

nicks258 avatar nicks258 commented on May 31, 2024

Is this issue is fixed @mancj @AruLNadhaN

from materialsearchbar.

neri4488 avatar neri4488 commented on May 31, 2024

How can I listen to menu clicks when I inflate it and it appears in search box with 3 dots.
Thanks

from materialsearchbar.

Related Issues (20)

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.