{ "id": "137103", "key": "TIMOB-17792", "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": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-06-13T22:11:04.000+0000", "created": "2014-09-24T08:31:44.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupportTriage" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [], "assignee": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-26T17:52:10.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nshowTimePickerDialog doesn't work if you don't add the picker before to the window.\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project\r\n2. Add this testcase to app.js: \r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n exitOnClose: true\r\n});\r\n \r\nvar picker = Ti.UI.createPicker({\r\n type: Ti.UI.PICKER_TYPE_TIME\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title : 'Show time picker dialog'\r\n});\r\n\r\nwin.add( btn );\r\nwin.open( );\r\n\r\nbtn.addEventListener( 'singletap', function( ) {\r\n picker.showTimePickerDialog({\r\n callback: function( e ) {\r\n if ( e.cancel ) {\r\n Ti.API.info( 'User canceled dialog' );\r\n } else {\r\n Ti.API.info( 'User selected time: ' + e.value );\r\n }\r\n }\r\n });\r\n});\r\n{code}\r\n\r\nConsole output message:\r\n{code}\r\n[WARN] HardwareRenderer: Attempting to initialize hardware acceleration outside of the main thread, aborting\r\n{code}\r\n3. Run it in device. \r\n4. Click on show the picker. \r\n\r\nh4. Workaround\r\nSet the left element to -1000 (or any negative number outside of the screen, and add the picker to the window.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n exitOnClose : true,\r\n layout : 'vertical'\r\n});\r\n \r\nvar picker = Ti.UI.createPicker({\r\n type : Titanium.UI.PICKER_TYPE_TIME,\r\n top : 10,\r\n left:-1000,\r\n});\r\n \r\nwin.add(picker);\r\n \r\nvar btn = Ti.UI.createButton({\r\n title : 'Show time picker dialog',\r\n top : 10\r\n});\r\n \r\nwin.add(btn);\r\n//win.add(picker);\r\nwin.open();\r\n \r\nbtn.addEventListener('singletap', function() {\r\n picker.showTimePickerDialog({\r\n callback : function(e) {\r\n if (e.cancel) {\r\n Ti.API.info('User canceled dialog');\r\n } else {\r\n Ti.API.info('User selected time: ' + e.value);\r\n }\r\n }\r\n });\r\n \r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: showTimePickerDialog does appear if you didn't added the picker before.", "creator": { "name": "joseandro", "key": "joseandro", "displayName": "Joseandro Luiz", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "joseandro", "key": "joseandro", "displayName": "Joseandro Luiz", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": "MacOSX: OSX Mavericks, \r\nMobile SDK: 3.4.0 (Beta), 3.3.0.GA\r\nAndroid: Genymotion Android 4.3 emulator \r\nDevices: LG G2 device, Nexus 5 Android 4.4.2", "comment": { "comments": [ { "id": "325885", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "h4. Workaround\r\n\r\nSet the left element of your picker to -1000, and add it to the window. Check this code: \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n exitOnClose : true,\r\n layout : 'vertical'\r\n});\r\n \r\nvar picker = Ti.UI.createPicker({\r\n type : Titanium.UI.PICKER_TYPE_TIME,\r\n top : 10,\r\n left:-1000,\r\n});\r\n \r\nwin.add(picker);\r\n\r\nvar btn = Ti.UI.createButton({\r\n title : 'Show time picker dialog',\r\n top : 10\r\n});\r\n \r\nwin.add(btn);\r\n//win.add(picker);\r\nwin.open();\r\n \r\nbtn.addEventListener('singletap', function() {\r\n picker.showTimePickerDialog({\r\n callback : function(e) {\r\n if (e.cancel) {\r\n Ti.API.info('User canceled dialog');\r\n } else {\r\n Ti.API.info('User selected time: ' + e.value);\r\n }\r\n }\r\n });\r\n \r\n});\r\n\r\n{code}\r\n\r\n", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-09-26T18:42:16.000+0000", "updated": "2014-09-26T18:42:16.000+0000" }, { "id": "417269", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8957", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2017-04-12T14:25:24.000+0000", "updated": "2017-04-12T14:25:24.000+0000" }, { "id": "422748", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix in SDK Version: 6.2.0.v20170626084207. Test and other information can be found at:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/8957", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-26T17:51:56.000+0000", "updated": "2017-06-26T17:51:56.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }