{ "id": "165088", "key": "TIMOB-24249", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-12-21T08:57:23.000+0000", "created": "2016-12-21T08:19:53.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "18404", "name": "titanium ${PACKAGE_VERSION}", "archived": false, "released": true, "releaseDate": "2016-10-26" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-01-25T00:01:58.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "If a Ti.UI.iOS.LivePhotoView is instantiated without the livePhoto property set, and later it is set (ie, after an http request) , the view size remains at 0x0 pixels instead of updating.\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\nvar livePhotoView = Ti.UI.iOS.createLivePhotoView();\r\nwindow.add(livePhotoView);\r\nfunction openGallery() {\r\n Ti.Media.openPhotoGallery({\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO],\r\n success: function(e) {\r\n var livePhoto = e.livePhoto // Live photo of type Ti.UI.iOS.LivePhoto\r\n\r\n if (livePhoto) {\r\n \r\n\r\n \r\n livePhotoView.livePhoto = livePhoto;//livePhotoView will remain invisible until some gesture triggers relayout.\r\n livePhotoView.width = Ti.UI.FILL;//this is a workaround to make the view recalculate it's size\r\n }\r\n }\r\n });\r\n}\r\n{code}\r\nThe Titanium Classic example let's you reproduce the issue, allthough it is in Alloy where it becomes more relevant.\r\nAs a workaround you may reset the view width so that the relayout method is invoked on the view proxy.\r\nThe issue can be solved in the native sdk as follows:\r\n\r\n{code:java}\r\n-(void)setLivePhoto_:(id)arg\r\n{\r\n ENSURE_UI_THREAD(setLivePhoto_, arg);\r\n ENSURE_TYPE(arg, TiUIiOSLivePhoto);\r\n \r\n PHLivePhoto *livePhoto = [arg livePhoto];\r\n \r\n autoWidth = livePhoto.size.width;\r\n autoHeight = livePhoto.size.height;\r\n \r\n [[self livePhotoView] setLivePhoto:livePhoto]; \r\n [(TiViewProxy*)self.proxy relayout];\r\n \r\n}\r\n{code}\r\nor overriding and making public the relayout method on TiUIiOSLivePhotoViewProxy.h & TiUIiOSLivePhotoViewProxy.m and doing instead:\r\n\r\n{code:java}\r\n [self.proxy relayout];\r\n{code}", "attachment": [], "flagged": false, "summary": "Ti.UI.iOS.LivePhotoView does not update it's layout when it's livePhoto property is updated", "creator": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": "All LivePhoto supported versions of iOS", "closedSprints": [ { "id": 784, "state": "closed", "name": "2016 Sprint 26 SDK", "startDate": "2016-12-17T01:24:57.928Z", "endDate": "2016-12-31T01:24:00.000Z", "completeDate": "2017-01-03T02:15:01.548Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "403723", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Updated example (I forgot to complete the Ti classic implementation so that you can run it:\r\n\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\nvar livePhotoView = Ti.UI.iOS.createLivePhotoView();\r\nwindow.add(livePhotoView);\r\nvar button = Ti.UI.createButton({title:'import photo', width:Ti.UI.SIZE, height: Ti.UI.SIZE, bottom: '10dp', zIndex:10});\r\nbutton.addEventListener('click',openGallery);\r\nwindow.add(button);\r\nwindow.open();\r\nfunction openGallery() {\r\n Ti.Media.openPhotoGallery({\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO],\r\n success: function(e) {\r\n var livePhoto = e.livePhoto // Live photo of type Ti.UI.iOS.LivePhoto\r\n if (livePhoto) { \r\n livePhotoView.livePhoto = livePhoto;//livePhotoView will remain invisible until some\r\n livePhotoView.width = Ti.UI.FILL;//this is a workaround to make the view recalculate it's size\r\n }\r\n }\r\n });\r\n}\r\n{code}", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-21T08:43:12.000+0000", "updated": "2016-12-21T08:49:55.000+0000" }, { "id": "403724", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Community PR: https://github.com/appcelerator/titanium_mobile/pull/8707", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-21T08:57:13.000+0000", "updated": "2016-12-21T08:57:13.000+0000" }, { "id": "405220", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Can validate this ticket as fixed, this was tested on;\r\niPhone 7\r\nMacOS 10.11.6 (15G31)\r\nStudio 4.8.1.201612050850\r\nTi SDK 6.0.1 GA and 6.1.0.v20170124071525\r\nAppc NPM 4.2.8\r\nAppc CLI 6.1.0\r\nTi CLI 5.0.11\r\nAlloy 1.9.5\r\nArrow 1.10.1\r\nXcode 8.2 (8C38)\r\nNode v4.6.0\r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-01-25T00:01:53.000+0000", "updated": "2017-01-25T00:01:53.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }