Titanium

[TIMOB-1665] Ti.Platform.displayCaps.density returns bad values on iPhone 2G/3G, iPad

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T22:36:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, apidoc, density, displaycaps, ios, ipad, iphone, patch
ReporterBrion Vibber
AssigneeNolan Wright
Created2011-04-15T02:58:49.000+0000
Updated2017-06-07T22:36:13.000+0000

Description

Ti.Platform.displayCaps.density is documented to return 'low' for iPhone and 'high' for iPad, which it does in fact do... but this seems really wrong, and is inconsistent with the density strings used for Android:

low: circa 120dpi (close to iPad's 132dpi)
medium: circa 160dpi (close to iPhone 2G/3G's 163dpi, which we report as 160dpi)
high: 240dpi (halfway between medium and iPhone 4's 326dpi)

https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.DisplayCaps-object"> https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Pl...

In particular, returning 'high' for both iPad (132dpi) and iPhone 4 (326dpi) seems a bit wrong. :)

Since the value's not reliable, currently we just check the dpi directly for StatusNet Mobile when determining what resolution images to fetch from the network, which requires our patch for #1349 to fix the bogus dpi value on iPhone 4: https://appcelerator.lighthouseapp.com/projects/32238/tickets/1349-titaniumplatformdisplaycapsdpi-returns-wrong-value-on-iphone-4"> https://appcelerator.lighthouseapp.com/projects/32238/tickets/1349-...

Assigning to our support contact.

Comments

  1. Brion Vibber 2011-04-15

    I've whipped up a fix in my work branches:
    http://github.com/brion/titanium_mobile/tree/density">http://github.com/brion/titanium_mobile/tree/density

    iPhone/iPad fix:
    http://github.com/brion/titanium_mobile/commit/4bf669bd37252f4eaaa39053cfe374e1b6ac55da"> http://github.com/brion/titanium_mobile/commit/4bf669bd37252f4eaaa3...

    apidoc fix:
    http://github.com/brion/titanium_mobile/commit/1cc430e566f5a97363a142611a0c0e92ffa77d8c"> http://github.com/brion/titanium_mobile/commit/1cc430e566f5a97363a1...

  2. Lee Morris 2017-06-07 Closing ticket due to the time passed and lack of progress.

JSON Source