Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6812013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:23:53+00:00 2026-05-26T20:23:53+00:00

I noticed that in Android API Level 11 (ICS) MotionEvent has a transform method

  • 0

I noticed that in Android API Level 11 (ICS) MotionEvent has a transform method that takes a Matrix. This would actually make something I’m doing somewhat cleaner, but I’m coding for Level 8.

Is there a convenient alternative to MotionEvent.transform() that works on earlier versions of Android? I’d like historical and multi-touch coordinates to all be transformed, and I’d like it to correctly handle the distinction between relative versus absolute coordinates, which is where things get kind of tricky.

What I really want to know is if can I create a MotionEvent that’s a transformed copy of another MotionEvent. I actually don’t need arbitrary transformations, but I need to be able to both translate and scale. I believe I can translate with offsetLocation, but I don’t see any way to scale a MotionEvent (prior to Level 11). In particular, how can I transform the coordinates of a multi-touch event? The obtain methods just take a single (x,y) pair, not an array.

The reason I want to do this is that I have one object that dispatches events to a set of “child” objects. Right now each of those children transforms the coordinates in a kind of ad hoc way. The parent (the dispatcher) knows what transformation needs to be performed, however, so it would be a lot cleaner to just transform the MotionEvent (or a copy) before dispatching it to the children. Alternatively I could create my own class that either wraps the MotionEvent or copies and transforms the data out of a MotionEvent, but it would be a lot simpler if I could use a MotionEvent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:23:54+00:00Added an answer on May 26, 2026 at 8:23 pm

    As best as I can tell, the answer is “no”. There does not appear to be any way to manipulate the coordinates of any pointerId other than the first one in a MotionEvent in pre-Honeycomb versions of Android.

    The workaround I came up with was to create my own wrapper class (which I happened to call TouchEvent) and use this instead of MotionEvent when delegating onTouch. This wouldn’t work if I was implementing some standard interface, but in my case I controlled the interface of my delegates, so this solution works well enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just noticed that android:password has been deprecated , and we should be using android:inputType.
I noticed that the Android Developers Activity section has been updated since I started
I noticed that my Designer.vb file of one of my forms has a lot
I'm doing some initial research on smart phone development, and I noticed that Android
I have an Android app that has a Content Provider with an SQLiteDatabase implementation.
I've noticed that changing the background color of an android widget ( ex. Button
I've noticed that in some devices without true optical focus control, (Blackberries, Android phones,
I am developing a mobile site and have noticed that on android all the
If you have seen the skype android app, then you may have noticed that
I have developed an Android application that has 1 process and 2 services. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.