|
|
@ -115,8 +115,6 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
if (undo_manager && can(android.R.id.redo))
|
|
|
|
if (undo_manager && can(android.R.id.redo))
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_redo, order++, getTitle(R.string.title_redo));
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_redo, order++, getTitle(R.string.title_redo));
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_insert_line, order++, context.getString(R.string.title_insert_line));
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_insert_line, order++, context.getString(R.string.title_insert_line));
|
|
|
|
if (BuildConfig.DEBUG)
|
|
|
|
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_insert_arrow, order++, context.getString(R.string.title_insert_arrow));
|
|
|
|
|
|
|
|
if (snippets != null)
|
|
|
|
if (snippets != null)
|
|
|
|
for (EntityAnswer snippet : snippets) {
|
|
|
|
for (EntityAnswer snippet : snippets) {
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, order, order, snippet.name).
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, order, order, snippet.name).
|
|
|
@ -150,8 +148,6 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
return EditTextCompose.super.onTextContextMenuItem(android.R.id.redo);
|
|
|
|
return EditTextCompose.super.onTextContextMenuItem(android.R.id.redo);
|
|
|
|
else if (id == R.string.title_insert_line)
|
|
|
|
else if (id == R.string.title_insert_line)
|
|
|
|
return insertLine();
|
|
|
|
return insertLine();
|
|
|
|
else if (id == R.string.title_insert_arrow)
|
|
|
|
|
|
|
|
return insertArrow();
|
|
|
|
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
Intent intent = item.getIntent();
|
|
|
|
Intent intent = item.getIntent();
|
|
|
|
if (intent == null)
|
|
|
|
if (intent == null)
|
|
|
@ -201,19 +197,6 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean insertArrow() {
|
|
|
|
|
|
|
|
int start = getSelectionStart();
|
|
|
|
|
|
|
|
if (start < 0)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Editable edit = getText();
|
|
|
|
|
|
|
|
if (edit == null)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
edit.insert(start, " \u27f6 ");
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean insertSnippet(long id) {
|
|
|
|
private boolean insertSnippet(long id) {
|
|
|
|
if (snippets == null)
|
|
|
|
if (snippets == null)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|