Java Code Examples for androidx.core.view.MenuItemCompat#collapseActionView()

The following examples show how to use androidx.core.view.MenuItemCompat#collapseActionView() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SearchCityFragment.java    From prayer-times-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View view) {
    if (view == mFab) {
        MenuItemCompat.collapseActionView(mSearchItem);
        MenuItemCompat.expandActionView(mSearchItem);
    }
}
 
Example 2
Source File: SearchFragment.java    From Audinaut with GNU General Public License v3.0 5 votes vote down vote up
public void search(final String query, final boolean autoplay) {
    if (skipSearch) {
        skipSearch = false;
        return;
    }
    currentQuery = query;

    BackgroundTask<SearchResult> task = new TabBackgroundTask<SearchResult>(this) {
        @Override
        protected SearchResult doInBackground() throws Throwable {
            SearchCritera criteria = new SearchCritera(query, MAX_ARTISTS, MAX_ALBUMS, MAX_SONGS);
            MusicService service = MusicServiceFactory.getMusicService(context);
            return service.search(criteria, context, this);
        }

        @Override
        protected void done(SearchResult result) {
            searchResult = result;
            recyclerView.setAdapter(adapter = new SearchAdapter(context, searchResult, getImageLoader(), largeAlbums, SearchFragment.this));
            if (autoplay) {
                autoplay(query);
            }

        }
    };
    task.execute();

    if (searchItem != null) {
        MenuItemCompat.collapseActionView(searchItem);
    }
}
 
Example 3
Source File: SearchCityFragment.java    From prayer-times-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View view) {
    if (view == mFab) {
        MenuItemCompat.collapseActionView(mSearchItem);
        MenuItemCompat.expandActionView(mSearchItem);
    }
}
 
Example 4
Source File: SelectFileActivity.java    From turbo-editor with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onPreExecute() {
    super.onPreExecute();
    if (mSearchView != null) {
        mSearchView.setIconified(true);
        MenuItemCompat.collapseActionView(mSearchViewMenuItem);
        mSearchView.setQuery("", false);
    }

}
 
Example 5
Source File: TaskListActivity.java    From opentasks with Apache License 2.0 4 votes vote down vote up
private void hideSearchActionView()
{
    MenuItemCompat.collapseActionView(mSearchItem);
}