android: extract landscape and portrait configs from `android_app`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 3 Jan 2015 17:44:41 +0000 (12:44 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 3 Jan 2015 19:45:50 +0000 (14:45 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/android/landscape.nit [new file with mode: 0644]
lib/android/portrait.nit [new file with mode: 0644]
lib/mnit_android/android_app.nit

diff --git a/lib/android/landscape.nit b/lib/android/landscape.nit
new file mode 100644 (file)
index 0000000..a3fceaf
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is part of NIT (http://www.nitlanguage.org).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config to set the landscape orientation
+module landscape is android_manifest_activity """
+               android:screenOrientation="landscape"
+"""
+
+import platform
diff --git a/lib/android/portrait.nit b/lib/android/portrait.nit
new file mode 100644 (file)
index 0000000..e8f5720
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is part of NIT (http://www.nitlanguage.org).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config to set the portrait orientation
+module portrait is android_manifest_activity """
+               android:screenOrientation="portrait"
+"""
+
+import platform
index cbd6085..f8f3139 100644 (file)
 # limitations under the License.
 
 # Impements the services of `mnit:app` using the API from the Android ndk
-module android_app is
-       android_manifest_activity """
+module android_app is android_manifest_activity """
                android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                android:configChanges="orientation|keyboardHidden"
-               android:screenOrientation="portrait""""
-end
+"""
 
 import mnit
 import android