1 page.title=Using Touch Gestures 2 page.tags="input","navigation","gesturedetector","scroller" 3 4 trainingnavtop=true 5 startpage=true 6 7 8 @jd:body 9 <div id="tb-wrapper"> 10 <div id="tb"> 11 12 <!-- Required platform, tools, add-ons, devices, knowledge, etc. --> 13 <h2>Dependencies and prerequisites</h2> 14 15 <ul> 16 <li>Android 1.6 (API Level 4) or higher</li> 17 </ul> 18 <h2>You should also read</h2> 19 <ul> 20 <li><a href="http://developer.android.com/guide/topics/ui/ui-events.html">Input Events</a> API Guide 21 </li> 22 <li><a href="{@docRoot}guide/topics/sensors/sensors_overview.html">Sensors Overview</a></li> 23 <li><a href="{@docRoot}training/custom-views/making-interactive.html">Making the View Interactive</a> </li> 24 <li>Design Guide for <a href="{@docRoot}design/patterns/gestures.html">Gestures</a></li> 25 <li>Design Guide for <a href="{@docRoot}design/style/touch-feedback.html">Touch Feedback</a></li> 26 </ul> 27 28 <h2>Try it out</h2> 29 30 <div class="download-box"> 31 <a href="{@docRoot}shareables/training/InteractiveChart.zip" 32 class="button">Download the sample</a> 33 <p class="filename">InteractiveChart.zip</p> 34 </div> 35 36 </div> 37 </div> 38 39 <p> This class describes how to write apps that allow users to interact with an 40 app via touch gestures. Android provides a variety of APIs to 41 help you create and detect gestures.</p> 42 43 <p>Although your app should not depend on touch gestures for basic behaviors (since the gestures 44 may not be available to all users in all contexts), adding touch-based 45 interaction to your app can greatly increase its usefulness and appeal.</p> 46 47 <p>To 48 provide users with a consistent, intuitive experience, your app should follow 49 the accepted Android conventions for touch gestures. The <a 50 href="http://developer.android.com/design/patterns/gestures.html">Gestures 51 design guide</a><a href="{@docRoot}design/patterns/notifications.html"></a> 52 shows you how to use common gestures in Android apps. Also see the Design Guide 53 for <a href="{@docRoot}design/style/touch-feedback.html">Touch Feedback</a>. </p> 54 55 56 <h2>Lessons</h2> 57 58 <dl> 59 <dt> 60 <strong><a href="detector.html">Detecting Common Gestures</a></strong> 61 </dt> 62 <dd> 63 Learn how to detect basic touch gestures such as scrolling, flinging, and double-tapping, using 64 {@link android.view.GestureDetector}. 65 </dd> 66 67 <dt> 68 <strong><a href="movement.html">Tracking Movement</a></strong> 69 </dt> 70 <dd> 71 Learn how to track movement. 72 </dd> 73 74 <dt> 75 <strong><a href="scroll.html">Animating a Scroll Gesture</a></strong> 76 </dt> 77 <dd> 78 Learn how to use scrollers ({@link android.widget.Scroller} or {@link 79 android.widget.OverScroller}) to produce a scrolling animation in response to a 80 touch event. </dd> 81 82 <dt> 83 <strong><a href="multi.html">Handling Multi-Touch Gestures</a></strong> 84 </dt> 85 <dd> 86 Learn how to detect multi-pointer (finger) gestures. 87 </dd> 88 <dt> 89 <strong><a href="scale.html">Dragging and Scaling</a></strong> 90 </dt> 91 <dd> 92 Learn how to implement touch-based dragging and scaling. 93 </dd> 94 95 96 <dt><strong><a href="viewgroup.html">Managing Touch Events in a ViewGroup</a></strong></dt> 97 98 <dd>Learn how to manage touch events in a {@link android.view.ViewGroup} to 99 ensure that touch events are correctly dispatched to their target views.</dd> 100 </dl> 101