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
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.