Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2730] TiUIView touchEnabled is not being honored as camera overlay

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-12-28T06:15:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterHaitham Al-Beik
AssigneePaul Dowsett
Created2011-10-14T16:27:35.000+0000
Updated2016-03-08T07:47:37.000+0000

Description

Problem

When user is editing a photo after taking a picture with the camera, if you have allowEditing set to true you need to have the overlay pass through any touch events to the Camera/Photo editor so the user can "Move & Scale" the image. However, when the touchEnabled property of UIView is set to false on a Camera overlay, the overlay blocks the user from "Move & Scale". We discovered this while upgrading our app to 1.7.3 and support for iOS 5. It worked fine using the same build on iOS 4. I have attached just the code to reproduce the issue. No errors/logs show up on the Console log.

Test case

Ti.UI.setBackgroundColor('#000');

// show camera
var showCamera = function () {
    // create our overlay and box
    var box = Ti.UI.createImageView({
        touchEnabled: false,
        top: 54, width: 320, height: 320,
        borderWidth: 1, borderColor: '#fff', backgroundColor: 'transparent'
    }), overlay = Ti.UI.createView({
        touchEnabled: false, backgroundColor: 'transparent'
    }), transform = Ti.UI.create2DMatrix();
    overlay.add(box);
    // show camera
    Titanium.Media.showCamera({
        overlay             : overlay,
        transform           : transform.scale(1),
        animated            : false,
        autohide            : true,
        showControls        : true,
        allowEditing        : true,
        mediaTypes          : Ti.Media.MEDIA_TYPE_PHOTO,
        success             : function () {},
        cancel              : function () {},
        error               : function () {}
    });
};

// main window
var win = Ti.UI.createWindow(), cameraBtn = Ti.UI.createButton({
    title: 'Camera', top: 20, width: 200, height: 35
});
win.add(cameraBtn);

// events
cameraBtn.addEventListener('click', showCamera);

// open main window
win.open();

Discussions

Q&A: [Camera Overlay touchEnabled has no affect](http://developer.appcelerator.com/question/126722/camera-overlay-touchenabled-has-no-affect)

Comments

  1. Haitham Al-Beik 2011-10-17

    Simpler app.js code to reproduce the issue.
  2. Paul Dowsett 2011-12-28

    Haitham Please note the changes I have made to this ticket to allow it to be escalated. Would you please check the wording to ensure that I have not changed your intended meaning? Would you test this for the latest release 1.8.0.1, to confirm this has not been resolved already? Once you have provided this information, I will escalate it to our engineering team. Cheers
  3. Paul Dowsett 2012-02-17

    Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance
  4. Jerod Fritz 2012-09-13

    I'm having this issue as well with SDK 2.1.2GA . If an overlay is present allowEditing fails to work because click events are not passing through the overlay even with touchEnabled : false just as in the example above.

JSON Source