{ "id": "117853", "key": "TIMOB-14732", "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": "15699", "description": "2013 Sprint 21", "name": "2013 Sprint 21", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "15700", "description": "2013 Sprint 21 API", "name": "2013 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-10-10T19:50:46.000+0000", "created": "2013-08-01T00:27:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_scrollView", "parity", "qe-3.1.2", "qe-testadded" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-04-21T10:10:09.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": "h5. Problem description\r\n\r\nimageViews in a scrollView are not correctly resized on Android devices\r\n\r\nh5. Sample code\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\ttitle:'test',\r\n\tbackgroundColor:'black'\r\n});\r\n\r\nvar image = Ti.UI.createImageView({\r\n\timage:'apoc.jpg',\r\n\ttop:5,\r\n\twidth:'95%'\r\n});\r\n\r\nvar scrollview = Ti.UI.createScrollView();\r\n\r\nscrollview.add(image);\r\nwin.add(scrollview);\r\n\r\nwin.open();\r\n{code}\r\n\r\n(apoc.jpg attached to the project).\r\n\r\nh5. Steps to reproduce\r\nRun the sample code using the attached image (image is bigger than the screen)\r\nResult: on Android device the 95% value for the width is respected, but the image is cropped instead of being correctly resized (as is correctly displayed on iOS).\r\n\r\nIf the image is added to a normal view, is displayed correctly.\r\n\r\nSame behavior is reproducible on 3.1.1 GA and 3.1.0 GA, so is not a regression.", "attachment": [ { "id": "41204", "filename": "apoc.jpg", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-01T00:29:07.000+0000", "size": 561621, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "Android: imageView inside a scrollView is not correctly resized", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.2.v20130730133101\r\nAlloy 1.2.0-alpha\r\nAppcelerator Studio 3.1.2.201307261628\r\nCLI 3.1.2\r\nNode 0.8.22", "comment": { "comments": [ { "id": "273591", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Looks like the code was introduced as part of TIMOB-10358 but there was no mention of why this code was introduced. The tests in TIMOB-10358 also runs fine with this change.\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4753", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-02T12:01:05.000+0000", "updated": "2013-10-02T12:01:05.000+0000" }, { "id": "273685", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The scaling is disabled if the image view is in a scrollview. The scrollview can extend beyond the screen size, so the image view can extend beyond the screen size. Therefore if the image is larger than the screen size, we don't want to scale it to fit inside the screen. The above PR will introduce a regression. Run the test case attached below and see the regression introduced by this PR:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n title:'test',\r\n backgroundColor:'black'\r\n});\r\n \r\nvar image = Ti.UI.createImageView({\r\n image:'apoc.jpg',\r\n top:5\r\n});\r\n \r\nvar scrollview = Ti.UI.createScrollView();\r\n \r\nscrollview.add(image);\r\nwin.add(scrollview);\r\n \r\nwin.open();\r\n\r\n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T22:10:36.000+0000", "updated": "2013-10-02T22:12:45.000+0000" }, { "id": "273926", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Updated the pull request with changes to address the scrollview issue", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-05T08:13:29.000+0000", "updated": "2013-10-05T08:13:29.000+0000" }, { "id": "276210", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix. The image is resized as expected.\r\nThus closing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.2.0.201310221639\r\nTi SDK : 3.2.0.v20131022050844\r\nDevice: Samsung Galaxy S4 running android 4.2.2\r\nCLI - 3.2.0 with hash 72f7426b4ee6c2d2883c666d5b7e03906a16012f", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-22T19:52:24.000+0000", "updated": "2013-10-22T19:52:24.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }