arimorty / floatingsearchview

A search view that implements a floating search bar also known as persistent search
https://github.com/arimorty/floatingsearchview/blob/master/README.md
Apache License 2.0
3.54k stars 667 forks source link

Inner menu is never shown #254

Open vanlooverenkoen opened 7 years ago

vanlooverenkoen commented 7 years ago
<?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/sdf"
        android:icon="@drawable/ic_arrow_back_black_24dp"
        android:title=""
        app:showAsAction="ifRoom">
        <menu>
            <item
                android:id="@+id/menu_sorsqdft_by_rank"
                android:title="Sort by rank"
                app:showAsAction="ifRoom|withText" />

            <item
                android:id="@+id/menu_sosqdfrt_by_name"
                android:title="Sort by name"
                app:showAsAction="ifRoom|withText" />
        </menu>
    </item>
    <item
        android:id="@+id/menu_sorqsdft_by_percentage"
        android:title="Sort by percentage"
        app:showAsAction="never" />
</menu>

the show by rank & sort by name are never shown (no popupmenu will ever be created)

jbhv12 commented 7 years ago

try changing app:showAsAction="ifRoom" to app:showAsAction="always"

nelletto commented 6 years ago
<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=".component.main.MainActivity">

    <item
        android:id="@+id/optionHome"
        android:icon="@drawable/ic_home_white_24dp"
        android:title="Home"
        app:showAsAction="always" />

    <item
        android:id="@+id/filter"
        android:icon="@drawable/ic_filter_list_white_24dp"
        android:title="filtro"
        app:showAsAction="always">

        <menu>
            <item
                android:id="@+id/filterOpen"
                android:checkable="true"
                android:checked="true"
                android:title="aperto" />

            <item
                android:id="@+id/filterClosed"
                android:checkable="true"
                android:checked="true"
                android:title="chiuso" />

        </menu>
    </item>
</menu>

I have the same problem!