blob: 9d21b081f82af3b05712480583b1d089c4b4df51 [file] [log] [blame]
&& repo sync -j8518edbf2012-11-30 16:28:27 -08001page.title=Using Touch Gestures
Scott Main1c2dea02013-04-10 18:59:29 -07002page.tags="input","navigation","gesturedetector","scroller"
3
&& repo sync -j8518edbf2012-11-30 16:28:27 -08004trainingnavtop=true
5startpage=true
&& repo sync -j8518edbf2012-11-30 16:28:27 -08006
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>
&& repo sync -j8518edbf2012-11-30 16:28:27 -080023 <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
kmccormicke23f97b2013-03-12 14:46:07 -070028<h2>Try it out</h2>
29
30<div class="download-box">
31 <a href="{@docRoot}shareables/training/InteractiveChart.zip"
32class="button">Download the sample</a>
33 <p class="filename">InteractiveChart.zip</p>
34</div>
&& repo sync -j8518edbf2012-11-30 16:28:27 -080035
36</div>
37</div>
38
39<p> This class describes how to write apps that allow users to interact with an
40app via touch gestures. Android provides a variety of APIs to
41help you create and detect gestures.</p>
42
43<p>Although your app should not depend on touch gestures for basic behaviors (since the gestures
44may not be available to all users in all contexts), adding touch-based
45interaction to your app can greatly increase its usefulness and appeal.</p>
46
47<p>To
48provide users with a consistent, intuitive experience, your app should follow
49the accepted Android conventions for touch gestures. The <a
50href="http://developer.android.com/design/patterns/gestures.html">Gestures
51design guide</a><a href="{@docRoot}design/patterns/notifications.html"></a>
52shows you how to use common gestures in Android apps. Also see the Design Guide
53for <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
79android.widget.OverScroller}) to produce a scrolling animation in response to a
80touch 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
99ensure that touch events are correctly dispatched to their target views.</dd>
100</dl>