swapped the functions of the RF3 key
This commit is contained in:
parent
908796c4f3
commit
9785b32f19
1 changed files with 22 additions and 18 deletions
|
|
@ -21,7 +21,7 @@ public class SoftKeyRF3 extends SoftKey {
|
||||||
return tt9 != null && tt9.isInputLimited();
|
return tt9 != null && tt9.isInputLimited();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTextEdtingActive() {
|
private boolean isTextEditingActive() {
|
||||||
return tt9 != null && tt9.isTextEditingActive();
|
return tt9 != null && tt9.isTextEditingActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,51 +29,55 @@ public class SoftKeyRF3 extends SoftKey {
|
||||||
protected void handleHold() {
|
protected void handleHold() {
|
||||||
preventRepeat();
|
preventRepeat();
|
||||||
|
|
||||||
if (!validateTT9Handler() || isTextEdtingActive()) {
|
if (!validateTT9Handler() || isTextEditingActive() || isVoiceInputMissing()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tt9.isVoiceInputActive()) {
|
|
||||||
tt9.toggleVoiceInput();
|
tt9.toggleVoiceInput();
|
||||||
} else {
|
|
||||||
tt9.showTextEditingPalette();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean handleRelease() {
|
protected boolean handleRelease() {
|
||||||
if (!validateTT9Handler()) {
|
if (!validateTT9Handler() && isTextEditingMissing() && isVoiceInputMissing()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTextEdtingActive()) {
|
if (tt9.isVoiceInputActive() || isTextEditingMissing()) {
|
||||||
|
tt9.toggleVoiceInput();
|
||||||
|
} else if (isTextEditingActive()) {
|
||||||
tt9.hideTextEditingPalette();
|
tt9.hideTextEditingPalette();
|
||||||
} else {
|
} else {
|
||||||
tt9.toggleVoiceInput();
|
tt9.showTextEditingPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTitle() {
|
protected String getTitle() {
|
||||||
if (isTextEdtingActive()) {
|
if (isTextEditingActive()) {
|
||||||
return tt9 == null ? "ABC" : tt9.getABCString();
|
return tt9 == null ? "ABC" : tt9.getABCString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return isTextEditingMissing() && !isVoiceInputMissing() ? "🎤" : getContext().getString(R.string.virtual_key_text_editing).toUpperCase();
|
if (!isVoiceInputMissing()) {
|
||||||
|
return "🎤";
|
||||||
|
}
|
||||||
|
|
||||||
|
return getContext().getString(R.string.virtual_key_text_editing).toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getSubTitle() {
|
protected String getSubTitle() {
|
||||||
return isTextEdtingActive() || (!isVoiceInputMissing() && isTextEditingMissing()) ? null : "🎤";
|
if (isTextEditingActive() || isTextEditingMissing() || isVoiceInputMissing()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getContext().getString(R.string.virtual_key_text_editing).toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
if (isVoiceInputMissing() && isTextEditingMissing()) {
|
|
||||||
setVisibility(INVISIBLE);
|
|
||||||
} else {
|
|
||||||
super.render();
|
super.render();
|
||||||
}
|
setEnabled(!(isVoiceInputMissing() && isTextEditingMissing()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue