diff options
author | Yorke Lee <yorkelee@google.com> | 2014-07-11 16:15:08 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-07-15 17:03:20 +0000 |
commit | 74edcdcac9e211d2764c1831e12ad37f84e36502 (patch) | |
tree | 6b6116d9ad860b2fe5dc55f296ec3f08fd7c0065 /src | |
parent | 434dbcc2f581619f79a691e1a39c5e69003a9d16 (diff) |
Allow overflow menu to overlap overflow button
Bug: 15988764
Change-Id: Ifeffb18a76f38a558e602c9fb5f62ef9d3404ecb
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 4965647e7..f946dc18c 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -42,6 +42,7 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.DragEvent; +import android.view.Gravity; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; @@ -215,6 +216,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private String mPendingSearchViewQuery; + private PopupMenu mOverflowMenu; private EditText mSearchView; private View mVoiceSearchButton; @@ -237,7 +239,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private class OptionsPopupMenu extends PopupMenu { public OptionsPopupMenu(Context context, View anchor) { - super(context, anchor); + super(context, anchor, Gravity.END); } @Override @@ -395,8 +397,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O ImageButton optionsMenuButton = (ImageButton) searchEditTextLayout.findViewById(R.id.dialtacts_options_menu_button); optionsMenuButton.setOnClickListener(this); - final OptionsPopupMenu optionsMenu = buildOptionsMenu(optionsMenuButton); - optionsMenuButton.setOnTouchListener(optionsMenu.getDragToOpenListener()); + mOverflowMenu = buildOptionsMenu(searchEditTextLayout); + optionsMenuButton.setOnTouchListener(mOverflowMenu.getDragToOpenListener()); // Add the favorites fragment, and the dialpad fragment, but only if savedInstanceState // is null. Otherwise the fragment manager takes care of recreating these fragments. @@ -549,7 +551,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } break; case R.id.dialtacts_options_menu_button: - buildOptionsMenu(view).show(); + mOverflowMenu.show(); break; default: { Log.wtf(TAG, "Unexpected onClick event from " + view); |