Skip to content

Commit

Permalink
fix2: remember selected kbd
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Jul 18, 2018
1 parent c16cc25 commit e533168
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions leankeykeyboard/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.liskovsoft.leankeykeyboard.pro"
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode 65
versionName "4.3.15"
versionCode 67
versionName "4.3.17"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ public boolean onKeyLongPress() {
setTouchState(LeanbackKeyboardContainer.TOUCH_STATE_NO_TOUCH);
return true;
} else if (keyCode == LeanbackKeyboardView.ASCII_SPACE) {
switchToNextKeyboard();
onLangKeyPress();
setTouchState(LeanbackKeyboardContainer.TOUCH_STATE_NO_TOUCH);
return true;
} else if (keyCode == LeanbackKeyboardView.KEYCODE_LANG_TOGGLE) {
Expand Down Expand Up @@ -1117,14 +1117,18 @@ public void startVoiceRecording() {
* Switch to next keyboard (looped).
* {@link KeyboardManager KeyboardManager} is the source behind all keyboard implementations
*/
public void switchToNextKeyboard() {
public void onLangKeyPress() {
switchToNextKeyboard();

showRunOnceDialog();
}

private void switchToNextKeyboard() {
LeanbackKeyboardView keyboardView = mMainKeyboardView;
Keyboard keyboard = mKeyboardManager.getNextKeyboard();
mInitialMainKeyboard = keyboard;
mAbcKeyboard = keyboard;
keyboardView.setKeyboard(keyboard);

showRunOnceDialog();
}

public void updateAddonKeyboard() {
Expand Down Expand Up @@ -1157,7 +1161,7 @@ public void updateSuggestions(ArrayList<String> suggestions) {
}

public void onLangKeyClick() {
switchToNextKeyboard();
onLangKeyPress();
// setTouchState(LeanbackKeyboardContainer.TOUCH_STATE_NO_TOUCH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private boolean applyLETVFixesDown(int keyCode) {
private boolean applyLETVFixesUp(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_MENU:
this.mContainer.switchToNextKeyboard();
this.mContainer.onLangKeyPress();
break;
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
this.fakeKeyIndex(0, 2);
Expand Down

0 comments on commit e533168

Please sign in to comment.