Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18299] iOS: animation does not work as expected when the visibility is set to false

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.5.0
Fix Version/sn/a
ComponentsiOS
LabelsengTriage, qe-3.5.0
ReporterVisalakshi Chidambaram
AssigneeUnknown
Created2015-01-02T05:23:35.000+0000
Updated2019-12-11T21:46:50.000+0000

Description

This is not a regression as it is reproducible with titanium sdk 3.4.1 Visible property of a view, when set to false under animation, is not working as expected. Steps to reproduce: 1. include the following code in app.js and run
     var _window = Ti.UI.createWindow({
        backgroundColor: '#fff'
    });
 
 var view1 = Ti.UI.createView({
        backgroundColor: 'green',
        top: 10,
        opacity: '1',
        width: 100,
        height: 100
    });
    var label1 = Ti.UI.createLabel({
        top: 60,
        text: 'Background text'
    });
    var view2 = Ti.UI.createView({
        backgroundColor: 'green',
        top: 120,
        width: 100,
        height: 100,
        visible: true
    });
    var label2 = Ti.UI.createLabel({
        top: 170,
        text: 'Background text'
    });


    view1.addEventListener('click', function() {
        view1.animate({
            autoreverse: true,
            duration: 2000,
            repeat: 2,
            backgroundColor: 'blue',
            opacity: '0.1',
        });
    });
    view2.addEventListener('click', function() {
        view2.animate({
            autoreverse: true,
            duration: 3000,
            repeat: 2,
            backgroundColor: 'red',
            visible: false
        });
    });

    _window.add(label1);
    _window.add(view1);
    _window.add(label2);
    _window.add(view2);
   _window.open();
2. Click on view2 (bottom green square) 3. Comment "backgroundColor: 'red'," in view2 and repeat step 2. Actual Results: 1. The green square disappears and after some time it appears back again with the color slowly changing from red to green. 2. Nothing happens Expected Results: 1. Since the animation process involves changing the view's visibility to false and with autoreverse true the visibility should be changed back to true. This process should happen twice as the repeat count is set to 2. Hence, when the background color changes from red to green during the first time, it should be seen and not just during the end of the second time as observed in the actual results. 2. The view should become invisible and should appear back again as autoreverse is set to true.

Comments

No comments

JSON Source