Bug 871652 - Disable toolbar's context menu while in editing mode (r=sriram)

This commit is contained in:
Lucas Rocha 2013-08-14 10:55:27 +01:00
parent a7c760ae02
commit 7ab7b1dd8b

View File

@ -310,6 +310,11 @@ public class BrowserToolbar extends GeckoRelativeLayout
setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
// We don't the context menu while editing
if (isEditing()) {
return;
}
MenuInflater inflater = mActivity.getMenuInflater();
inflater.inflate(R.menu.titlebar_contextmenu, menu);
@ -423,7 +428,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
if (text.getSelectionStart() == text.getSelectionEnd())
return false;
// mActivity.getActionBar().show();
return false;
}
@ -431,15 +435,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
});
mUrlEditText.setOnSelectionChangedListener(new CustomEditText.OnSelectionChangedListener() {
@Override
public void onSelectionChanged(int selStart, int selEnd) {
if (Build.VERSION.SDK_INT >= 11 && selStart == selEnd) {
// mActivity.getActionBar().hide();
}
}
});
mTabs.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
@ -771,10 +766,6 @@ public class BrowserToolbar extends GeckoRelativeLayout
InputMethods.isGestureKeyboard(mUrlEditText.getContext())) {
updateGoButton(text);
}
if (Build.VERSION.SDK_INT >= 11) {
// mActivity.getActionBar().hide();
}
}
@Override