{ "id": "107665", "key": "TIMOB-12262", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15272", "description": "2013 Sprint 04 API", "name": "2013 Sprint 04 API", "archived": true, "released": true, "releaseDate": "2013-02-25" }, { "id": "14814", "description": "2013 Sprint 04", "name": "2013 Sprint 04", "archived": true, "released": true, "releaseDate": "2013-02-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-02-12T20:06:42.000+0000", "created": "2013-01-10T04:08:46.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_imageview", "qe-review", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-04T21:44:19.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": "h1. Problem description\r\nImageView should support a Photos gallery-like pan and zoom; this means, the image should be centered at first, then should bounce back on all sides when is bigger than the screen.\r\n\r\nFor more information, we are currently using the following code:\r\n\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n maxZoomScale: 4.0,\r\n minZoomScale: 1.0,\r\n zoomScale: 1.0,\r\n});\r\n\r\nvar wrapper = Ti.UI.createView({\r\n width:'100%',\r\n height:'100%',\r\n backgroundColor:'pink'\r\n})\r\nvar imageView = Ti.UI.createImageView({\r\n image: 'http://www.naturewalls.org/wp-content/uploads/2010/06/mirror_lake_in_the_mountains_wallpaper.jpg'\r\n});\r\n\r\nwrapper.add(imageView);\r\nscrollView.add(wrapper);\r\nwin1.add(scrollView);\r\n\r\nwin1.open();\r\n{code}\r\n\r\nThis works fairly well, but when zooming in, the \"borders\" on top and bottom (or left-right if the image is portrait) will not disappear, but will be zoomed as well. Need something that behaves as the native gallery pan and zoom.", "attachment": [], "flagged": false, "summary": "iOS: enable native Photos gallery-like zoomable image", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "iOS 6\r\nSDK 3.0.0", "comment": { "comments": [ { "id": "237562", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This works as expected in Ti SDK 3.0.2 and 3.1.0 from the CI builds:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n maxZoomScale: 3,\r\n contentWidth: 'auto',\r\n contentHeight: 'auto'\r\n});\r\n\r\nvar img = Ti.UI.createImageView({\r\n image: 'photo.jpg',\r\n width:Ti.UI.SIZE,\r\n hight: Ti.UI.SIZE\r\n});\r\n\r\nfunction onImageLoad(e) {\r\n var scaleWidth = win.size.width / img.size.width;\r\n var scaleHeight = win.size.height / img.size.height;\r\n // Set the initial ZoomScale\r\n // And the MinZoomScale\r\n scrollView.zoomScale = scrollView.minZoomScale = Math.min(scaleWidth, scaleHeight);\r\n}\r\n\r\nimg.addEventListener('load', onImageLoad);\r\n\r\nscrollView.add(img);\r\nwin.add(scrollView);\r\nwin.open();\r\n{code}\r\nThis ticket can be closed.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-07T00:28:15.000+0000", "updated": "2013-02-07T00:28:47.000+0000" }, { "id": "237568", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This should work on 3.1.0 CI. Might not work on 3.0.2 CI because of issue reported in TIMOB-11610", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-07T01:04:03.000+0000", "updated": "2013-02-07T01:04:13.000+0000" }, { "id": "237830", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Natively, there is no zooming of an imageview. Native implementations involve putting zooming scroll views (Ti.UI.ScrollView) inside a paging scroll view (Ti.UI.ScrollableView), which is exactly what Pedro's code does.\n\nIf we were to put ALL image views inside scroll views, it would significantly negatively impact performance for all image views. Moving to make this a won't fix, given that the proper code is to implement this in JS and not add bloat to ImageView.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-08T22:16:42.000+0000", "updated": "2013-02-08T22:16:42.000+0000" }, { "id": "238197", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed through JS", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-12T20:06:42.000+0000", "updated": "2013-02-12T20:06:42.000+0000" }, { "id": "240616", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested the fix with:\nTitanium Studio, build: 3.0.2.201302191606\nTitanium SDK, build: 3.1.0.v20130303194855\nDevices:\niPad mini iOS 6.0\niPhone5 iOS 6.1.2\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-04T21:42:52.000+0000", "updated": "2013-03-04T21:42:52.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }