Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25767] Android: Animated views should retain their initial properties

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-02-13T00:15:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2018-02-09T21:53:44.000+0000
Updated2018-02-14T19:08:04.000+0000

Description

- Animations update the properties of the proxy after a transformation. Out documentation suggests this is not the case (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Animation) {quote}Note that when you animate a view's size or position, the actual layout properties (such as top, left, width, height) are not changed by the animation.{quote} *TEST CASE*
var win = Ti.UI.createWindow();
    view = Ti.UI.createView({
        backgroundColor:'red',
        width: 100, height: 100,
        left: 100,  top: 100
    });

win.addEventListener('open', function () {
    var animation = Ti.UI.createAnimation({
        top: 150,
        duration: 1000
    });

    animation.addEventListener('complete', function () {
        // make sure to give it a time to layout
        setTimeout(function () {
            console.log(X: ${view.rect.x} == 150, TOP: ${view.top} == 100);
        }, 500);
    });

    view.animate(animation);

});
win.add(view);
win.open();

Comments

  1. Gary Mathews 2018-02-09

    master: https://github.com/appcelerator/titanium_mobile/pull/9816
  2. Lokesh Choudhary 2018-02-13

    FR Passed PR Merged.
  3. Lokesh Choudhary 2018-02-14

    Verified the fix with SDK 7.2.0.v20180214090313 & 7.1.0.v20180214082941. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.0.0

JSON Source