blob: 1ec7094973a53626e209d4ac65dd83b80fd44850 [file] [log] [blame]
Roman Nurikb99ae732012-03-06 12:26:15 -08001page.title=Gestures
Joe Fernandez33baa5a2013-11-14 11:41:19 -08002page.tags=gesture,input,touch
Roman Nurikb99ae732012-03-06 12:26:15 -08003@jd:body
4
5<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
6following table shows the core gesture set that is supported in Android.</p>
7
Dirk Dougherty3e529b42013-10-19 11:43:41 -07008<div class="vspace size-2">&nbsp;</div>
Roman Nurikb99ae732012-03-06 12:26:15 -08009
Dirk Dougherty3e529b42013-10-19 11:43:41 -070010<div class="layout-content-row">
11
12 <div class="layout-content-col span-4">
Roman Nurikb99ae732012-03-06 12:26:15 -080013 <img src="{@docRoot}design/media/gesture_touch.png">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070014 <h4>Touch</h4>
15 <p>Triggers the default functionality for a given item.</p>
16 <ul>
17 <li class="no-bullet with-icon action">
18 <h4>Action</h4>
19 <p>Press, lift</p></li>
20 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080021 </div>
Roman Nurikb99ae732012-03-06 12:26:15 -080022
Dirk Dougherty3e529b42013-10-19 11:43:41 -070023 <div class="layout-content-col span-4">
Roman Nurikb99ae732012-03-06 12:26:15 -080024 <img src="{@docRoot}design/media/gesture_longtouch.png">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070025 <h4>Long press</h4>
26 <p>Enters data selection mode. Allows you to select one or more items in a view and act upon
27 the data using a contextual action bar. Avoid using long press for showing contextual menus.</p>
28 <ul>
29 <li class="no-bullet with-icon action">
30 <h4>Action</h4>
31 <p>Press, wait, lift</p></li>
32 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080033 </div>
Roman Nurikb99ae732012-03-06 12:26:15 -080034
Dirk Dougherty3e529b42013-10-19 11:43:41 -070035 <div class="layout-content-col span-4">
Roman Nurikb99ae732012-03-06 12:26:15 -080036 <img src="{@docRoot}design/media/gesture_swipe.png">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070037 <h4>Swipe or drag</h4>
38 <p>Scrolls overflowing content, or navigates between views in the same hierarchy. Swipes are
39 quick and affect the screen even after the finger is picked up. Drags are slower and more precise,
40 and the screen stops responding when the finger is picked up.</p>
41 <ul>
42 <li class="no-bullet with-icon action">
43 <h4>Action</h4>
44 <p>Press, move, lift</p></li>
45 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080046 </div>
Dirk Dougherty3e529b42013-10-19 11:43:41 -070047
Roman Nurikb99ae732012-03-06 12:26:15 -080048</div>
49
Dirk Dougherty3e529b42013-10-19 11:43:41 -070050<div class="vspace size-2">&nbsp;</div>
Roman Nurikb99ae732012-03-06 12:26:15 -080051
52<div class="layout-content-row">
Roman Nurikb99ae732012-03-06 12:26:15 -080053
Dirk Dougherty3e529b42013-10-19 11:43:41 -070054 <div class="layout-content-col span-4">
Roman Nurikb99ae732012-03-06 12:26:15 -080055 <img src="{@docRoot}design/media/gesture_drag.png">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070056 <h4>Long press drag</h4>
57 <p>Rearranges data within a view, or moves data into a container (e.g. folders on Home Screen).</p>
58 <ul>
59 <li class="no-bullet with-icon action">
60 <h4>Action</h4>
61 <p>Long press, move, lift</p></li>
62 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080063 </div>
Roman Nurikb99ae732012-03-06 12:26:15 -080064
Dirk Dougherty3e529b42013-10-19 11:43:41 -070065 <div class="layout-content-col span-4">
Roman Nurikb99ae732012-03-06 12:26:15 -080066 <img src="{@docRoot}design/media/gesture_doubletouch.png">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070067 <h4>Double touch </h4>
Dirk Dougherty2a91ecb2013-11-05 19:06:27 -080068 <p> Scales up a standard amount around the target with each repeated gesture until reaching
69 maximum scale. For nested views, scales up the smallest targetable view, or returns it to
70 its original scale. Also used as a secondary gesture for text selection.</p>
Dirk Dougherty3e529b42013-10-19 11:43:41 -070071 <ul>
72 <li class="no-bullet with-icon action">
73 <h4>Action</h4>
74 <p>Two touches in quick succession</p>
75 </li>
76 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080077 </div>
Dirk Dougherty3e529b42013-10-19 11:43:41 -070078
Roman Nurikb99ae732012-03-06 12:26:15 -080079 <div class="layout-content-col span-4">
Dirk Dougherty3e529b42013-10-19 11:43:41 -070080 <img src="{@docRoot}design/media/gesture_doubletouchdrag.png">
81 <h4>Double touch drag</h4>
82 <p>Scales content by pushing away or pulling closer, centered around gesture.</p>
83 <ul>
84 <li class="no-bullet with-icon action">
85 <h4>Action</h4>
86 <p>A single touch followed in quick succession by a drag up or down:</p>
87 <ul style="padding-left:1.5em;list-style-type:disc;">
88 <li>Dragging up decreases content scale</li>
89 <li>Dragging down increases content scale</li>
90 <li>Reversing drag direction reverses scaling.</li>
91 </ul>
92 </li>
93 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -080094 </div>
Dirk Dougherty3e529b42013-10-19 11:43:41 -070095
Roman Nurikb99ae732012-03-06 12:26:15 -080096</div>
97
98
Dirk Dougherty3e529b42013-10-19 11:43:41 -070099<div class="vspace size-2">&nbsp;</div>
100
Roman Nurikb99ae732012-03-06 12:26:15 -0800101<div class="layout-content-row">
Dirk Dougherty3e529b42013-10-19 11:43:41 -0700102
Roman Nurikb99ae732012-03-06 12:26:15 -0800103 <div class="layout-content-col span-4">
Dirk Dougherty3e529b42013-10-19 11:43:41 -0700104 <img src="{@docRoot}design/media/gesture_pinchopen.png" style="margin-left:-4px">
105 <h4>Pinch open</h4>
106 <p>Zooms into content.</p>
107 <ul>
108 <li class="no-bullet with-icon action">
109 <h4>Action</h4>
110 <p>2-finger press, move outwards, lift</p></li>
111 </ul>
Roman Nurikb99ae732012-03-06 12:26:15 -0800112 </div>
Dirk Dougherty3e529b42013-10-19 11:43:41 -0700113
114 <div class="layout-content-col span-4">
115 <img src="{@docRoot}design/media/gesture_pinchclose.png">
116 <h4>Pinch close</h4>
117 <p>Zooms out of content.</p>
118 <ul>
119 <li class="no-bullet with-icon action">
120 <h4>Action</h4>
121 <p>2-finger press, move inwards, lift</p>
122 </li>
123 </ul>
124 </div>
125
Roman Nurikb99ae732012-03-06 12:26:15 -0800126</div>
Dirk Dougherty3e529b42013-10-19 11:43:41 -0700127