[TIMOB-27461] Android:Extra padding if enableZoomControl is true for imageView on 8.2.0.GA
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2019-11-01T18:12:51.000+0000 |
Affected Version/s | Release 8.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | ACF |
Reporter | Rakhi Mitro |
Assignee | Unknown |
Created | 2019-10-10T10:09:48.000+0000 |
Updated | 2019-11-01T18:12:51.000+0000 |
Description
The customer has a requirement where they need to display an image inside a scrollview and provide zoom controls for that image. But they are able to see the extra spacing at top and bottom of the image. If the "enableZoomControls" is set to false, image displayed properly without any extra spaces. Currently they are using 8.0.2.GA SDK.
Note: We tested the issue on 8.2.0.GA, Huawei Gr3 2017(Android 7) and the issue is reproduced on our end.
*Test steps:*
* Create a classic project
* Download the image file and paste it on resources
* Paste the sample code to app.js
* Run the project on device. After running, we are able to see the extra spacing at top and bottom of the image.
*Test Code:*
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout : 'vertical'
});
var scrollView = Ti.UI.createScrollView({
layout : 'vertical',
width : Ti.UI.FILL,
contentWidth : '100%',
height : Ti.UI.FILL
});
var imageViewContainer = Ti.UI.createView({
height : Ti.UI.SIZE,
width : Ti.UI.SIZE,
});
var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'test.png');
imageViewContainer.add(Ti.UI.createImageView({
image : file,
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
enableZoomControls : true,
borderColor:'red'
}));
scrollView.add(imageViewContainer);
win.add(scrollView);
win.open();
*Test Output:*
"enableZoomControls" is true:
!Screenshot_20191010-155604.png|thumbnail!
"enableZoomControls" is false:
!Screenshot_20191010-155205.png|thumbnail!
Attachments
File | Date | Size |
---|---|---|
after_scroll_nexus.png | 2019-10-10T10:25:26.000+0000 | 261493 |
after_scroll_pixel.png | 2019-10-10T10:27:53.000+0000 | 207418 |
before_scroll_nexus (1).png | 2019-10-10T10:26:53.000+0000 | 255145 |
before_scroll_pixel.png | 2019-10-10T10:26:05.000+0000 | 725807 |
Screenshot_20191010-155205.png | 2019-10-10T10:10:58.000+0000 | 227835 |
Screenshot_20191010-155604.png | 2019-10-10T10:10:45.000+0000 | 232119 |
test.png | 2019-10-11T04:17:29.000+0000 | 313098 |
I think they are after pinch zoom and the ability to scroll both horizontally and vertically, correct? Unfortunately, Titanium's
ScrollView
does not support this on Android, because it's not supported natively on Google's end. It requires a custom view. That said, there is a 3rd party module which does support this. See the module below. The Titanium community frequently uses this. But I do believe you have to build the module yourself. https://github.com/iotashan/TiTouchImageView[~jnaher] Please update us with the customer feedback, if they were indeed after pinch zoom and the ability to scroll both horizontally and vertically.
Hello, The customer is informed about the updates. Waiting for his feedback.
Closing per dev comments and removal of the code from the customer.