Problem Description
convertPointToView returns wrong result in android when views inside of a ListView. This function working good in IOS but not working in Android.
Test Environments
OS: MAC OX X 10.8.5
Alloy 1.2.2
Ti SDK: 3.1.2 GA, 3.1.3 GA
Ti CLI: 3.2.0
Simulator 7.0
Android Emulator with Android SDK 2.3.3
Android Device
Test Code
index.xml
<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>
index.js
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"
Hi Ingo, This issue have been reported for over 6 months now. Any chance of fixing it soon? Thanks.
I am not able to reproduce the issue. Here is the test case I tried
Hi Sunila, Did you run with the test code that was provided by Ingo (above)?
I have try to run the Alloy test code in the bug but it doesn't launch the app properly.
The test code was from Ingo, you may want to check with Ingo?
Sunila & Ingo, what's going on guys? It's outstanding for over *9 months* since we first reported it and still unresolved!!
Issue is not reproducible with the test code provided by [~sunila] . convertPointToView does not return "null". Environment: Appc Studio : 3.3.0.201405271647 Ti SDK : 3.3.0.v20140603152512 Mac OSX : 10.8.5 Alloy : 1.4.0-beta CLI - 3.3.0-beta2 Code Processor: 1.1.1 Nexus 5 - android 4.4.2
We have tried to reproduce this issue three separate times to no avail. If someone can provide a test case that demonstrates the problem, we'd be happy to reopen it.
Closing ticket as the issue cannot be reproduced and due to the above comments.