Collapse search when needed

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-05-15 11:04:56 +02:00
parent 4362b59d16
commit 44bcef5d78
3 changed files with 6 additions and 1 deletions

View file

@ -119,6 +119,8 @@ public class NoteEditFragment extends BaseNoteFragment {
}
searchView.setQuery(searchQuery, true);
searchView.clearFocus();
} else {
searchMenuItem.collapseActionView();
}
final LinearLayout searchEditFrame = searchView.findViewById(android.support.v7.appcompat.R.id

View file

@ -65,6 +65,8 @@ public class NotePreviewFragment extends BaseNoteFragment {
}
searchView.setQuery(searchQuery, true);
searchView.clearFocus();
} else {
searchMenuItem.collapseActionView();
}
final LinearLayout searchEditFrame = searchView.findViewById(android.support.v7.appcompat.R.id

View file

@ -6,8 +6,9 @@
android:id="@+id/search"
android:title="@string/action_search"
android:icon="@drawable/ic_search_white_24dp"
android:orderInCategory="70"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="collapseActionView|always" />
app:showAsAction="collapseActionView|ifRoom" />
<item
android:id="@+id/menu_favorite"