Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2790] Android Issue - 1.5.x+ - ImageView touchstart / touchmove do not have the globalPoint properties

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2011-08-26T11:56:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterRick Blalock
AssigneeDon Thorp
Created2011-04-15T03:29:39.000+0000
Updated2017-03-10T18:54:50.000+0000

Description

The touchstart / touchmove events do not have the globalPoint properties in the callback like they do in iOS. This is the case for any Ti SDK version 1.5+

Ticket with code sample: http://developer.appcelerator.com/helpdesk/view/63261#c298121">http://developer.appcelerator.com/helpdesk/view/63261#c298121

Comments

  1. Don Thorp 2011-04-15

    Fixing the tags, title, etc. to conform to spec.

  2. Rick Blalock 2011-04-15

    Code sample is in the above referenced URL. http://developer.appcelerator.com/helpdesk/view/63261#c298121">http://developer.appcelerator.com/helpdesk/view/63261#c298121

    Here is the customer's code for convenience. the globalPoint properties of the callback are missing on Android.

       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#fff'
       });
       win.orientationModes = [ Titanium.UI.LANDSCAPE_LEFT ];
       win.orientation = Titanium.UI.LANDSCAPE_LEFT;
       
       function TouchStart(e){
           Ti.API.info('Touchstart fired');
           var curImage = e.source;
       
           curImage.ox = win.width - e.globalPoint.y - curImage.center.x;
           curImage.oy = e.globalPoint.x - curImage.center.y;
       };
       
       function TouchMove(e){
           Ti.API.info('TouchMove fired');
           var curImage = e.source;
           
           curImage.center = {
               x:(win.width - e.globalPoint.y - curImage.ox),
               y:(e.globalPoint.x - curImage.oy)
           };
       
       };
       
       
       var image = Titanium.UI.createImageView({
               image:'http://www.appcelerator.com/wp-content/themes/appcelerator/img/HERO_iPh_social.png', 
               backgroundColor:'transparent', 
               opacity: '0.65',
               canScale: true,
               enableZoomControls:false,
               height:'100',
               width: '100',
               top:10,
               left:10});
             
       
       image.addEventListener('touchstart', TouchStart);
       image.addEventListener('touchmove', TouchMove);
        
       win.add(image);
       win.open({fullscreen:true});
       
  3. Brian 2011-04-15

    This is not just for image views...it happens on regular views as well, which makes this a high not a low

  4. Don Thorp 2011-04-15

    This was a feature added for iOS in #459

  5. Reggie Seagraves 2011-08-26

    globalpoint is being deprecated. Please see linked item for customer solution.
  6. Lee Morris 2017-03-10

    Closing ticket as the issue will not fix.

JSON Source