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

Android: convertPointToView inside a ListView

    Details

    • Type: Bug
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      OSX 10.10.3
      Node.js 0.12.2
      Titanium SDK 3.5.1.GA, 4.0.0.GA, 4.1.0.v20150626223333
      Several Android versions and APIs

      Description

      Hello,

      I'm trying to retrieve the location in the current Window of a click on a button inside a ListView. The converted location using convertPointToView() is unreliable on Android (works fine on iOS) and seems to match the button of the last visible ListItem.

      Here's the snippet I used https://gist.github.com/Velan/f3d75612a611b9a47568

      The output on iOS (and expected output)

      [INFO]  Click  {
      [INFO]      x = 26;
      [INFO]      y = "18.25";
      [INFO]  }
      [INFO]  Button title button 1
      [INFO]  Converted {
      [INFO]      x = "184.5";
      [INFO]      y = "52.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = "44.5";
      [INFO]      y = "19.25";
      [INFO]  }
      [INFO]  Button title button 2
      [INFO]  Converted {
      [INFO]      x = "203.5";
      [INFO]      y = "153.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = "28.5";
      [INFO]      y = "13.25";
      [INFO]  }
      [INFO]  Button title button 3
      [INFO]  Converted {
      [INFO]      x = "187.5";
      [INFO]      y = "247.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = "40.5";
      [INFO]      y = "17.25";
      [INFO]  }
      [INFO]  Button title button 4
      [INFO]  Converted {
      [INFO]      x = "199.5";
      [INFO]      y = "351.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = 28;
      [INFO]      y = "17.75";
      [INFO]  }
      [INFO]  Button title button 5
      [INFO]  Converted {
      [INFO]      x = "186.5";
      [INFO]      y = "452.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = 28;
      [INFO]      y = "15.75";
      [INFO]  }
      [INFO]  Button title button 6
      [INFO]  Converted {
      [INFO]      x = "186.5";
      [INFO]      y = "550.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = "32.5";
      [INFO]      y = "17.75";
      [INFO]  }
      [INFO]  Button title button 7
      [INFO]  Converted {
      [INFO]      x = "191.5";
      [INFO]      y = "652.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = 37;
      [INFO]      y = "11.75";
      [INFO]  }
      [INFO]  Button title button 8
      [INFO]  Converted {
      [INFO]      x = "195.5";
      [INFO]      y = "513.75";
      [INFO]  }
      [INFO]  Click  {
      [INFO]      x = 28;
      [INFO]      y = "12.25";
      [INFO]  }
      [INFO]  Button title button 9
      [INFO]  Converted {
      [INFO]      x = "186.5";
      [INFO]      y = "613.75";
      [INFO]  }
      

      The output on Android

      [INFO]  Click  {"x":31.517547607421875,"y":30.885238647460938}
      [INFO]  Button title
      [INFO]  Converted {"x":371,"y":866}
      [INFO]  Click  {"x":34.513641357421875,"y":21.813430786132812}
      [INFO]  Button title
      [INFO]  Converted {"x":374,"y":857}
      [INFO]  Click  {"x":56.48504638671875,"y":22.733795166015625}
      [INFO]  Button title
      [INFO]  Converted {"x":395,"y":858}
      [INFO]  Click  {"x":53.48895263671875,"y":16.659637451171875}
      [INFO]  Button title
      [INFO]  Converted {"x":392,"y":852}
      [INFO]  Click  {"x":37.509765625,"y":23.5753173828125}
      [INFO]  Button title
      [INFO]  Converted {"x":377,"y":859}
      [INFO]  Click  {"x":50.49285888671875,"y":21.498046875}
      [INFO]  Button title
      [INFO]  Converted {"x":389,"y":856}
      [INFO]  Click  {"x":50.49285888671875,"y":29.4129638671875}
      [INFO]  Button title
      [INFO]  Converted {"x":389,"y":864}
      [INFO]  Click  {"x":50.49285888671875,"y":21.34033203125}
      [INFO]  Button title
      [INFO]  Converted {"x":389,"y":856}
      [INFO]  Click  {"x":50.49285888671875,"y":22.2607421875}
      [INFO]  Button title
      [INFO]  Converted {"x":389,"y":857}
      

      I also can't seem to retrieve the title of the Button on Android.

      Does anybody know any workaround beside using TableViews?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                velan Velan Vijatovic
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20157
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration