Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24570] Android N: Screen Size/Density breaking change

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-07-17T19:02:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsn/a
ReporterFrankie Merzadyan
AssigneeLokesh Choudhary
Created2017-04-11T17:42:55.000+0000
Updated2017-08-17T01:25:46.000+0000

Description

Android 7.0 enables users to set Display size which magnifies or shrinks all elements on the screen, thereby improving device accessibility for users with low vision. Users cannot zoom the screen past a minimum screen width of sw320dp, which is the width of a Nexus 4, a common medium-sized phone. When the device density changes, the system notifies running apps in the following ways: If an app targets API level 23 or lower, the system automatically kills all its background processes. This means that if a user switches away from such an app to open the Settings screen and changes the Display size setting, the system kills the app in the same manner that it would in a low-memory situation. If the app has any foreground processes, the system notifies those processes of the configuration change as described in Handling Runtime Changes, just as if the device's orientation had changed. If an app targets Android 7.0, all of its processes (foreground and background) are notified of the configuration change as described in Handling Runtime Changes. Most apps do not need to make any changes to support this feature, provided the apps follow Android best practices. Specific things to check for: Test your app on a device with screen width sw320dp and be sure it performs adequately. When the device configuration changes, update any density-dependent cached information, such as cached bitmaps or resources loaded from the network. Check for configuration changes when the app resumes from the paused state. Note: If you cache configuration-dependent data, it's a good idea to include relevant metadata such as the appropriate screen size or pixel density for that data. Saving this metadata allows you to decide whether you need to refresh the cached data after a configuration change. Avoid specifying dimensions with px units, since they do not scale with screen density. Instead, specify dimensions with density-independent pixel (dp) units.

Comments

  1. Frankie Merzadyan 2017-04-17

    master: https://github.com/appcelerator/titanium_mobile/pull/8970 UPDATE: PR includes some code from https://github.com/appcelerator/titanium_mobile/pull/8925 since flag attributes are required to function.
  2. Lokesh Choudhary 2017-07-10

    Failing review as invalid android manifest is generated. More info in the PR.
  3. Lokesh Choudhary 2017-07-17

    FR Passed. PR Merged.
  4. Lokesh Choudhary 2017-08-17

    Verified the fix in SDK 7.0.0.v20170816113226 & 6.2.0.v20170816173122. Closing. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.v20170816173122, 7.0.0.v20170816113226 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.3 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1

JSON Source