![]() ![]() Just over a year later, the Android 2.0 Droid launched with multitouch support at the system level but no pinch-to-zoom enabled at the apps level, an omission that prompted much hand-wringing, several hacks, and yes, yet another thrilling patent editorial by yours truly. First, Android very famously shipped on the G1 in October 2008 without any pinch-to-zoom support at the system level at all, which of course sparked rumors that Apple had threatened patent litigation, but as far as I can tell Apple didn’t really have any PTZ patents until October 2010. Android narrative of the day.īut I don’t think it’s as simple as all that – it feels like there’s a little media conflation going on. (Schmidt would later step down, of course.) It’s juicy stuff, and it nicely feeds right into the current iOS vs. The acrimony was so deep, we’re told, that Jobs kept the iPad a secret from Eric Schmidt even though Schmidt was still on Apple’s board of directors while it was being developed. There’s been a lot of chatter these past few weeks about Steven Levy’s new Google book In the Plex, and particularly some revelations in the book about Steve Jobs – specifically, that Larry Page and Sergey Brin wanted him to be the first CEO of Google, and that Jobs mentored the two founders until he later saw pinch-to-zoom in Android and everything went to hell. The ID for a pointer at a particular index in the list of current pointers may be obtained via a call to the MotionEvent getPointerId() method.The Android multitouch story gets even murkier The current number of pointers can be obtained via a call to the getPointerCount() method of the current MotionEvent object. Each pointer, in turn, is referenced by an index value and assigned an ID. In practice, most Android devices possess the ability to respond to multiple consecutive touches (though it is important to note that the number of simultaneous touches that can be detected varies depending on the device).Īs previously discussed, each touch in a multi-touch situation is considered by the Android framework to be a pointer. The previous chapter began exploring event handling within the narrow context of a single touch event. In order to identify the index of the pointer that triggered the event, the getActionIndex() callback method of the MotionEvent object must be called. In a multi-touch scenario, pointers begin and end with event actions of type ACTION_POINTER_UP and ACTION_POINTER_DOWN respectively. ![]() When more than one touch is performed simultaneously on a view, the touches are referred to as pointers. Any motion of the touch between the ACTION_DOWN and ACTION_UP events will be represented by ACTION_MOVE events. When that touch is lifted from the screen, an ACTION_UP event is generated. When the first touch on a view occurs, the MotionEvent object will contain an action type of ACTION_DOWN together with the coordinates of the touch. The type of action associated with an event can be obtained by making a call to the getActionMasked() method of the MotionEvent object which was passed through to the onTouch() callback method. The topic of identifying distinct gestures will be covered in the next chapter.Īn important aspect of touch event handling involves being able to identify the type of action performed by the user. The objective of this chapter is to highlight the handling of touches that involve motion and to explore the concept of intercepting multiple concurrent touches. Consider, for example, that a horizontal swipe is typically used to turn the page of an eBook, or how a pinching motion can be used to zoom in and out of an image displayed on the screen. Touches can also be interpreted by an application as a gesture. Touches can, of course, be dynamic as the user slides one or more points of contact across the surface of the screen. Nor are touches limited to a single point on the device display. Most Android devices can, for example, detect more than one touch at a time. There is, however, much more to touch event handling than responding to a single finger tap on a view object. ![]() The previous chapter introduced the mechanism by which a touch on the screen translates into an action within a running Android application. Most Android based devices use a touch screen as the primary interface between user and device. Purchase the fully updated Android Studio Chipmunk Edition of this publication in eBook ($29.99) or Print ($46.99) formatĪndroid Studio Chipmunk Essentials - Java Edition Print and eBook (PDF) editions contain 94 chapters and over 800 pages You are currently reading the Android Studio 1.x - Android 5 Edition of this book. ![]()
0 Comments
Leave a Reply. |