Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17256] Android: Animation: Drag animation lags on Android 4.1.X and above

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsqe-3.3.0, reprod
ReporterSamuel Dowse
AssigneeUnknown
Created2014-07-01T19:27:14.000+0000
Updated2018-02-28T20:04:20.000+0000

Description

Description

Drag animation on a view lags on Android 4.1.X device and above. While view will follow where you move, it will trail behind, occasionally jumping around from one point to another.

Steps To Reproduce

1. Copy the following code into your app.js file 2. Run on device running Android 4.1.X or above 3. Drag the view around the screen
var window = Ti.UI.createWindow({ backgroundColor : "#fff" });
var annoViewPosition;
var view = Ti.UI.createView({
    borderWidth : 1,
    borderColor : "#000000",
    left : 0,
    top : 0,
    height: 100,
    width: 100
});
var lbltop;
var lblleft;
view.addEventListener('touchstart', function(e) {
        annoLblPosition = { top : e.source.top, left : e.source.left };
        pt = view.convertPointToView({ x:e.x, y:e.y }, window);
        lbltop = pt.y;
        lblleft = pt.x;
});
view.addEventListener('touchmove', function(e) {
    pt = view.convertPointToView({ x:e.x, y:e.y }, window);
    annoLblPosition.top += pt.y - lbltop;
    annoLblPosition.left += pt.x - lblleft;
    lbltop = pt.y;
    lblleft = pt.x;
    e.source.animate({
        top : annoLblPosition.top,
        left : annoLblPosition.left,
        duration : 5,
    });
});
window.add(view);
window.open();

Expected Result

View should animate smoothly

Actual Result

View jumps from point

Comments

  1. Lee Morris 2017-07-05

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131 NOTE: The animation disappears from the screen and you have to restart the application to get it back.

JSON Source