mirror of https://github.com/M66B/FairEmail.git
Added common compose keynoard shortcuts
This commit is contained in:
parent
af4734c9a9
commit
874a5c396e
|
@ -4786,10 +4786,29 @@ public class FragmentCompose extends FragmentBase {
|
||||||
private ActivityBase.IKeyPressedListener onKeyPressedListener = new ActivityBase.IKeyPressedListener() {
|
private ActivityBase.IKeyPressedListener onKeyPressedListener = new ActivityBase.IKeyPressedListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyPressed(KeyEvent event) {
|
public boolean onKeyPressed(KeyEvent event) {
|
||||||
if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER && event.isCtrlPressed()) {
|
if (event.isCtrlPressed() && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
onAction(R.id.action_send, "enter");
|
switch (event.getKeyCode()) {
|
||||||
return true;
|
case KeyEvent.KEYCODE_ENTER:
|
||||||
|
onAction(R.id.action_send, "enter");
|
||||||
|
return true;
|
||||||
|
case KeyEvent.KEYCODE_B:
|
||||||
|
if (etBody.hasSelection())
|
||||||
|
return StyleHelper.apply(R.id.menu_bold, etBody);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
case KeyEvent.KEYCODE_I:
|
||||||
|
if (etBody.hasSelection())
|
||||||
|
return StyleHelper.apply(R.id.menu_italic, etBody);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
case KeyEvent.KEYCODE_U:
|
||||||
|
if (etBody.hasSelection())
|
||||||
|
return StyleHelper.apply(R.id.menu_underline, etBody);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue