Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10354] iOS: Camera overlay rendering issues

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-14T11:15:20.000+0000
Affected Version/sRelease 2.1.0, Release 2.1.1
Fix Version/sSprint 2012-16 API, Release 2.1.2, Release 3.0.0
ComponentsiOS
Labelsapi, qe-port
ReporterNikhil Sharma
AssigneeVishal Duggal
Created2012-08-08T14:42:29.000+0000
Updated2014-04-03T16:42:12.000+0000

Description

There is a problem rendering views on a camera overlay. Please find the image attached.

Repo Steps

1. Run the below code in app.js 2. Tap the "Open Button" and it will open the casmera with custom overlay. 3. First time everything looks good. Tap the close button. 4. Again tap the "Open Button" and now you'll see the icon on the shutter button will be moved above the close button.
/*jslint white:true plusplus:true nomen:true vars:true sloppy:true undef:false*/

var win1 = Titanium.UI.createWindow();

var openCameraButton = Titanium.UI.createButton({
	title : 'Open Camera',
	width : 120,
	height : 40
});

win1.add(openCameraButton);

var overlayView = Ti.UI.createView({
	backgroundColor : 'transparent'
});

var closeButton = Ti.UI.createButton({
	title : 'Close',
	width : 60,
	height : 40,
	bottom : 0,
	left : 0
});

closeButton.addEventListener('click', function() {
	Ti.Media.hideCamera();
});

var shutterButton = Ti.UI.createButton({
	touchEnabled : true,
	width : 100,
	height : 40,
	bottom : 5
});
var shutterButtonIcon = Ti.UI.createImageView({
	image : 'ShutterIcon.png',
	width : 26,
	height : 21
});

shutterButton.add(shutterButtonIcon);
overlayView.add(closeButton);
overlayView.add(shutterButton);

openCameraButton.addEventListener('click', function() {
	Ti.Media.showCamera({
		success : function(event) {
			Ti.API.info('Camera success event received.');
		},
		cancel : function(event) {
			Ti.API.info('Camera cancel event received.', 2);
		},
		error : function(error) {
			Ti.API.info('Camera error event received.', 2);
		},
		overlay : overlayView,
		transform : Ti.UI.create2DMatrix(),
		allowEditing : false,
		saveToPhotoGallery : false,
		mediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,
		showControls : false,
		autohide : false,
		animated : true
	});
});

win1.open();

Attachments

FileDateSize
ShutterIcon.png2012-08-08T14:42:29.000+00003629
ShutterIcon 2.png2012-08-08T16:37:29.000+00003555

Comments

  1. Vishal Duggal 2012-08-09

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2712
  2. Evgenii Tcarev 2012-08-10

    Verified fixed with Titanium Studio, build: 2.1.1.201207271312 Titanium SDK, build: 2.2.0.v20120810080115 Device: iPhone 4s (5.1.1)
  3. Vishal Duggal 2012-08-10

    Reopening to adjust estimates
  4. Vishal Duggal 2012-08-10

    Closing after adjusting estimates
  5. Sabil Rahim 2012-08-14

    Reopening to update Fixversion label to Release 2.1.2

JSON Source