From: Alexis Laferrière Date: Sat, 3 Jan 2015 17:44:41 +0000 (-0500) Subject: android: extract landscape and portrait configs from `android_app` X-Git-Tag: v0.7.1~54^2~7 X-Git-Url: http://nitlanguage.org android: extract landscape and portrait configs from `android_app` Signed-off-by: Alexis Laferrière --- diff --git a/lib/android/landscape.nit b/lib/android/landscape.nit new file mode 100644 index 0000000..a3fceaf --- /dev/null +++ b/lib/android/landscape.nit @@ -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 index 0000000..e8f5720 --- /dev/null +++ b/lib/android/portrait.nit @@ -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 diff --git a/lib/mnit_android/android_app.nit b/lib/mnit_android/android_app.nit index cbd6085..f8f3139 100644 --- a/lib/mnit_android/android_app.nit +++ b/lib/mnit_android/android_app.nit @@ -15,12 +15,10 @@ # 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