Project: titanium
Issue TIMOB-23546: Windows: Tap-to-focus for Camera
When {{overlay}} is specified for {{Ti.Media.showCamera}}, there is no "Tap to Focus" support now, which makes it difficult to focus at shooting. {code} var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }), openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue' }), imageView = Ti.UI.createImageView({ width: Ti.UI.FILL, height: '70%' }); var overlay = Ti.UI.createView({ layout: 'vertical', height: '20%', width: Ti.UI.FILL, bottom: 0 }), takeButton = Ti.UI.createButton({ title: 'TAKE A PHOTO', backgroundColor: 'red' }), hideButton = Ti.UI.createButton({ title: 'HIDE PREVIEW', backgroundColor: 'red' }); takeButton.addEventListener('click', function () { Ti.Media.takePicture(); }); hideButton.addEventListener('click', function () { Ti.Media.hideCamera(); }); overlay.add(takeButton); overlay.add(hideButton); openButton.addEventListener('click', function () { Ti.Media.showCamera({ mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO], overlay: overlay, success: function (e) { Ti.API.info('showCamera() success'); imageView.image = e.media; }, error: function (e) { alert('showCamera() error: ' + JSON.stringify(e)); } }); }); win.add(openButton); win.add(imageView); win.open(); {code}
Story points: 8