summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenyi Wang <wenyiw@google.com>2016-01-23 22:40:21 +0000
committerWenyi Wang <wenyiw@google.com>2016-01-23 14:43:12 -0800
commit9eb87f4e4a41fec748ce48281f85f3b3ae32fb93 (patch)
treedae18fd081cdd38398494d03508d362febb08829
parenta84fe61b45522d3beeabdc6de9eaa05697df2281 (diff)
downloadandroid_packages_apps_Contacts-9eb87f4e4a41fec748ce48281f85f3b3ae32fb93.tar.gz
android_packages_apps_Contacts-9eb87f4e4a41fec748ce48281f85f3b3ae32fb93.tar.bz2
android_packages_apps_Contacts-9eb87f4e4a41fec748ce48281f85f3b3ae32fb93.zip
Revert "Keep overflow menu button from closing on changing orientation"
Bug: 21650562 This reverts commit ff603b5e045c596c88cf1a70b9320d36437a80cb. Change-Id: I8916df1ea8fb2ac8ebc617caea9bdd22c7bca117
-rw-r--r--res/values/integers.xml3
-rw-r--r--src/com/android/contacts/activities/ActionBarAdapter.java23
-rw-r--r--src/com/android/contacts/activities/PeopleActivity.java31
3 files changed, 1 insertions, 56 deletions
diff --git a/res/values/integers.xml b/res/values/integers.xml
index a823a3054..86a8e2697 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -27,7 +27,4 @@
<!-- Max suggestions limit showing in quick contact suggestion card [CHAR LIMIT=30]-->
<integer name="quickcontact_suggestions_limit">10</integer>
- <!-- The delay (in milliseconds) until the overflow options menu is shown automatically -->
- <integer name="open_overflow_menu_delay_millis">250</integer>
-
</resources>
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index 0f1dbbbc7..ad70d9210 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -75,14 +75,11 @@ public class ActionBarAdapter implements OnCloseListener {
private static final String EXTRA_KEY_QUERY = "navBar.query";
private static final String EXTRA_KEY_SELECTED_TAB = "navBar.selectedTab";
private static final String EXTRA_KEY_SELECTED_MODE = "navBar.selectionMode";
- private static final String EXTRA_KEY_SHOULD_OPEN_OVERFLOW = "navBar.shouldOpenOverflow";
private static final String PERSISTENT_LAST_TAB = "actionBarAdapter.lastTab";
private boolean mSelectionMode;
private boolean mSearchMode;
- private boolean mShouldOverflowOpen;
- private boolean mIsOverflowOpen;
private String mQueryString;
private EditText mSearchView;
@@ -203,12 +200,11 @@ public class ActionBarAdapter implements OnCloseListener {
mQueryString = request.getQueryString();
mCurrentTab = loadLastTabPreference();
mSelectionMode = false;
- setShouldOpenOverflow(false);
} else {
mSearchMode = savedState.getBoolean(EXTRA_KEY_SEARCH_MODE);
mSelectionMode = savedState.getBoolean(EXTRA_KEY_SELECTED_MODE);
mQueryString = savedState.getString(EXTRA_KEY_QUERY);
- setShouldOpenOverflow(savedState.getBoolean(EXTRA_KEY_SHOULD_OPEN_OVERFLOW));
+
// Just set to the field here. The listener will be notified by update().
mCurrentTab = savedState.getInt(EXTRA_KEY_SELECTED_TAB);
}
@@ -325,22 +321,6 @@ public class ActionBarAdapter implements OnCloseListener {
}
}
- public void setShouldOpenOverflow(boolean shouldOpenOverflow) {
- mShouldOverflowOpen = shouldOpenOverflow;
- }
-
- public boolean shouldOpenOverflow() {
- return mShouldOverflowOpen;
- }
-
- public void setOverflowOpen(boolean isOverflowOpen) {
- mIsOverflowOpen = isOverflowOpen;
- }
-
- public boolean isOverflowOpen() {
- return mIsOverflowOpen;
- }
-
public String getQueryString() {
return mSearchMode ? mQueryString : null;
}
@@ -573,7 +553,6 @@ public class ActionBarAdapter implements OnCloseListener {
public void onSaveInstanceState(Bundle outState) {
outState.putBoolean(EXTRA_KEY_SEARCH_MODE, mSearchMode);
outState.putBoolean(EXTRA_KEY_SELECTED_MODE, mSelectionMode);
- outState.putBoolean(EXTRA_KEY_SHOULD_OPEN_OVERFLOW, mShouldOverflowOpen);
outState.putString(EXTRA_KEY_QUERY, mQueryString);
outState.putInt(EXTRA_KEY_SELECTED_TAB, mCurrentTab);
}
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index f0ad19d1c..c495ee8ec 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -31,7 +31,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.UserManager;
-import android.os.Handler;
import android.preference.PreferenceActivity;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
@@ -438,16 +437,6 @@ public class PeopleActivity extends AppCompatContactsActivity implements
// Current tab may have changed since the last onSaveInstanceState(). Make sure
// the actual contents match the tab.
updateFragmentsVisibility();
-
- if (mActionBarAdapter.shouldOpenOverflow() && !mActionBarAdapter.isOverflowOpen()) {
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- openOptionsMenu();
- }
- }, /* delayMillis = */ getResources().getInteger(R.integer.
- open_overflow_menu_delay_millis));
- }
}
@Override
@@ -1480,24 +1469,4 @@ public class PeopleActivity extends AppCompatContactsActivity implements
}
return position;
}
-
- @Override
- public boolean onMenuOpened(int featureId, Menu menu) {
- // When the overflow menu button opens (both manually and automatically), we need to
- // update both variables; same for closing event.
- mActionBarAdapter.setOverflowOpen(true);
- mActionBarAdapter.setShouldOpenOverflow(true);
- return super.onMenuOpened(featureId, menu);
- }
-
- @Override
- public void onPanelClosed(int featureId, Menu menu) {
- // Since onPanelClosed will be called when the activity is destroyed on rotation even if
- // user leaves the menu open, we are relying on onSaveInstanceState being called before
- // onDestroy and onPanelClosed are invoked in order to store the "opening" status of the
- // menu.
- mActionBarAdapter.setOverflowOpen(false);
- mActionBarAdapter.setShouldOpenOverflow(false);
- super.onMenuOpened(featureId, menu);
- }
}