Skip to content

Commit

Permalink
activate screenSize configchanges only if api >= 13. closes #148
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Oct 15, 2013
1 parent cee74cf commit 8f4d23a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ def make_package(args):
print 'Invalid --ouya-category argument. should be one of GAME or APP'
sys.exit(-1)

# Get target android API
android_api = int(os.environ.get('ANDROIDAPI', '8'))

# Render the various templates into control files.
render(
'AndroidManifest.tmpl.xml',
Expand All @@ -255,7 +258,7 @@ def make_package(args):
url_scheme=url_scheme,
intent_filters=intent_filters,
manifest_extra=manifest_extra,
)
android_api=android_api)

render(
'Configuration.tmpl.java',
Expand All @@ -277,9 +280,9 @@ def make_package(args):
args=args)

# Update the project to a recent version.
android_api = 'android-%s' % os.environ.get('ANDROIDAPI', '8')
try:
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', android_api])
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
'android-{}'.format(android_api)])
except (OSError, IOError):
print 'An error occured while calling', ANDROID, 'update'
print 'Your PATH must include android tools.'
Expand Down
2 changes: 1 addition & 1 deletion src/templates/AndroidManifest.tmpl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<activity android:name="org.renpy.android.PythonActivity"
android:label="@string/iconName"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode|screenSize"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if android_api >= 13 %}|screenSize{% endif %}"
android:launchMode="singleTask"
android:process=":python"
android:screenOrientation="{{ args.orientation }}"
Expand Down

0 comments on commit 8f4d23a

Please sign in to comment.