-
25 Dec 2011 7:40 PM #1
Event Dispatcher bug? in android
Event Dispatcher bug? in android
Hi all,
I'm testing touchevent example of Kitchensink in Sencha Touch 2 pr2,
in Android the orientation a.pageX, a.pageY are zero.
but in iphone they are non zero.
Is it a bug? How can I get the touched orientation?
Code:eventDispatcher.addListener('element', '#touchpad', '*', function(a,b,c,d) { var name = d.info.eventName; if (!name.match("mouse") && !name.match("click")) { var logger = Ext.getCmp('logger'), scroller = logger.getScrollable().getScroller(); logger.innerHtmlElement.createChild({ html: d.info.eventName + '[' + a.pageX + ',' + a.pageY + ']' }); setTimeout(function() { scroller.scrollTo(0, scroller.getSize().y - scroller.getContainerSize().y); }, 50); } });
-
26 Dec 2011 8:27 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
Thank you for trying to wrap your code but use the CODE tags not QUOTE.
Can you give me a local test case to run to reproduce?Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
28 Dec 2011 2:07 AM #3
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.0 PR3
- ____
- Mobile Safari 5 (iOS5)
- Mobile Safari 4 (Android 2.3.3, Galaxy TAB )
- ____
- In touchevent example of Kitchensink,
- The coordinates info about 'tap' events weren't obtained on Android device.
- Excute Kitchensink example
- select Touch Event menu
- tap 'Touch Here !' panel
- check event log
- coordnates values of 'touchstart' event in Android.
- coordnates values of 'touchstart' event in Android are [0,0].
- Modify the function 'initialize()' in TouchEvents.js
- In this test, the code colored in red added to 'all-classes.js' file.
Code:eventDispatcher.addListener('element', '#touchpad', '*', function(a,b,c,d) { var name = d.info.eventName; if (!name.match("mouse") && !name.match("click")) { var logger = Ext.getCmp('logger'), scroller = logger.getScrollable().getScroller(); logger.innerHtmlElement.createChild({ html: d.info.eventName + '[' + a.pageX + ',' + a.pageY + ']' }); setTimeout(function() { scroller.scrollTo(0, scroller.getSize().y - scroller.getContainerSize().y); }, 50); } });
HELPFUL INFORMATION
Screenshot or Video:- iPhone
iphone.jpg - Android (Galaxy TAB )
android.jpg
Debugging already done:- none
- not provided
- only default ext-all.css
- custom css (include details)
- ________
- WinXP Pro
-
20 Jan 2012 3:23 PM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
This has been fixed for the next release. As a temporary workaround, you can use a.touch.point.x and a.touch.point.y which will provide you with accurate positions.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1321
in
2.0.


Reply With Quote