@@ -151,12 +151,18 @@ protected void onPostExecute(String result) {
151
151
File path = new File (getIntent ().getData ().getSchemeSpecificPart ());
152
152
153
153
Project p = Project .scanDirectory (path );
154
+ String custom_orientation = this .getExtra ("orientation" );
155
+
154
156
String entry_point = getEntryPoint (p .dir );
155
157
SDLActivity .nativeSetenv ("ANDROID_ENTRYPOINT" , p .dir + "/" + entry_point );
156
158
SDLActivity .nativeSetenv ("ANDROID_ARGUMENT" , p .dir );
157
159
SDLActivity .nativeSetenv ("ANDROID_APP_PATH" , p .dir );
158
160
159
- if (p != null ) {
161
+ if (custom_orientation == "landscape" )
162
+ setRequestedOrientation (ActivityInfo .SCREEN_ORIENTATION_LANDSCAPE );
163
+ else if (custom_orientation == "portrait" )
164
+ setRequestedOrientation (ActivityInfo .SCREEN_ORIENTATION_PORTRAIT );
165
+ else if (p != null ) {
160
166
if (p .landscape ) {
161
167
setRequestedOrientation (ActivityInfo .SCREEN_ORIENTATION_LANDSCAPE );
162
168
} else {
@@ -499,9 +505,15 @@ public String getEntryPoint(String search_dir) {
499
505
* have a compiled version or not.
500
506
*/
501
507
List <String > entryPoints = new ArrayList <String >();
502
- entryPoints .add ("main.pyo" ); // python 2 compiled files
503
- entryPoints .add ("main.pyc" ); // python 3 compiled files
504
- for (String value : entryPoints ) {
508
+ String extra = this .getExtra ("entrypoint" );
509
+ if (extra != "" )
510
+ entryPoints .add (extra ); // custom entrypoint
511
+
512
+ else {
513
+ entryPoints .add ("main.pyo" ); // python 2 compiled files
514
+ entryPoints .add ("main.pyc" ); // python 3 compiled files
515
+ }
516
+ for (String value : entryPoints ) {
505
517
File mainFile = new File (search_dir + "/" + value );
506
518
if (mainFile .exists ()) {
507
519
return value ;
0 commit comments