Titanium JIRA Archive
Appcelerator Community (AC)

[AC-986] convertPointToView returns null for Views inside of a ListView

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2014-04-17T05:54:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterYoung
AssigneeRitu Agrawal
Created2014-04-13T17:54:59.000+0000
Updated2016-03-08T07:37:18.000+0000

Description

convertPointToView returns wrong result in android when views inside of a ListView. This function working good in IOS but not working in Android.

Comments

  1. Ritu Agrawal 2014-04-14

    Please provide a simple runnable test case to reproduce the issue and we would be happy to investigate further.
  2. Young 2014-04-14

    *Test Code*
       <Alloy>
           <Tab id="scoresTab" title="Scores">
                   <Window id="win" title="Scores" class="container">
                   <ListView id="listView" defaultItemTemplate="headerTemplate" allowsSelection="true">
                       <Templates>
                           <ItemTemplate id="headerTemplate" name="header">
                               <Button platform="android" bindId="scale" id="scaleHeadId" onClick="doClick"></Button>
                           </ItemTemplate>
                       </Templates>
        
                       <ListSection id="headerSection">
                       </ListSection>
                   </ListView>
                   </Window>
           </Tab>
       </Alloy>
       
       
       function doClick(e)
       {
           if (isAndroid)
           {
               var pt = {x: e.x, y: e.y};
               // The next line seems to return null no matter what destination view I choose $.win, $.listView, $.scoresTab
               pt = e.source.convertPointToView(pt, $.win);
               if (pt == null)
                   Titanium.API.info('pt is null');
                       else
                   Titanium.API.info('working');
           }
       }
       
    *Step to reproduce* Create new Alloy Project Update index.xml and index.js file Run on Android Emulator/Device Click on listView Check console its print "pt is null" Expected Result Console will print "working"
  3. Ritu Agrawal 2014-04-14

    Resolving it as a duplicate of TIMOB-15634. Please follow along that ticket for further updates.

JSON Source