summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-23 10:34:40 -0700
committerAndrew Lee <anwlee@google.com>2014-06-23 13:24:33 -0700
commit1f432a644a930688addec25bf406b3b1df08a6d3 (patch)
tree3f17a71de0bfab0f04e914b75aab7d53b8e6062a
parentfd723cae1dc2de0f83ec14639d4431674dd3b82e (diff)
Hide the dialpad fragment onResume after dialing.
- Before, the dialpad fragment was being hidden immediately after the user dialed a number. This caused the view in the lists fragment to flash for a second between pressing dial and launching InCallUI. - Now, don't clear/hide the dialpad fragment once the dialpad button is pressed. - Instead, in DialtactsActivity, stash an instance variable to hide and clear the dialpad fragment the next time onResume() is called... that is, the next time the Dialer is opened. Bug: 15829164 Change-Id: I1e7d253b914c049f49bc8c1230f7110d6e98ec08
-rw-r--r--src/com/android/dialer/DialtactsActivity.java7
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 8e873c876..2b2be2da8 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -131,6 +131,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
private static final String KEY_IN_DIALPAD_SEARCH_UI = "in_dialpad_search_ui";
private static final String KEY_SEARCH_QUERY = "search_query";
private static final String KEY_FIRST_LAUNCH = "first_launch";
+ private static final String KEY_HIDE_DIALPAD = "hide_dialpad";
private static final String KEY_IS_DIALPAD_SHOWN = "is_dialpad_shown";
private static final String TAG_DIALPAD_FRAGMENT = "dialpad";
@@ -192,6 +193,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
private boolean mClearSearchOnPause;
private boolean mIsDialpadShown;
private boolean mShowDialpadOnResume;
+ private boolean mHideDialpadOnResume;
/**
* Whether or not the device is in landscape orientation.
@@ -423,6 +425,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mInRegularSearch = savedInstanceState.getBoolean(KEY_IN_REGULAR_SEARCH_UI);
mInDialpadSearch = savedInstanceState.getBoolean(KEY_IN_DIALPAD_SEARCH_UI);
mFirstLaunch = savedInstanceState.getBoolean(KEY_FIRST_LAUNCH);
+ mHideDialpadOnResume = savedInstanceState.getBoolean(KEY_HIDE_DIALPAD);
mShowDialpadOnResume = savedInstanceState.getBoolean(KEY_IS_DIALPAD_SHOWN);
mActionBarController.restoreInstanceState(savedInstanceState);
}
@@ -480,6 +483,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
} else if (!phoneIsInUse() && mInCallDialpadUp) {
hideDialpadFragment(false, true);
mInCallDialpadUp = false;
+ } else if (mHideDialpadOnResume) {
+ hideDialpadFragment(false, true);
} else if (mShowDialpadOnResume) {
showDialpadFragment(false);
mShowDialpadOnResume = false;
@@ -506,6 +511,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
outState.putBoolean(KEY_IN_REGULAR_SEARCH_UI, mInRegularSearch);
outState.putBoolean(KEY_IN_DIALPAD_SEARCH_UI, mInDialpadSearch);
outState.putBoolean(KEY_FIRST_LAUNCH, mFirstLaunch);
+ outState.putBoolean(KEY_HIDE_DIALPAD, mHideDialpadOnResume);
outState.putBoolean(KEY_IS_DIALPAD_SHOWN, mIsDialpadShown);
mActionBarController.saveInstanceState(outState);
}
@@ -550,6 +556,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
} else {
// Dial button was pressed; tell the Dialpad fragment
mDialpadFragment.dialButtonPressed();
+ mHideDialpadOnResume = true;
}
break;
case R.id.voice_search_button:
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index f54aa6c39..ddf6ba908 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -1076,7 +1076,6 @@ public class DialpadFragment extends Fragment
(getActivity() instanceof DialtactsActivity ?
((DialtactsActivity) getActivity()).getCallOrigin() : null));
DialerUtils.startActivityWithErrorToast(getActivity(), intent);
- hideAndClearDialpad(false);
}
}
}