Example #1
0
 public void onClick(View v) {
   if (v == mBackImageView) {
     closeSearch();
   } else if (v == mVoiceImageView) {
     onVoiceClicked();
   } else if (v == mEmptyImageView) {
     mSearchEditText.setText(null);
   } else if (v == mSearchEditText) {
     showSuggestions();
   } else if (v == mTintView) {
     closeSearch();
   }
 }
Example #2
0
 @Override
 public void onBackPressed() {
   if (mSearchView.isSearchOpen()) {
     mSearchView.closeSearch();
   } else {
     super.onBackPressed();
   }
 }
Example #3
0
 private void onSubmitQuery() {
   CharSequence query = mSearchEditText.getText();
   if (query != null && TextUtils.getTrimmedLength(query) > 0) {
     if (mOnQueryChangeListener == null
         || !mOnQueryChangeListener.onQueryTextSubmit(query.toString())) {
       closeSearch();
       mSearchEditText.setText(null);
     }
   }
 }