From a851542c69872ffa6c5615fd8cdd1381f1b13b93 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 13 Jun 2014 16:53:54 -0700 Subject: Clear fragments properly when search term is erased. Specifically, in the scenario in the bug the dialpad was not shown but we actually wanted to clear the speed dial fragment, not the regular search fragment. Change this to affect the visible fragment, rather than whether or not the dialpad is shown. This onClick pathway is no longer used too, so deleting. Bug: 15516704 Change-Id: Icd4419e0746ce0e2bcb9c9437dbac77d64bb8c98 --- src/com/android/dialer/DialtactsActivity.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 19af4ef91..f5a2d3ed5 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -310,9 +310,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } } - if (mIsDialpadShown && mSmartDialSearchFragment != null) { + if (mSmartDialSearchFragment != null && mSmartDialSearchFragment.isVisible()) { mSmartDialSearchFragment.setQueryString(mSearchQuery, false /* delaySelection */); - } else if (mRegularSearchFragment != null) { + } else if (mRegularSearchFragment != null && mRegularSearchFragment.isVisible()) { mRegularSearchFragment.setQueryString(mSearchQuery, false /* delaySelection */); } } @@ -550,13 +550,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mDialpadFragment.dialButtonPressed(); } break; - case R.id.search_close_button: - // Clear the search field - if (!TextUtils.isEmpty(mSearchView.getText())) { - mDialpadFragment.clearDialpad(); - mSearchView.setText(null); - } - break; case R.id.voice_search_button: try { startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), -- cgit v1.2.3