[TIMOB-25582] Windows: Support for dp in ti.ui.defaultunit
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-20T01:52:41.000+0000 |
Affected Version/s | Release 7.0.0 |
Fix Version/s | Release 8.0.0 |
Components | Windows |
Labels | breaking-change |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2017-12-04T04:38:47.000+0000 |
Updated | 2018-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)
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 withappc new
setsdp
for defaultti.ui.defaultunit
, which will cause problem because we have been usingpx
for default unit for Windows. So if you implement this feature, you should see breaking changes regarding view size (px
todp
) for most of apps. For instance when you have a view withwidth: 100
, we have treated it as100px
, but because you haveti.ui.defaultunit=dp
in default template, it will be treated it as100dp
. I'm not sure how we should treat this without causing breaking change.https://github.com/appcelerator/titanium_mobile_windows/pull/1300
FR passed, waiting on Jenkins build.
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 ~
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