|
1 | 1 | --- a/src/main/java/org/libsdl/app/SDLActivity.java |
2 | 2 | +++ b/src/main/java/org/libsdl/app/SDLActivity.java |
3 | | -@@ -222,6 +222,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 3 | +@@ -221,6 +221,8 @@ |
| 4 | + |
4 | 5 | // This is what SDL runs in. It invokes SDL_main(), eventually |
5 | 6 | protected static Thread mSDLThread; |
6 | | - |
7 | | -+ public static int keyboardInputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; |
8 | 7 | + |
| 8 | ++ public static int keyboardInputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; |
| 9 | + |
9 | 10 | protected static SDLGenericMotionListener_API12 getMotionListener() { |
10 | 11 | if (mMotionListener == null) { |
11 | | - if (Build.VERSION.SDK_INT >= 26) { |
12 | | -@@ -324,6 +326,15 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 12 | +@@ -323,6 +325,15 @@ |
| 13 | + Log.v(TAG, "Model: " + Build.MODEL); |
13 | 14 | Log.v(TAG, "onCreate()"); |
14 | 15 | super.onCreate(savedInstanceState); |
15 | | - |
| 16 | ++ |
16 | 17 | + SDLActivity.initialize(); |
17 | 18 | + // So we can call stuff from static callbacks |
18 | 19 | + mSingleton = this; |
|
21 | 22 | + // We don't do this in onCreate because we unpack and load the app data on a thread |
22 | 23 | + // and we can't run setup tasks until that thread completes. |
23 | 24 | + protected void finishLoad() { |
24 | | -+ |
| 25 | + |
25 | 26 | try { |
26 | 27 | Thread.currentThread().setName("SDLActivity"); |
27 | | - } catch (Exception e) { |
28 | | -@@ -835,7 +846,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 28 | +@@ -837,7 +848,7 @@ |
29 | 29 | Handler commandHandler = new SDLCommandHandler(); |
30 | 30 |
|
31 | 31 | // Send a message from the SDLMain thread |
|
34 | 34 | Message msg = commandHandler.obtainMessage(); |
35 | 35 | msg.arg1 = command; |
36 | 36 | msg.obj = data; |
37 | | -@@ -1384,6 +1395,20 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh |
| 37 | +@@ -1385,7 +1396,22 @@ |
| 38 | + return null; |
| 39 | + } |
38 | 40 | return SDLActivity.mSurface.getNativeSurface(); |
| 41 | ++ } |
| 42 | ++ |
| 43 | ++ /** |
| 44 | ++ * Calls turnActive() on singleton to keep loading screen active |
| 45 | ++ */ |
| 46 | ++ public static void triggerAppConfirmedActive() { |
| 47 | ++ mSingleton.appConfirmedActive(); |
39 | 48 | } |
40 | | - |
41 | | -+ /** |
42 | | -+ * Calls turnActive() on singleton to keep loading screen active |
43 | | -+ */ |
44 | | -+ public static void triggerAppConfirmedActive() { |
45 | | -+ mSingleton.appConfirmedActive(); |
46 | | -+ } |
| 49 | ++ |
| 50 | ++ /** |
| 51 | ++ * Trick needed for loading screen, overridden by PythonActivity |
| 52 | ++ * to keep loading screen active |
| 53 | ++ */ |
| 54 | ++ public void appConfirmedActive() { |
| 55 | ++ } |
47 | 56 | + |
48 | | -+ /** |
49 | | -+ * Trick needed for loading screen, overridden by PythonActivity |
50 | | -+ * to keep loading screen active |
51 | | -+ */ |
52 | | -+ public void appConfirmedActive() { |
53 | | -+ } |
54 | | -+ |
| 57 | + |
55 | 58 | // Input |
56 | 59 |
|
57 | | - /** |
58 | | -@@ -1878,6 +1903,7 @@ class SDLMain implements Runnable { |
| 60 | +@@ -1881,6 +1907,7 @@ |
59 | 61 |
|
60 | 62 | Log.v("SDL", "Running main function " + function + " from library " + library); |
61 | 63 |
|
62 | 64 | + SDLActivity.mSingleton.appConfirmedActive(); |
63 | 65 | SDLActivity.nativeRunMain(library, function, arguments); |
64 | 66 |
|
65 | 67 | Log.v("SDL", "Finished main function"); |
66 | | -@@ -1935,8 +1961,7 @@ class DummyEdit extends View implements View.OnKeyListener { |
| 68 | +@@ -1938,8 +1965,7 @@ |
67 | 69 | public InputConnection onCreateInputConnection(EditorInfo outAttrs) { |
68 | 70 | ic = new SDLInputConnection(this, true); |
69 | 71 |
|
|
0 commit comments