This is my code:
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/top_app_bar"
app:navigationIcon="@drawable/baseline_arrow_back_24">
(...)
<androidx.appcompat.widget.SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
</com.google.android.material.appbar.MaterialToolbar>
How do I test the SearchView with Barista? The visibility is set to visible whenever the search button in the menu is clicked.
The menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/search"
android:title="@string/search"
android:contentDescription="@string/search"
app:showAsAction="ifRoom"
android:icon="@drawable/search"/>
<item
android:id="@+id/config"
android:title="@string/configuracion"
android:contentDescription="Configuracion"
app:showAsAction="ifRoom"
android:icon="@drawable/options"/>
</menu>