mirror of https://github.com/M66B/FairEmail.git
Debug: insert arrow
This commit is contained in:
parent
374701f396
commit
5488b980b9
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1763,6 +1763,7 @@
|
|||
<string name="title_undo">Undo</string>
|
||||
<string name="title_redo">Redo</string>
|
||||
<string name="title_insert_line">Insert line</string>
|
||||
<string name="title_insert_arrow" translatable="false">Insert arrow</string>
|
||||
<string name="title_add">Add</string>
|
||||
<string name="title_browse">Open with</string>
|
||||
<string name="title_info">Info</string>
|
||||
|
|
Loading…
Reference in New Issue