public class TouchEventCoalescingKeyHelper
extends java.lang.Object
MotionEvent.getDownTime()
which will
stay constant for a given set of related touches on a single view.
NB: even though down time is a long, we cast as an int using the least significant bits as the
identifier. In practice, we will not be coalescing over a time range where the most significant
bits of that time range matter. This would require a gesture that lasts Integer.MAX_VALUE * 2 ms,
or ~48 days.
NB: we assume two gestures cannot begin at the same time.
NB: this class should only be used from the UI thread.Constructor and Description |
---|
TouchEventCoalescingKeyHelper() |
Modifier and Type | Method and Description |
---|---|
void |
addCoalescingKey(long downTime)
Starts tracking a new coalescing key corresponding to the gesture with this down time.
|
short |
getCoalescingKey(long downTime)
Gets the coalescing key corresponding to the gesture with this down time.
|
boolean |
hasCoalescingKey(long downTime) |
void |
incrementCoalescingKey(long downTime)
Increments the coalescing key corresponding to the gesture with this down time.
|
void |
removeCoalescingKey(long downTime)
Stops tracking a new coalescing key corresponding to the gesture with this down time.
|
public void addCoalescingKey(long downTime)
public void incrementCoalescingKey(long downTime)
public short getCoalescingKey(long downTime)
public void removeCoalescingKey(long downTime)
public boolean hasCoalescingKey(long downTime)