{ "id": "160471", "key": "TIMOB-23430", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-05-31T18:06:03.000+0000", "created": "2016-05-24T17:55:41.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "qe-5.3.0" ], "versions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-31T18:06:03.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "When positioning is not specified for a switch, it should be centered by default. This is the case for Windows 8.1 devices, however not for Windows 10 devices. _(see screenshots)_\r\n\r\n\r\nh3. DEMO CODE:\r\n{code:java}\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Tab 5',\r\n backgroundColor:'green'\r\n});\r\n\r\nvar basicSwitch = Ti.UI.createSwitch({\r\n borderRadius: 5,\r\n borderWidth: 8,\r\n borderColor: 'red', \r\n titleOn:'Notifications Enabled',\r\n titleOff:'Notifications Disabled',\r\n value:true,\r\n width: '80%',\r\n height:120,\r\n top: 200\r\n});\r\nwin.add(basicSwitch);\r\nwin.open();\r\n{code}\r\n\r\nh2. Steps to Reproduce\r\n1. Create a classic mobile project.\r\n2. Include the demo code in the app.js.\r\n3. Build to windows 10 mobile device or emulator.\r\n\r\nh2. Actual Result\r\n\r\nSwitch is positioned to the left, not centered.\r\n\r\nh2. Expected Result\r\n\r\nSwitch should be positioned in center by default.", "attachment": [ { "id": "59425", "filename": "example.JPG", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-27T00:12:39.000+0000", "size": 15050, "mimeType": "image/jpeg" }, { "id": "59400", "filename": "win_10.png", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-24T17:55:39.000+0000", "size": 54702, "mimeType": "image/png" }, { "id": "59401", "filename": "win_8.1.png", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-24T17:55:39.000+0000", "size": 60298, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows 10: Ti.UI.Switch default position is not centered", "creator": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "environment": "Tested on: \r\nWindows 10 Pro \r\nWindows Phone 10.0 (Microsoft Lumia 640 LTE) \r\nAppc Studio: 4.6.0.201605201934\r\nTi SDK: 5.3.0.v20160517124218\r\nAppc NPM: 4.2.5-5\r\nAppc Core: 5.3.0-46\r\nNode: v4.4.4", "comment": { "comments": [ { "id": "386973", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I don't believe this is an issue, the {{Ti.UI.Switch}} is centered to the {{View}} but the component is left aligned (like {{Ti.UI.Label}}). The test case provided sets the {{width}} of the {{Ti.UI.Switch}} to {{80%}}. On Windows 10, due to the UI of the OS; the switch is left aligned with the text, instead of being right aligned like on Windows 8.1.\r\n\r\n*EXAMPLE*\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow({backgroundColor: 'red'}),\r\n toggle = Ti.UI.createSwitch({\r\n backgroundColor: 'orange',\r\n titleOn: 'Enabled', titleOff: 'Disabled',\r\n width: '80%'\r\n });\r\nwin.add(toggle);\r\nwin.open();\r\n{code}\r\n\r\n!example.JPG|thumbnail!", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-27T00:16:50.000+0000", "updated": "2016-05-27T00:16:50.000+0000" }, { "id": "387186", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Closing this ticket as invalid, using [~gmathews]'s test code showed the actual dimensions of the Switch when the width is set, removing the width property correctly centers the element.", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-31T18:05:54.000+0000", "updated": "2016-05-31T18:05:54.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }