diff options
author | Yorke Lee <yorkelee@google.com> | 2014-05-29 14:20:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-29 14:20:23 +0000 |
commit | 2bbdd6a3d0ad2a67bf77b465d0a46c5d319d25b6 (patch) | |
tree | 24eace3ad8b65ef465a4b7fbe6a566c88223d43d | |
parent | bb4a8512997ed3199a5d84f2013e21fc8d7111e8 (diff) | |
parent | 50aba888d4563e755251d97c2ba11a96caee58b1 (diff) |
Merge "Save state of dialpad in onSaveInstanceState" into lmp-preview-dev
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 0adc27ddc..82b78381c 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -127,6 +127,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_IS_DIALPAD_SHOWN = "is_dialpad_shown"; private static final String TAG_DIALPAD_FRAGMENT = "dialpad"; private static final String TAG_REGULAR_SEARCH_FRAGMENT = "search"; @@ -172,6 +173,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private boolean mInRegularSearch; private boolean mClearSearchOnPause; private boolean mIsDialpadShown; + private boolean mShowDialpadOnResume; /** * The position of the currently selected tab in the attached {@link ListsFragment}. @@ -368,6 +370,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); + mShowDialpadOnResume = savedInstanceState.getBoolean(KEY_IS_DIALPAD_SHOWN); mActionBarController.restoreInstanceState(savedInstanceState); } @@ -410,6 +413,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } else if (!phoneIsInUse() && mInCallDialpadUp) { hideDialpadFragment(false, true); mInCallDialpadUp = false; + } else if (mShowDialpadOnResume) { + showDialpadFragment(false); + mShowDialpadOnResume = false; } mFirstLaunch = false; prepareVoiceSearchButton(); @@ -432,6 +438,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_IS_DIALPAD_SHOWN, mIsDialpadShown); mActionBarController.saveInstanceState(outState); } @@ -439,9 +446,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void onAttachFragment(Fragment fragment) { if (fragment instanceof DialpadFragment) { mDialpadFragment = (DialpadFragment) fragment; - final FragmentTransaction transaction = getFragmentManager().beginTransaction(); - transaction.hide(mDialpadFragment); - transaction.commit(); + if (!mShowDialpadOnResume) { + final FragmentTransaction transaction = getFragmentManager().beginTransaction(); + transaction.hide(mDialpadFragment); + transaction.commit(); + } } else if (fragment instanceof SmartDialSearchFragment) { mSmartDialSearchFragment = (SmartDialSearchFragment) fragment; mSmartDialSearchFragment.setOnPhoneNumberPickerActionListener(this); |