mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-26 02:45:31 +01:00
Debug: insert arrow
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user