Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 1 | page.title=Gestures |
Joe Fernandez | 33baa5a | 2013-11-14 11:41:19 -0800 | [diff] [blame] | 2 | page.tags=gesture,input,touch |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 3 | @jd:body |
| 4 | |
| 5 | <p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The |
| 6 | following table shows the core gesture set that is supported in Android.</p> |
| 7 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 8 | <div class="vspace size-2"> </div> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 9 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 10 | <div class="layout-content-row"> |
| 11 | |
| 12 | <div class="layout-content-col span-4"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 13 | <img src="{@docRoot}design/media/gesture_touch.png"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 14 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 21 | </div> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 22 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 23 | <div class="layout-content-col span-4"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 24 | <img src="{@docRoot}design/media/gesture_longtouch.png"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 25 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 33 | </div> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 34 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 35 | <div class="layout-content-col span-4"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 36 | <img src="{@docRoot}design/media/gesture_swipe.png"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 37 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 46 | </div> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 47 | |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 48 | </div> |
| 49 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 50 | <div class="vspace size-2"> </div> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 51 | |
| 52 | <div class="layout-content-row"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 53 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 54 | <div class="layout-content-col span-4"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 55 | <img src="{@docRoot}design/media/gesture_drag.png"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 56 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 63 | </div> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 64 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 65 | <div class="layout-content-col span-4"> |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 66 | <img src="{@docRoot}design/media/gesture_doubletouch.png"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 67 | <h4>Double touch </h4> |
Dirk Dougherty | 2a91ecb | 2013-11-05 19:06:27 -0800 | [diff] [blame] | 68 | <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 Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 71 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 77 | </div> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 78 | |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 79 | <div class="layout-content-col span-4"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 80 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 94 | </div> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 95 | |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 96 | </div> |
| 97 | |
| 98 | |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 99 | <div class="vspace size-2"> </div> |
| 100 | |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 101 | <div class="layout-content-row"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 102 | |
Roman Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 103 | <div class="layout-content-col span-4"> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 104 | <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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 112 | </div> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 113 | |
| 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 Nurik | b99ae73 | 2012-03-06 12:26:15 -0800 | [diff] [blame] | 126 | </div> |
Dirk Dougherty | 3e529b4 | 2013-10-19 11:43:41 -0700 | [diff] [blame] | 127 | |