Skip to content

Commit e94d1ed

Browse files
committed
Testing: SDL with patches for the new TextInput / TextEditing
1 parent 63e6fb6 commit e94d1ed

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

pythonforandroid/bootstraps/sdl2/build/src/patches/SDLActivity.java.patch

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/libsdl/app/SDLActivity.java
22
+++ b/src/main/java/org/libsdl/app/SDLActivity.java
3-
@@ -225,6 +225,8 @@
3+
@@ -222,6 +222,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
44
// This is what SDL runs in. It invokes SDL_main(), eventually
55
protected static Thread mSDLThread;
66

@@ -9,7 +9,7 @@
99
protected static SDLGenericMotionListener_API12 getMotionListener() {
1010
if (mMotionListener == null) {
1111
if (Build.VERSION.SDK_INT >= 26) {
12-
@@ -323,6 +325,15 @@
12+
@@ -324,6 +326,15 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
1313
Log.v(TAG, "onCreate()");
1414
super.onCreate(savedInstanceState);
1515

@@ -25,7 +25,7 @@
2525
try {
2626
Thread.currentThread().setName("SDLActivity");
2727
} catch (Exception e) {
28-
@@ -824,7 +835,7 @@
28+
@@ -835,7 +846,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
2929
Handler commandHandler = new SDLCommandHandler();
3030

3131
// Send a message from the SDLMain thread
@@ -34,11 +34,11 @@
3434
Message msg = commandHandler.obtainMessage();
3535
msg.arg1 = command;
3636
msg.obj = data;
37-
@@ -1302,6 +1313,20 @@
37+
@@ -1384,6 +1395,20 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
3838
return SDLActivity.mSurface.getNativeSurface();
3939
}
4040

41-
+ /**
41+
+ /**
4242
+ * Calls turnActive() on singleton to keep loading screen active
4343
+ */
4444
+ public static void triggerAppConfirmedActive() {
@@ -55,21 +55,21 @@
5555
// Input
5656

5757
/**
58-
@@ -1795,7 +1820,7 @@
59-
}
58+
@@ -1878,6 +1903,7 @@ class SDLMain implements Runnable {
6059

6160
Log.v("SDL", "Running main function " + function + " from library " + library);
62-
-
61+
6362
+ SDLActivity.mSingleton.appConfirmedActive();
6463
SDLActivity.nativeRunMain(library, function, arguments);
6564

6665
Log.v("SDL", "Finished main function");
67-
@@ -2316,7 +2341,7 @@
66+
@@ -1935,8 +1961,7 @@ class DummyEdit extends View implements View.OnKeyListener {
6867
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
6968
ic = new SDLInputConnection(this, true);
7069

71-
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
72-
+ outAttrs.inputType = SDLActivity.keyboardInputType;
73-
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
74-
| EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
70+
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
71+
- InputType.TYPE_TEXT_FLAG_MULTI_LINE;
72+
+ outAttrs.inputType = SDLActivity.keyboardInputType | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
73+
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
74+
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
7575

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66

77

88
class LibSDL2Recipe(BootstrapNDKRecipe):
9-
version = "2.24.0"
10-
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL2-{version}.tar.gz"
11-
md5sum = 'cf539ffe9e0dd6f943ac9de75fd2e56e'
9+
# version = "2.24.0"
10+
# url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL2-{version}.tar.gz"
11+
# md5sum = 'cf539ffe9e0dd6f943ac9de75fd2e56e'
12+
13+
# This hash refers to a post 2.24.0 commit, which fixes a bug in the Android
14+
# TextInput / IME
15+
url = "https://github.com/libsdl-org/SDL/archive/a905a7869f18332579ff06ba3f7f3777708a3007.zip"
1216

1317
dir_name = 'SDL'
1418

0 commit comments

Comments
 (0)