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

Android: UI glitches out when using 'applyProperties' with Scroll View Touch Listeners

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 8.2.0, Release 8.3.0
    • Fix Version/s: Release 9.0.1
    • Component/s: Android
    • Labels:
    • Environment:

      MacOS Catalina 10.15.1 Beta
      Xcode 11
      Node.js 10.16.3
      iPhone 6 Sim(12.4)
      Google Pixel 7.1.1

      {"NPM":"4.2.15-1","CLI":"7.1.1"}

      SDK 8.3.0.v20191030085531
      SDK 8.2.1.GA

    • Story Points:
      5
    • Sprint:
      2020 Sprint 5

      Description

      Application UI glitches out when trying to drag a label horizontally.

      Test case:

      var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
      var scroll = Ti.UI.createScrollView({
          scrollType: 'vertical',
          contentHeight: 3010,
          text: 'Scroll View'
      });
      var width = 150, height = 90;
      for (var i = 0; i < 30; i++) {
          scroll.add(Ti.UI.createLabel({
              draggable: true,
              text: 'Drag Me Horizontally ' + (i + 1), textAlign: 'center',
              color: '#000',
              top: i * 100 + 10,
              width: width, height: height,
              backgroundColor: '#eee'
          }));
      }
      scroll.addEventListener('touchstart', doDrag);
      scroll.addEventListener('touchmove', doDrag);
      scroll.addEventListener('touchcancel', doDrag);
      scroll.addEventListener('touchend', doDrag);
      function doDrag(evt) {
          Ti.API.info('Event Fired On: ' + evt.source.text);
          if (evt.source.draggable) {
              var global = evt.source.convertPointToView({ x: evt.x, y: evt.y }, scroll);
              evt.source.applyProperties({
                  left: global.x - width / 2
              });
          }
      }
      win.add(scroll);
      win.open();
      

      Test Steps

      1. Create a Titanium application
      2. Add the code above in to the ((app.js}}
      3. Run on Android
      4. Try to drag a label horizontally

      Actual result
      Whole application moves and UI glitches out

      Expected result
      Only label should move horizontally

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                smohammed Samir Mohammed
                Reviewer:
                Gary Mathews
                Tester:
                Lokesh Choudhary
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration