diff options
author | Yorke Lee <yorkelee@google.com> | 2013-08-23 15:34:17 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-08-23 15:34:17 -0700 |
commit | f6673d3e5cbd10febea04f02035591ab15c5c7c0 (patch) | |
tree | a6b9369cd4a8a49c337d8e0ab69a15c7af2bc520 /src | |
parent | 1d6394b58547e52e1047d64bbde0af6426a26f6b (diff) |
Hide dialpad fragment and exit search ui when phone number selected
Bug: 10328290
Change-Id: I3fc560f0727c493ae5f051320ea6abe4715f0e79
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 20 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 6 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 499ff31bd..5826afd69 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -181,12 +181,14 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // CallLog screen (search UI will be automatically exited). PhoneNumberInteraction.startInteractionForPhoneCall( DialtactsActivity.this, dataUri, getCallOrigin()); + hideDialpadAndSearchUi(); } @Override public void onCallNumberDirectly(String phoneNumber) { Intent intent = CallUtil.getCallIntent(phoneNumber, getCallOrigin()); startActivity(intent); + hideDialpadAndSearchUi(); } @Override @@ -430,7 +432,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O ft.commit(); } - private void hideDialpadFragment(boolean animate) { + private void hideDialpadFragment(boolean animate, boolean clearDialpad) { + if (mDialpadFragment == null) return; + if (clearDialpad) { + mDialpadFragment.clearDialpad(); + } + if (!mDialpadFragment.isVisible()) return; mDialpadFragment.setAdjustTranslationForAnimation(animate); final FragmentTransaction ft = getFragmentManager().beginTransaction(); if (animate) { @@ -459,12 +466,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O }); } - private void hideDialpadFragmentIfNecessary() { - if (mDialpadFragment != null && mDialpadFragment.isVisible()) { - hideDialpadFragment(true); - } - } - final AnimatorListener mHideListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { @@ -793,9 +794,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onBackPressed() { if (mDialpadFragment != null && mDialpadFragment.isVisible()) { - hideDialpadFragment(true); + hideDialpadFragment(true, false); } else if (mInSearchUi) { mSearchView.setText(null); + mDialpadFragment.clearDialpad(); } else if (isTaskRoot()) { // Instead of stopping, simply push this to the back of the stack. // This is only done when running at the top of the stack; @@ -830,7 +832,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onListFragmentScrollStateChange(int scrollState) { if (scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) { - hideDialpadFragmentIfNecessary(); + hideDialpadFragment(true, false); hideInputMethod(getCurrentFocus()); } } diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 82f537755..79e830730 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -745,7 +745,7 @@ public class DialpadFragment extends Fragment if (mClearDigitsOnStop) { mClearDigitsOnStop = false; - mDigits.getText().clear(); + clearDialpad(); } } @@ -1157,6 +1157,10 @@ public class DialpadFragment extends Fragment } } + public void clearDialpad() { + mDigits.getText().clear(); + } + private String getCallOrigin() { return (getActivity() instanceof DialtactsActivity) ? ((DialtactsActivity) getActivity()).getCallOrigin() : null; |