Skip to content

Commit

Permalink
Clean-up edittext implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Jul 7, 2024
1 parent f3af22b commit e3668c3
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 177 deletions.
13 changes: 5 additions & 8 deletions platform/android/java/lib/src/org/godotengine/godot/GodotIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Point;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
Expand All @@ -55,8 +54,9 @@
import java.util.List;
import java.util.Locale;

// Wrapper for native library

/**
* Provides access to IO related utilities.
*/
public class GodotIO {
private static final String TAG = GodotIO.class.getSimpleName();

Expand Down Expand Up @@ -218,16 +218,13 @@ public int[] getDisplayCutouts() {

public void showKeyboard(String p_existing_text, int p_type, int p_max_input_length, int p_cursor_start, int p_cursor_end) {
if (edit != null) {
edit.showKeyboard(p_existing_text, GodotEditText.VirtualKeyboardType.values()[p_type], p_max_input_length, p_cursor_start, p_cursor_end);
activity.runOnUiThread(() -> edit.showKeyboard(p_existing_text, GodotEditText.VirtualKeyboardType.values()[p_type], p_max_input_length, p_cursor_start, p_cursor_end));
}

//InputMethodManager inputMgr = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
//inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}

public void hideKeyboard() {
if (edit != null)
edit.hideKeyboard();
activity.runOnUiThread(() -> edit.hideKeyboard());
}

public void setScreenOrientation(int p_orientation) {
Expand Down
Loading

0 comments on commit e3668c3

Please sign in to comment.