[TIMOB-18767] Android: displayCaps.density returns "medium" on "xxxhigh" devices
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-04-14T23:53:15.000+0000 |
Affected Version/s | Release 3.5.1, Release 4.0.0 |
Fix Version/s | Release 4.0.0, Release 4.0.2 |
Components | Android |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Hieu Pham |
Created | 2015-03-30T07:32:37.000+0000 |
Updated | 2015-04-28T23:57:38.000+0000 |
Description
Ti.Platform.displayCaps.density
returns medium
when the device is xxxhigh
because the [code](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/platform/src/java/ti/modules/titanium/platform/DisplayCapsProxy.java#L61-L80) doesn't check for 640
dpi and defaults to medium
.
Perhaps the logic could be made more future proof by defaulting to the highest if the dpi is > then the highest on record?
PR on master: https://github.com/appcelerator/titanium_mobile/pull/6754
Unsure if duplicate or just related.
Yes, indeed TIMOB-18083 is the symptom of this issue.
I have closed the other one as this has the PR and describes the actual problem.
master PR: https://github.com/appcelerator/titanium_mobile/pull/6776
[~hpham] shouldn't 213 return
tv
and 280, 400 and 560 that same number so we follow the mapping of the constants on http://developer.android.com/reference/android/util/DisplayMetrics.html?Ah, now I see. That matches the behaviour I saw in https://university.appcelerator.com/video/o2EhzZhe/Working-with-densityspecific-images where it selected the
high
(indeed notxhigh
) image when I ran Genymotion at 213.Fix a typo for TV density master PR: https://github.com/appcelerator/titanium_mobile/pull/6788
Verified using Mac OSX 10.10.3 Appc Studio: 4.0.0.201504272049 Titanium SDK build: 4.0.0.v20150427093413 Appc CLI (NPM): 0.3.51 Appc CLI (Registry): 0.2.273 Nexus 6 (5.0.1)
Ti.Platform.displayCaps.density
now returns xxxhigh on xxxhigh devices, Closing ticket.