new dev bug: fixed the text editing palette closing when backspace is pressed
This commit is contained in:
parent
547b18a56f
commit
f4395ad6fb
7 changed files with 36 additions and 53 deletions
|
|
@ -234,7 +234,9 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
mInputMode.onAcceptSuggestion(suggestionOps.acceptIncomplete());
|
||||
resetKeyRepeat();
|
||||
|
||||
mainView.render();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.renderKeys();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -271,7 +273,9 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
.loadSuggestions(filter);
|
||||
}
|
||||
|
||||
mainView.render();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.renderKeys();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -289,7 +293,7 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
backward = isLanguageRTL != backward;
|
||||
scrollSuggestions(backward);
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
if (appHacks.onBackspace(settings, mInputMode)) {
|
||||
mInputMode.reset();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
}
|
||||
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -189,7 +189,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
mInputMode.onAcceptSuggestion(lastWord);
|
||||
autoCorrectSpace(lastWord, false, key);
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
|
||||
forceShowWindow();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -379,7 +379,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
autoCorrectSpace(word, false, mInputMode.getSequence().isEmpty() ? -1 : mInputMode.getSequence().charAt(0) - '0');
|
||||
mInputMode.determineNextWordTextCase();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ public abstract class TypingHandler extends KeyPadHandler {
|
|||
autoCorrectSpace(word, true, fromKey);
|
||||
resetKeyRepeat();
|
||||
if (settings.isMainLayoutNumpad()) {
|
||||
mainView.render();
|
||||
mainView.renderKeys();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,4 +309,13 @@ abstract class BaseMainLayout {
|
|||
* Do all the necessary stuff to display the View.
|
||||
*/
|
||||
abstract void render();
|
||||
|
||||
/**
|
||||
* Run render only on the keys, for example, to refresh their state.
|
||||
*/
|
||||
void renderKeys() {
|
||||
for (SoftKey key : getKeys()) {
|
||||
key.render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,25 +50,7 @@ class MainLayoutNumpad extends BaseMainLayout {
|
|||
view.findViewById(R.id.numpad_column_102).setVisibility(LinearLayout.VISIBLE);
|
||||
view.findViewById(R.id.numpad_column_103).setVisibility(LinearLayout.VISIBLE);
|
||||
|
||||
for (SoftKey key : getKeys()) {
|
||||
int keyId = key.getId();
|
||||
|
||||
if (
|
||||
keyId == R.id.soft_key_add_word
|
||||
|| keyId == R.id.soft_key_filter
|
||||
|| keyId == R.id.soft_key_shift
|
||||
|| keyId == R.id.soft_key_rf3
|
||||
|| keyId == R.id.soft_key_lf4
|
||||
|| keyId == R.id.soft_key_0
|
||||
|| keyId == R.id.soft_key_100
|
||||
|| keyId == R.id.soft_key_punctuation_101
|
||||
|| keyId == R.id.soft_key_punctuation_102
|
||||
|| keyId == R.id.soft_key_punctuation_201
|
||||
|| keyId == R.id.soft_key_punctuation_202
|
||||
) {
|
||||
key.render();
|
||||
}
|
||||
}
|
||||
renderKeys();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -83,25 +65,7 @@ class MainLayoutNumpad extends BaseMainLayout {
|
|||
view.findViewById(R.id.numpad_column_102).setVisibility(LinearLayout.GONE);
|
||||
view.findViewById(R.id.numpad_column_103).setVisibility(LinearLayout.GONE);
|
||||
|
||||
for (SoftKey key : getKeys()) {
|
||||
int keyId = key.getId();
|
||||
|
||||
if (
|
||||
keyId == R.id.soft_key_add_word
|
||||
|| keyId == R.id.soft_key_filter
|
||||
|| keyId == R.id.soft_key_shift
|
||||
|| keyId == R.id.soft_key_rf3
|
||||
|| keyId == R.id.soft_key_lf4
|
||||
|| keyId == R.id.soft_key_0
|
||||
|| keyId == R.id.soft_key_100
|
||||
|| keyId == R.id.soft_key_punctuation_101
|
||||
|| keyId == R.id.soft_key_punctuation_102
|
||||
|| keyId == R.id.soft_key_punctuation_201
|
||||
|| keyId == R.id.soft_key_punctuation_202
|
||||
) {
|
||||
key.render();
|
||||
}
|
||||
}
|
||||
renderKeys();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -387,8 +351,6 @@ class MainLayoutNumpad extends BaseMainLayout {
|
|||
keyHeights[0]
|
||||
);
|
||||
|
||||
for (SoftKey key : getKeys()) {
|
||||
key.render();
|
||||
}
|
||||
renderKeys();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,5 @@ class MainLayoutStealth extends BaseMainLayout {
|
|||
@Override boolean isTextEditingPaletteShown() { return isTextEditingPaletteShown; }
|
||||
@Override void setWidth(int w, int g) {}
|
||||
@Override void render() {}
|
||||
@Override void renderKeys() {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ class MainLayoutTray extends BaseMainLayout {
|
|||
setWidth(tt9.getSettings().getWidthPercent(), tt9.getSettings().getAlignment());
|
||||
setBackgroundBlending();
|
||||
enableClickHandlers();
|
||||
for (SoftKey key : getKeys()) {
|
||||
key.render();
|
||||
}
|
||||
renderKeys();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,15 @@ public class MainView {
|
|||
main.render();
|
||||
}
|
||||
|
||||
public void renderKeys() {
|
||||
if (main == null) {
|
||||
Logger.e(LOG_TAG, "Cannot render keys for a null MainView.");
|
||||
return;
|
||||
}
|
||||
|
||||
main.renderKeys();
|
||||
}
|
||||
|
||||
public void showCommandPalette() {
|
||||
if (main != null) {
|
||||
main.showCommandPalette();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue