@Override public void onResume() { super.onResume(); SearchBar searchBar = (SearchBar) getView().findViewById(R.id.lb_search_bar); searchBar.setSearchQuery(""); mResultAdapter.clear(); }
/** * An action which sets the searchQuery property of {@code view} with String values. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe * to free this reference. */ @CheckResult @NonNull public static Consumer<? super String> searchQuery(@NonNull final SearchBar view) { checkNotNull(view, "view == null"); return new Consumer<String>() { @Override public void accept(String text) throws Exception { view.setSearchQuery(text); } }; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.lb_search_fragment); searchBar = (SearchBar) findViewById(R.id.lb_search_bar); searchEditText = (SearchEditText) searchBar.findViewById(R.id.lb_search_text_editor); // reduce flakiness SearchOrbView searchOrbView = (SearchOrbView) searchBar.findViewById(R.id.lb_search_bar_speech_orb); searchOrbView.enableOrbColorAnimation(false); searchOrbView.setSoundEffectsEnabled(false); searchOrbView.clearAnimation(); }
@CheckResult @NonNull public static SearchBarSearchQueryKeyboardDismissedEvent create(@NonNull SearchBar view, @NonNull String query) { return new AutoValue_SearchBarSearchQueryKeyboardDismissedEvent(view, query); }
SearchBarSearchQueryChangeEventsOnSubscribe(SearchBar view) { this.view = view; }
Listener(SearchBar view, Observer<? super SearchBarSearchQueryEvent> observer) { this.view = view; this.observer = observer; }
/** The view from which this event occurred. */ @NonNull public abstract SearchBar view();
@CheckResult @NonNull public static SearchBarSearchQuerySubmittedEvent create(@NonNull SearchBar view, @NonNull String query) { return new AutoValue_SearchBarSearchQuerySubmittedEvent(view, query); }
SearchBarSearchQueryChangesOnSubscribe(SearchBar view) { this.view = view; }
Listener(SearchBar view, Observer<? super String> observer) { this.view = view; this.observer = observer; }
@CheckResult @NonNull public static SearchBarSearchQueryChangedEvent create(@NonNull SearchBar view, @NonNull String query) { return new AutoValue_SearchBarSearchQueryChangedEvent(view, query); }
/** * Create an observable of {@linkplain SearchBarSearchQueryEvent search query events} on {@code * view}. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe * to free this reference. * <p> */ @CheckResult @NonNull public static Observable<SearchBarSearchQueryEvent> searchQueryChangeEvents( @NonNull SearchBar view) { checkNotNull(view, "view == null"); return new SearchBarSearchQueryChangeEventsOnSubscribe(view); }
/** * Create an observable of String values for search query changes on {@code view}. * <p> * <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe * to free this reference. * <p> */ @CheckResult @NonNull public static Observable<String> searchQueryChanges(@NonNull SearchBar view) { checkNotNull(view, "view == null"); return new SearchBarSearchQueryChangesOnSubscribe(view); }