Skip to content

Commit 8f4d23a

Browse files
committed
activate screenSize configchanges only if api >= 13. closes kivy#148
1 parent cee74cf commit 8f4d23a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/build.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def make_package(args):
246246
print 'Invalid --ouya-category argument. should be one of GAME or APP'
247247
sys.exit(-1)
248248

249+
# Get target android API
250+
android_api = int(os.environ.get('ANDROIDAPI', '8'))
251+
249252
# Render the various templates into control files.
250253
render(
251254
'AndroidManifest.tmpl.xml',
@@ -255,7 +258,7 @@ def make_package(args):
255258
url_scheme=url_scheme,
256259
intent_filters=intent_filters,
257260
manifest_extra=manifest_extra,
258-
)
261+
android_api=android_api)
259262

260263
render(
261264
'Configuration.tmpl.java',
@@ -277,9 +280,9 @@ def make_package(args):
277280
args=args)
278281

279282
# Update the project to a recent version.
280-
android_api = 'android-%s' % os.environ.get('ANDROIDAPI', '8')
281283
try:
282-
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t', android_api])
284+
subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
285+
'android-{}'.format(android_api)])
283286
except (OSError, IOError):
284287
print 'An error occured while calling', ANDROID, 'update'
285288
print 'Your PATH must include android tools.'

src/templates/AndroidManifest.tmpl.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

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

0 commit comments

Comments
 (0)