Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28286

Android: Touch events should fire synchronously

    Details

    • Story Points:
      3

      Description

      Summary:
      The following view events should fire immediately like how it works on iOS...

      • touchstart
      • touchmove
      • touchend
      • touchcancel

      Currently, the above events are fired async on Android, which means they're one frame behind. The issue with this is that it makes it difficult to implement your own drag-and-drop interface because the drag affect looks jumpy/laggy.

      Steps to reproduce:

      1. Build and run the below on Android.
      2. Drag one of the squares onscreen.
      3. Notice the square does not drag smoothly under your finger. (It jumps around your finger.)

      function createDragSquare(top, left, color) {
      	var view = Ti.UI.createView({
      		touchEnabled: true,
      		backgroundColor: color,
      		center: { x: left + 50, y: top + 50 },
      		width: 100,
      		height: 100,
      	});
      	view.addEventListener("touchmove", function(event) {
      		view.center = view.convertPointToView({ x: event.x, y: event.y }, window);
      		event.cancelBubble = true;
      	});
      	return view;
      }
       
      var window = Ti.UI.createWindow({ backgroundColor: "white" });
      window.add(createDragSquare(40, 40, "red"));
      window.add(createDragSquare(120, 120, "green"));
      window.add(createDragSquare(200, 200, "blue"));
      window.open();
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Samir Mohammed
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration