|
|
|
@ -98,6 +98,8 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
|
if (undo_manager && can(android.R.id.redo))
|
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_redo, 1002, getTitle(R.string.title_redo));
|
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_insert_line, 1003, R.string.title_insert_line);
|
|
|
|
|
if (BuildConfig.DEBUG)
|
|
|
|
|
menu.add(Menu.CATEGORY_SECONDARY, R.string.title_insert_arrow, 1004, R.string.title_insert_arrow);
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
@ -125,6 +127,8 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
|
return EditTextCompose.super.onTextContextMenuItem(android.R.id.redo);
|
|
|
|
|
else if (id == R.string.title_insert_line)
|
|
|
|
|
return insertLine();
|
|
|
|
|
else if (id == R.string.title_insert_arrow)
|
|
|
|
|
return insertArrow();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -167,6 +171,19 @@ public class EditTextCompose extends FixedEditText {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|