Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25582] Windows: Support for dp in ti.ui.defaultunit

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-11-20T01:52:41.000+0000
Affected Version/sRelease 7.0.0
Fix Version/sRelease 8.0.0
ComponentsWindows
Labelsbreaking-change
ReporterKota Iguchi
AssigneeKota Iguchi
Created2017-12-04T04:38:47.000+0000
Updated2018-11-20T11:54:27.000+0000

Description

According to the document, {quote} You can specify the default unit type to use with untyped values. To the tiapp.xml file, you would add value Where value is one of px, mm, cm, in, dp, dip, or system. The "system" value corresponds to the platform-dependent system unit as described above. {quote} Current default units are hard-coded to "px". See also: [Setting default units in tiapp.xml](http://docs.appcelerator.com/platform/latest/#!/guide/Layouts,_Positioning,_and_the_View_Hierarchy-section-src-29004895_safe-id-TGF5b3V0cyxQb3NpdGlvbmluZyxhbmR0aGVWaWV3SGllcmFyY2h5LVNldHRpbmdkZWZhdWx0dW5pdHNpbnRpYXBwLnhtbA)

Comments

  1. Kota Iguchi 2017-12-04

    It turns out TIMOB-19350 should have taken care of this but it was not actually working. I also noticed that the default tiapp.xml that CLI produces with appc new sets dp for default ti.ui.defaultunit, which will cause problem because we have been using px for default unit for Windows. So if you implement this feature, you should see breaking changes regarding view size (px to dp) for most of apps. For instance when you have a view with width: 100, we have treated it as 100px, but because you have ti.ui.defaultunit=dp in default template, it will be treated it as 100dp. I'm not sure how we should treat this without causing breaking change.
  2. Kota Iguchi 2018-10-31

    https://github.com/appcelerator/titanium_mobile_windows/pull/1300
  3. Samir Mohammed 2018-11-19

    FR passed, waiting on Jenkins build.
  4. Kota Iguchi 2018-11-20

    Could someone update customers about this breaking change in 8.0.0? [~aislam] This is adding support for *dp* in *ti.ui.defaultunit*. This means this will introduce breaking change on view sizes because our tiapp.xml default unit has been set to dp but we've been using px implicitly for Windows default unit. So in order to keep consistency between previous versions, you will need to set ~px~ explicitly in tiapp.xml.
  5. Samir Mohammed 2018-11-20

    Closing ticket. Verified fix in SDK version 8.0.0.v20181120013506. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1300

JSON Source