[Input method] Try TextView

This commit is contained in:
khanhduytran0 2020-11-27 17:36:20 +07:00
parent cfc3686dda
commit 09f3ff4bef
2 changed files with 9 additions and 5 deletions

View File

@ -74,7 +74,7 @@ public class BaseMainActivity extends LoggableActivity {
private DrawerLayout drawerLayout;
private NavigationView navDrawer;
private CapturedEditText mKeyHandlerView;
protected CapturedEditText mKeyHandlerView;
private LinearLayout contentLog;
private TextView textLog;
@ -200,8 +200,7 @@ public class BaseMainActivity extends LoggableActivity {
mKeyHandlerView = findViewById(R.id.main_key_handler);
mKeyHandlerView.setSingleLine(false);
mKeyHandlerView.setFocusable(false);
mKeyHandlerView.setFocusableInTouchMode(false);
mKeyHandlerView.clearFocus();
AndroidLWJGLKeycode.isBackspaceAfterChar = true; // mVersionInfo.minimumLauncherVersion >= 18;
@ -1021,7 +1020,7 @@ public class BaseMainActivity extends LoggableActivity {
}
public void showKeyboard() {
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).showSoftInput(mKeyHandlerView, InputMethodManager.SHOW_IMPLICIT);
}
protected void setRightOverride(boolean val) {

View File

@ -5,7 +5,7 @@ import android.util.*;
import android.widget.*;
import android.view.*;
public class CapturedEditText extends EditText
public class CapturedEditText extends TextView
{
public CapturedEditText(Context ctx) {
this(ctx, null);
@ -15,6 +15,11 @@ public class CapturedEditText extends EditText
super(ctx, attrs);
}
@Override
public boolean getDefaultEditable() {
return true;
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
AndroidLWJGLKeycode.execKey(event, keyCode, true);