{ "id": "118005", "key": "TIMOB-14764", "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": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-05-28T16:05:13.000+0000", "created": "2013-08-06T01:26:53.000+0000", "epic": { "id": 105183, "key": "TIMOB-11818", "name": "Android: Camera Bugs", "summary": "Android: Address deficiencies in the Camera implementation", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "module_media", "qe-closed-3.3.0", "qe-testadded" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "30661", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "118006", "key": "AC-2096", "fields": { "summary": "Android camera preview not full screen width when using overlay", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-07-26T04:55:16.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": "*Problem*\r\nWhen using an overlay with showCamera, the preview (where you see what the camera sees) doesn't stretch to the whole width of the screen. There is a ~5-10dp black bar on the left and right side of the preview screen.\r\n\r\nThe overlay view, however, does takes up the entire width of the screen.\r\n\r\n*Test case*\r\nNotice the red bar will be the entire width of the screen and the preview will stop short on the left and right.\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#FFF\"\r\n});\r\n\r\nvar overlay = Ti.UI.createView({\r\n\tbackgroundColor : \"transparent\",\r\n\theight : Ti.UI.FILL,\r\n\twidth : Ti.UI.FILL\r\n});\r\n\r\noverlay.add(Ti.UI.createView({\r\n\tbackgroundColor : \"red\",\r\n\theight : 20,\r\n\twidth : Ti.UI.FILL\r\n}));\r\n\r\nwin.addEventListener('click', function() {\r\n\tTitanium.Media.showCamera({\r\n\t\toverlay : overlay,\r\n\t\tsaveToPhotoGallery : false,\r\n\t\tallowEditing : false,\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\r\n\t\tshowControls : false,\r\n\t\tautohide : false\r\n\t});\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Camera preview not full screen width when using overlay", "creator": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Application type: mobile\r\nTitanium SDK: 3.2.0.v20130614230533\r\nPlatform & version: Android 4.0.3\r\nDevice: Galaxy Nexus\r\nHost Operating System: Windows 7\r\nTitanium Studio: 3.1.2.201307182008", "comment": { "comments": [ { "id": "265050", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This dupe ticket can be closed, apologies: TC-2697", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T01:53:13.000+0000", "updated": "2013-08-06T01:53:13.000+0000" }, { "id": "265205", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Keeping this one open, closed TC-2697.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T21:27:24.000+0000", "updated": "2013-08-06T21:27:24.000+0000" }, { "id": "275838", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Tested on 3.2.0.v20131018154951 with the following code (front and back camera):\r\n\r\n{code}\r\n/* jshint undef: true, unused: true */\r\n/* global Ti: false */\r\n\r\nTi.UI.backgroundColor = \"#fff\";\r\nvar win = Ti.UI.createWindow({ \r\n title:'Test',\r\n backgroundColor:'#fff',\r\n exitOnClose: true,\r\n orientationModes: [Ti.UI.PORTRAIT]\r\n }),\r\n logLabel = Ti.UI.createLabel({\r\n bottom: \"8dp\", left: \"8dp\", right: \"8dp\", height: \"96dp\",\r\n backgroundColor: \"black\", color: \"white\",\r\n font: {fontSize: \"10sp\"},\r\n verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_TOP\r\n }),\r\n log = function(s, clearFirst) {\r\n var current = logLabel.text;\r\n if (current && !clearFirst) {\r\n current += \"\\n\";\r\n } else {\r\n current = \"\";\r\n }\r\n current += s;\r\n logLabel.text = current;\r\n },\r\n showCamera,\r\n overlay,\r\n takePicture,\r\n switchCamera,\r\n close,\r\n currentCamera = Ti.Media.CAMERA_REAR;\r\n\r\nlogLabel.addEventListener(\"dblclick\", function() {logLabel.text = \"\";});\r\n\r\nwin.add(logLabel);\r\n\r\noverlay = Ti.UI.createView({\r\n width: Ti.UI.FILL,\r\n height: Ti.UI.FILL\r\n});\r\n\r\ntakePicture = Ti.UI.createButton({\r\n title: \"Snap\",\r\n width: Ti.UI.SIZE,\r\n height: \"48dp\",\r\n right: \"16dp\",\r\n bottom: \"16dp\"\r\n});\r\n\r\nswitchCamera = Ti.UI.createButton({\r\n title: \"Switch\",\r\n width: Ti.UI.SIZE,\r\n height: \"48dp\",\r\n right: \"16dp\",\r\n top: \"16dp\"\r\n});\r\n\r\nclose = Ti.UI.createButton({\r\n title: \"Close\",\r\n width: Ti.UI.SIZE,\r\n height: \"48dp\",\r\n left: \"16dp\",\r\n bottom: \"16dp\"\r\n});\r\n\r\noverlay.add(takePicture);\r\noverlay.add(switchCamera);\r\noverlay.add(close);\r\n\r\ntakePicture.addEventListener(\"click\", function() {\r\n Ti.Media.takePicture();\r\n});\r\n\r\nswitchCamera.addEventListener(\"click\", function() {\r\n if (currentCamera === Ti.Media.CAMERA_REAR) {\r\n currentCamera = Ti.Media.CAMERA_FRONT;\r\n } else {\r\n currentCamera = Ti.Media.CAMERA_REAR;\r\n }\r\n Ti.Media.switchCamera(currentCamera);\r\n});\r\n\r\nclose.addEventListener(\"click\", function() {\r\n Ti.Media.hideCamera();\r\n});\r\n\r\nwin.add(showCamera = Ti.UI.createButton({\r\n title: \"Show Camera\",\r\n width: Ti.UI.SIZE\r\n}));\r\n\r\nshowCamera.addEventListener(\"click\", function() {\r\n Ti.Media.showCamera({\r\n cancel: function() {\r\n log(\"Cancelled\");\r\n },\r\n error: function(e){\r\n log(\"Error - \" + e.error);\r\n },\r\n success: function(e) {\r\n log(\"Media type: \" + e.mediaType);\r\n log(\"Media size: \" + e.media.length);\r\n },\r\n saveToPhotoGallery: true,\r\n showControls: false,\r\n overlay: overlay\r\n });\r\n});\r\n\r\nwin.addEventListener(\"open\", function() {\r\n var cameras = Ti.Media.availableCameras,\r\n i=0, camera;\r\n\r\n if (!Ti.Media.isCameraSupported) {\r\n log(\"No supported camera on this device\");\r\n return;\r\n }\r\n\r\n if (!cameras || !cameras.length) {\r\n log(\"No cameras\");\r\n } else {\r\n log(cameras.length + \" cameras available\");\r\n for (; i