|
1 | 1 | --- a/src/main/java/org/libsdl/app/SDLActivity.java |
2 | 2 | +++ b/src/main/java/org/libsdl/app/SDLActivity.java |
3 | | -@@ -196,6 +196,15 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 3 | +@@ -94,6 +94,8 @@ |
| 4 | + // This is what SDL runs in. It invokes SDL_main(), eventually |
| 5 | + protected static Thread mSDLThread; |
| 6 | + |
| 7 | ++ public static int keyboardInputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; |
| 8 | ++ |
| 9 | + protected static SDLGenericMotionListener_API12 getMotionListener() { |
| 10 | + if (mMotionListener == null) { |
| 11 | + if (Build.VERSION.SDK_INT >= 26) { |
| 12 | +@@ -196,6 +198,15 @@ |
4 | 13 | Log.v(TAG, "onCreate()"); |
5 | 14 | super.onCreate(savedInstanceState); |
6 | | - |
| 15 | + |
7 | 16 | + SDLActivity.initialize(); |
8 | 17 | + // So we can call stuff from static callbacks |
9 | 18 | + mSingleton = this; |
|
16 | 25 | // Load shared libraries |
17 | 26 | String errorMsgBrokenLib = ""; |
18 | 27 | try { |
19 | | -@@ -639,7 +648,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 28 | +@@ -639,7 +650,7 @@ |
20 | 29 | Handler commandHandler = new SDLCommandHandler(); |
21 | | - |
| 30 | + |
22 | 31 | // Send a message from the SDLMain thread |
23 | 32 | - boolean sendCommand(int command, Object data) { |
24 | 33 | + protected boolean sendCommand(int command, Object data) { |
25 | 34 | Message msg = commandHandler.obtainMessage(); |
26 | 35 | msg.arg1 = command; |
27 | 36 | msg.obj = data; |
28 | | -@@ -1051,6 +1061,21 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 37 | +@@ -1051,6 +1062,21 @@ |
29 | 38 | return Arrays.copyOf(filtered, used); |
30 | 39 | } |
31 | | - |
| 40 | + |
32 | 41 | + /** |
33 | 42 | + * Calls turnActive() on singleton to keep loading screen active |
34 | 43 | + */ |
|
45 | 54 | + |
46 | 55 | + |
47 | 56 | // APK expansion files support |
48 | | - |
| 57 | + |
49 | 58 | /** com.android.vending.expansion.zipfile.ZipResourceFile object or null. */ |
50 | | -@@ -1341,14 +1366,13 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 59 | +@@ -1341,14 +1367,13 @@ |
51 | 60 | }; |
52 | | - |
| 61 | + |
53 | 62 | public void onSystemUiVisibilityChange(int visibility) { |
54 | 63 | - if (SDLActivity.mFullscreenModeActive && (visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 || (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) { |
55 | 64 | - |
|
62 | 71 | } |
63 | 72 | - |
64 | 73 | } |
65 | | - } |
66 | | - |
67 | | -@@ -1475,6 +1499,7 @@ class SDLMain implements Runnable { |
| 74 | + } |
| 75 | + |
| 76 | +@@ -1475,6 +1500,7 @@ |
68 | 77 | String[] arguments = SDLActivity.mSingleton.getArguments(); |
69 | | - |
| 78 | + |
70 | 79 | Log.v("SDL", "Running main function " + function + " from library " + library); |
71 | 80 | + SDLActivity.mSingleton.appConfirmedActive(); |
72 | 81 | SDLActivity.nativeRunMain(library, function, arguments); |
73 | | - |
| 82 | + |
74 | 83 | Log.v("SDL", "Finished main function"); |
| 84 | +@@ -2002,7 +2028,7 @@ |
| 85 | + public InputConnection onCreateInputConnection(EditorInfo outAttrs) { |
| 86 | + ic = new SDLInputConnection(this, true); |
| 87 | + |
| 88 | +- outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; |
| 89 | ++ outAttrs.inputType = SDLActivity.keyboardInputType; |
| 90 | + outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
| 91 | + | EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */; |
0 commit comments