Titanium JIRA Archive
Alloy (ALOY)

[ALOY-842] Alloy: Have the measurement builtin use actual pixels for iOS as well

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-08-05T20:41:43.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.3.0, 2013 Sprint 22
ComponentsStyling
Labelsalloy, builtins, measurement, qe-automatedtest
ReporterMostafizur Rahman
AssigneeTony Lukasavage
Created2013-10-03T08:07:16.000+0000
Updated2014-08-05T20:49:07.000+0000

Description

Right now, the measurement builtin converts dp to px and visa versa for Android only. For iOS, the given value is returned as is. This is understandable, since you would typically use the builtin's methods to get the right dimension for Android in it's system default px unit, based on a dp value you use on iOS. But of course this is not really accurate since on retina screens 1dp actually correspondents to 2px. So I'd propose have the builtin take this into account, either as the default or as an option. I prefer to have it as the default. The PR: https://github.com/appcelerator/alloy/pull/249 Related docs: http://docs.appcelerator.com/titanium/latest/#!/guide/Transitioning_to_the_New_UI_Layout_System-section-30088148_TransitioningtotheNewUILayoutSystem-UniversalUnitSupport

Comments

  1. Tony Lukasavage 2013-10-23

    PR: https://github.com/appcelerator/alloy/pull/254 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-842 Functional test should include running the test app on both retina and non-retina ios devices, and ensuring that the runtime tests pass. You should also run it on more than one android device density to ensure that the current tests for it pass as well.
  2. Federico Casali 2013-12-02

    Resolved fixed and working as expected. TiSDK 3.2.0.v20131127194046 CLI 3.2.0-beta Alloy 1.3.0-beta Titanium Studio 3.2.0.201311262027 iPad OS 7 and simulator Android Google Nexus Galaxy 4.3 Closing.

JSON Source