From 9848dec0fd839e499eb4cc0cbc6daa0bdda28006 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 3 Jan 2015 12:44:41 -0500 Subject: [PATCH] android: extract landscape and portrait configs from `android_app` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/android/landscape.nit | 20 ++++++++++++++++++++ lib/android/portrait.nit | 20 ++++++++++++++++++++ lib/mnit_android/android_app.nit | 6 ++---- 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 lib/android/landscape.nit create mode 100644 lib/android/portrait.nit 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 -- 1.7.9.5