{ "id": "147354", "key": "TIMOB-19433", "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": null, "resolutiondate": null, "created": "2015-04-28T21:29:19.000+0000", "priority": null, "labels": [ "Android", "Switch" ], "versions": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:17.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Using the sample code on [Titanium.UI.Switch|http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Switch], setting the titleOn and titleOff has no effect on Android 5, meaning that the text is not displayed. The switch control itself displays fine.\r\n\r\n!Screen Shot 2015-04-28 at 5.28.37 PM.png|thumbnail!\r\n\r\nHere is the code:\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar basicSwitch = Ti.UI.createSwitch({\r\n titleOn:'Notifications Enabled',\r\n titleOff:'Notifications Disabled',\r\n value:true,\r\n width: 200, height:120\r\n});\r\nwin.add(basicSwitch);\r\n\r\nbasicSwitch.addEventListener('change',function(e){\r\n Ti.API.info('Switch value: ' + basicSwitch.value);\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "55147", "filename": "Screen Shot 2015-04-28 at 5.28.37 PM.png", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2015-04-28T21:29:01.000+0000", "size": 55424, "mimeType": "image/png" }, { "id": "55164", "filename": "Screen Shot Ti SDK4.0.0 RC.png", "author": { "name": "hmrida", "key": "hmrida", "displayName": "Harish Mridha", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2015-04-29T04:40:42.000+0000", "size": 50299, "mimeType": "image/png" }, { "id": "55163", "filename": "SDK 3.5.1 GA.png", "author": { "name": "hmrida", "key": "hmrida", "displayName": "Harish Mridha", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2015-04-29T04:40:42.000+0000", "size": 41749, "mimeType": "image/png" }, { "id": "55162", "filename": "SDK 3.5.2 GA.png", "author": { "name": "hmrida", "key": "hmrida", "displayName": "Harish Mridha", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2015-04-29T04:40:42.000+0000", "size": 42389, "mimeType": "image/png" } ], "flagged": false, "summary": "Android 5 - Switch titleOn and titleOff are not displayed", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Android 5\r\nTi SDK 4.1.0.v20150427212043", "comment": { "comments": [ { "id": "364955", "author": { "name": "tokmakoff", "key": "tokmakoff", "displayName": "Andrew Tokmakoff", "active": true, "timeZone": "Australia/Adelaide" }, "body": "It seems that the default switch style under Android prior to release 4.0 was TOGGLEBUTTON and it is now SWITCH. \r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch-property-style\r\n\r\nAdding an explicit style attribute fixed the issue for me.\r\nstyle: Ti.UI.Android.SWITCH_STYLE_TOGGLEBUTTON \r\n\r\n", "updateAuthor": { "name": "tokmakoff", "key": "tokmakoff", "displayName": "Andrew Tokmakoff", "active": true, "timeZone": "Australia/Adelaide" }, "created": "2015-09-25T02:57:55.000+0000", "updated": "2015-09-25T02:57:55.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }