Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5900] iOS5: Closing camera or gallery closes modal

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-11-22T11:17:56.000+0000
Affected Version/sRelease 1.7.3
Fix Version/sRelease 1.8.0, Release 1.7.6, Release 1.8.0.1
ComponentsiOS
Labelsmodule_media, qe-testadded
ReporterAlan Leard
AssigneeBlain Hamon
Created2011-10-28T12:50:08.000+0000
Updated2014-06-19T12:43:19.000+0000

Description

If you open the camera or a photo gallery from a modal window, when you close this window, titanium also closes the modal window. This does not happen on iOS4. To reproduce, load app on device, click 'Launch Modal", then click "Camera", take a picture and click "Use". Image should appear on the screen under the "Camera" button on the "Modal" window. This works on iOS 4 devices.
var win1 = Ti.UI.createWindow(
{
    title: "window 1"
});

var button1 = Titanium.UI.createButton(
{
    color: '#999',
    title: 'Launch Modal',
    width: '200dp',
    height: '60dp'
});

win1.add(button1);

button1.addEventListener("click", function()
{
    modal = Ti.UI.createWindow(
    {
        modal: true,
        title: "modal"
    });

    var cameraButton = Ti.UI.createButton(
    {
        title: "camera",
        top: "50dp",
        width: "150dp",
        height: "60dp"
    });
    modal.add(cameraButton);
    imageViewResize = Ti.UI.createImageView(
    {
        top: "200dp",
        height: "200dp",
        width: "200dp"
    });
    modal.add(imageViewResize);

    cameraButton.addEventListener("click", function()
    {
        Titanium.Media.showCamera(
        {
            success: function(event)
            {
                imageViewResize.image = event.media;
            },

            error: function()
            {
            },

            cancel: function()
            {
            },

            saveToPhotoGallery: true,
            allowEditing: true,
            mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
            showControls: true
        });
    });
    modal.open();
});

win1.open();

Comments

  1. Blain Hamon 2011-11-09

    Pull request #657 pending.
  2. Blain Hamon 2011-11-09

    Come 'n get it. http://builds.appcelerator.com.s3.amazonaws.com/index.html Reresolving as it's in place now.
  3. Natalie Huynh 2011-11-17

    Pass: Tested with 1.8.0.1.v20111116185058 on iPad 2 4.3.5 iPod Touch 4.02 iPhone 4s 5.0

JSON Source