Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for #1575: huge icons when launching iPhone app on iPad in 2x zoom #2

Closed

Conversation

bvibber
Copy link
Contributor

@bvibber bvibber commented Sep 2, 2010

https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile/tickets/1575-ipad-restarting-a-iphone-published-app-on-ipad-after-using-2x-mode-app-uses-incorrect-icons#ticket-1575-4

The problem here seems to be that the UIScreen reports a scale factor of 2.0 when running on iPad at 2x mode, so [TiUtils isRetinaDisplay] gives a false positive and [TiUtils checkFor2XImage:] pulls the @2x images.

When checking the scale, this patch double-checks if we're on an iPad but with a UI_USER_INTERFACE_IDIOM() for iPhone mode; if so, then we pretend we're on 1x scale instead of checking the reported value.

In native iPad mode we'll still check the scale, so it should still support automatic use of @2x images on a hypothetical future iPad with a double-density display.

… iPhone compatibility mode in 2x zoom

UIScreen's scale property (used to check if we're running on a device with high-res Retina Display) appears as an undocumented surprise on iPads running 3.2; in 2x zoom mode it returns a scale factor of 2.0, which caused false positives because we thought we were running on a high-res display, but couldn't then rescale the @2x images to the proper logical display size.

[TiUtils isRetinaDisplay] now checks if we're running on an iPad but in phone mode, and if so hardcodes the scale back to 1.0. I _think_ this will naturally fall through to correct behavior if a future iPad comes out with a double-density display, as it'll report being in Pad mode on a native iPad app and so go ahead and ask for the scale.
@WhichKatieDid
Copy link
Contributor

I had to make a change in case future versions change their name slightly. Still, good solution.

pingwang2011 pushed a commit to pingwang2011/titanium_mobile that referenced this pull request Jan 10, 2012
TIMOB-6429 - Remove all pre-1.8 deprecated APIs and platform specific namespaces
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Feb 10, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Feb 28, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Mar 28, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request May 4, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request May 9, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Jul 26, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Jul 27, 2012
hieupham007 added a commit to hieupham007/Titanium_Mobile that referenced this pull request Feb 18, 2013
pec1985 added a commit to pec1985/titanium_mobile that referenced this pull request Jul 31, 2013
pec1985 added a commit to pec1985/titanium_mobile that referenced this pull request Aug 2, 2013
hieupham007 added a commit that referenced this pull request Sep 25, 2014
hieupham007 added a commit that referenced this pull request Sep 25, 2014
jquick-axway referenced this pull request in jquick-axway/titanium_mobile Nov 15, 2017
[TIMOB-24963] Add iOS-parity, update docs
jawa9000 pushed a commit that referenced this pull request Jul 17, 2018
ssjsamir pushed a commit that referenced this pull request Sep 4, 2019
* refactor: fix all warnings (except deprecations for now)

* refactor: update Swift test module to Swift 5

* refactor: update Swift test module to Swift 5 #2

* refactor: update Swift module template to Swift 5

* fix: properly lint hooks, restore app.js

* fix: fix eslint warnings

* fix: fix eslint

* fix linting issue

* remove duplicate 'use strict' directive

* remove duplicate hasProperty method declaration

* fix: address couple more warnings
@janvennemann janvennemann mentioned this pull request Jun 6, 2020
4 tasks
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants