Project: titanium
Issue TIMOB-19597: Android: Add previewRect (height, width) to camera callback
When custom camera overlay is used add the size of the preview image on Android devices inside the camera callback {code} var self = Ti.UI.createWindow(); var cameraOverlay = Titanium.UI.createView({	backgroundColor: '#FF00FFAA' }); var cameraOverlayButton = Titanium.UI.createImageView({ bottom: 100, image: '/appcelerator_small.png', }); cameraOverlay.add(cameraOverlayButton); cameraOverlay.addEventListener('click', function(e){	Ti.API.info("taking pic"); Ti.Media.takePicture(); }); self.addEventListener("postlayout", postlayoutHandler); function postlayoutHandler(e) { self.removeEventListener("postlayout", postlayoutHandler); Titanium.Media.showCamera({ overlay: cameraOverlay, showControls: false, success: function(e) { Ti.API.info('# SUCCESS : '+ JSON.stringify(e)); }, cancel: function(e) { Ti.API.info('# CANCEL : '+e.error); }, error: function(e) { Ti.API.info('# ERROR : '+ e.code +' : '+ e.error); }, mediaTypes:Ti.Media.MEDIA_TYPE_PHOTO, }); } self.open(); {code} in order to position overlays correctly again. Related ticket: https://jira.appcelerator.org/browse/TC-5105 Solution: http://androblip.huiges.nl/2010/07/25/camera-preview-size-picture-size-and-scaling/
Story points: 5