Skip to content

Instantly share code, notes, and snippets.

@piotrmadry
Last active July 27, 2018 08:52
Show Gist options
  • Save piotrmadry/dbb59588996cc6dbd52dcc5cf13242b2 to your computer and use it in GitHub Desktop.
Save piotrmadry/dbb59588996cc6dbd52dcc5cf13242b2 to your computer and use it in GitHub Desktop.
@Override
protected FragmentToolbar builder() {
return new FragmentToolbar.Builder()
.withId(R.id.toolbar)
.withTitle(R.string.toolbar_title)
.withMenu(R.menu.menu_options)
.withSearchAndFilters(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(final String query) {
return false;
}
@Override
public boolean onQueryTextChange(final String newText) {
doActionWithQuery(newText);
return false;
}
}, filterClick -> {
openDrawer();
return false;
})
.withSearchHint(R.string.search_view_hint)
.onHomePressedDefaultAction()
.build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment