summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/DialtactsActivity.java20
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java6
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;