com.amos.shared

## Class TouchEvent

- java.lang.Object
- - com.amos.shared.TouchEvent

- All Implemented Interfaces:
    java.io.Serializable

      public class TouchEvent
      extends java.lang.Object
      implements java.io.Serializable

  Serializable version of TouchEvents which contain enough information to transfer touch inputs between different devices. Only MotionEvent information relevant to reconstructing usable MotionEvents are sent. X and Y are expected to be normalized to the range between 0 and 1.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `action`
    `long` | `downTime`
    `float` | `x`
    `float` | `y`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TouchEvent(float x, float y, int action, long downTime)` Create Single Touchpoint event.
    `TouchEvent(android.view.MotionEvent m)` Create Single Touchpoint event directly from MotionEvent.
    `TouchEvent(android.view.MotionEvent m, android.graphics.Point screenSize)` Rescale x and y with given screensize before assignment

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `android.view.MotionEvent` | `getConstructedMotionEvent(int maxX, int maxY)` Create MotionEvent from given TouchEvent.
    `java.lang.String` | `toString()` Create String representation of TouchEvent.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### x

          public float x

    - #### y

          public float y

    - #### action

          public int action

    - #### downTime

          public long downTime

  - ### Constructor Detail

    - #### TouchEvent

          public TouchEvent(float x,
                            float y,
                            int action,
                            long downTime)

      Create Single Touchpoint event.
      Parameters:
        `x` -
        `y` -
        `action` -
        `downTime` -

    - #### TouchEvent

          public TouchEvent(android.view.MotionEvent m)

      Create Single Touchpoint event directly from MotionEvent.
      Parameters:
        `m` -

    - #### TouchEvent

          public TouchEvent(android.view.MotionEvent m,
                            android.graphics.Point screenSize)

      Rescale x and y with given screensize before assignment
      Parameters:
        `m` -
        `screenSize` -

  - ### Method Detail

    - #### getConstructedMotionEvent

          public android.view.MotionEvent getConstructedMotionEvent(int maxX,
                                                                    int maxY)

      Create MotionEvent from given TouchEvent.
      Parameters:
        `maxX` -
        `maxY` -
      Returns:

    - #### toString

          public java.lang.String toString()

      Create String representation of TouchEvent.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns: