Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27461] Android:Extra padding if enableZoomControl is true for imageView on 8.2.0.GA

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionWon't Do
Resolution Date2019-11-01T18:12:51.000+0000
Affected Version/sRelease 8.2.0
Fix Version/sn/a
ComponentsAndroid
LabelsACF
ReporterRakhi Mitro
AssigneeUnknown
Created2019-10-10T10:09:48.000+0000
Updated2019-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

FileDateSize
after_scroll_nexus.png2019-10-10T10:25:26.000+0000261493
after_scroll_pixel.png2019-10-10T10:27:53.000+0000207418
before_scroll_nexus (1).png2019-10-10T10:26:53.000+0000255145
before_scroll_pixel.png2019-10-10T10:26:05.000+0000725807
Screenshot_20191010-155205.png2019-10-10T10:10:58.000+0000227835
Screenshot_20191010-155604.png2019-10-10T10:10:45.000+0000232119
test.png2019-10-11T04:17:29.000+0000313098

Comments

  1. Joshua Quick 2019-10-10

    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
  2. Alan Hutton 2019-10-11

    [~jnaher] Please update us with the customer feedback, if they were indeed after pinch zoom and the ability to scroll both horizontally and vertically.
  3. Rakhi Mitro 2019-10-18

    Hello, The customer is informed about the updates. Waiting for his feedback.
  4. Alan Hutton 2019-11-01

    Closing per dev comments and removal of the code from the customer.

JSON Source