com.samsung.android.sdk.penremote

Class SpenEvent

  • All Implemented Interfaces:
    android.os.Parcelable


    public class SpenEvent
    extends Object
    implements android.os.Parcelable
    This class represents a Spen event and holds information such as time-stamp and event data. You can refer to the data by casting this as a ButtonEvent or AirMotionEvent class, depending on the device you are monitoring.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static android.os.Parcelable.Creator<SpenEvent> CREATOR 
      static int TYPE_AIR_MOTION
      S Pen event type constant : Air motion.
      static int TYPE_BUTTON
      S Pen event type constant : Button.
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Constructor and Description
      SpenEvent(int valueSize)
      Create an SpenEvent.
      SpenEvent(android.os.Parcel in) 
    • Field Detail

      • TYPE_BUTTON

        public static final int TYPE_BUTTON
        S Pen event type constant : Button.
        See Also:
        Constant Field Values
      • TYPE_AIR_MOTION

        public static final int TYPE_AIR_MOTION
        S Pen event type constant : Air motion.
        See Also:
        Constant Field Values
      • CREATOR

        public static final android.os.Parcelable.Creator<SpenEvent> CREATOR
    • Constructor Detail

      • SpenEvent

        public SpenEvent(android.os.Parcel in)
      • SpenEvent

        public SpenEvent(int valueSize)
        Create an SpenEvent.
        Parameters:
        valueSize - The length of the array depends on event type is being monitored.
        Since:
        1.0.0
    • Method Detail

      • describeContents

        public int describeContents()
        Specified by:
        describeContents in interface android.os.Parcelable
      • writeToParcel

        public void writeToParcel(android.os.Parcel dest,
                                  int flags)
        Specified by:
        writeToParcel in interface android.os.Parcelable
      • setValue

        public void setValue(int index,
                             float value)
        set event data into the array.
        Parameters:
        index - The data index.
        value - S Pen event data.
        Since:
        1.0.0
      • setTimeStamp

        public void setTimeStamp(long time)
        set time in nanosecond at which the event happened
        Parameters:
        time - in nanosecond
        Since:
        1.0.0
      • getTimeStamp

        public long getTimeStamp()
        returns time in nanosecond at which the event happened.
        Returns:
        time in nanosecond at which the event happened
        Since:
        1.0.0