[TIMOB-24793] Android: Ti.UI.View.center is incorrectly calculated
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-06-08T22:10:09.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.1.1 |
Components | Android |
Labels | n/a |
Reporter | Gary Mathews |
Assignee | Joshua Quick |
Created | 2017-06-07T15:23:51.000+0000 |
Updated | 2017-06-15T01:24:44.000+0000 |
Description
- The
center
property of View
is incorrectly calculated, producing invalid positioning.
var window = Ti.UI.createWindow({backgroundColor: 'gray'}),
a = Ti.UI.createView({backgroundColor: 'red', width: 200, height: 200, top: 0, left: 0}),
b = Ti.UI.createView({backgroundColor: 'blue', width: 100, height: 100, center: {x: 150, y: 150}}),
btn_a = Ti.UI.createButton({title: 'TOP LEFT', bottom: 0, left: 0, width: '50%'}),
btn_b = Ti.UI.createButton({title: 'ZERO', bottom: 0, right: 0, width: '50%'});
btn_a.addEventListener('click', function(){
b.center = {x: 50, y: 50};
});
btn_b.addEventListener('click', function(){
b.center = {x: 0, y: 0};
});
window.add([btn_a, btn_b, a, b]);
window.open();
master: https://github.com/appcelerator/titanium_mobile/pull/9125
6_1_X: https://github.com/appcelerator/titanium_mobile/pull/9126
FR passed for master. Waiting for the recent fix to go into the backport PR.
FR passed for backport PR
Verified the fix in SDK 6.2.0.v20170609120851 & 6.1.1.v20170609120621. Used the steps in the PR to test. Closing. Studio Ver: 4.9.0.201705302345 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.2 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1