Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nullref on exiting dialer by long pressing of Back key on KYF33 #262

Merged
merged 5 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/io/github/sspanak/tt9/ime/KeyPadHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void onStartInput(EditorInfo inputField, boolean restarting) {

@Override
public void onStartInputView(EditorInfo inputField, boolean restarting) {
currentInputConnection = getCurrentInputConnection();
onRestart(inputField);
}

Expand Down
8 changes: 6 additions & 2 deletions src/io/github/sspanak/tt9/ime/TraditionalT9.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

Expand All @@ -27,8 +29,10 @@
public class TraditionalT9 extends KeyPadHandler {
// internal settings/data
private boolean isActive = false;
private TextField textField;
private InputType inputType;
@NotNull
private TextField textField = new TextField(null, null);
@NotNull
private InputType inputType = new InputType(null, null);

// editing mode
protected static final int NON_EDIT = 0;
Expand Down
8 changes: 8 additions & 0 deletions src/io/github/sspanak/tt9/ime/modes/ModeDialer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.sspanak.tt9.ime.modes;

import androidx.annotation.NonNull;

import io.github.sspanak.tt9.ime.helpers.Key;

// see: InputType.isDialer()
Expand All @@ -12,4 +14,10 @@ public class ModeDialer extends Mode123 {
public boolean onOtherKey(int key) {
return !Key.isDecimalSeparator(key) && super.onOtherKey(key);
}

@NonNull
@Override
public String toString() {
return "Dialer";
}
}