diff options
Diffstat (limited to 'docs/html')
56 files changed, 15531 insertions, 344 deletions
diff --git a/docs/html/about/versions/android-2.3.jd b/docs/html/about/versions/android-2.3.jd index 8715973..89bf432 100644 --- a/docs/html/about/versions/android-2.3.jd +++ b/docs/html/about/versions/android-2.3.jd @@ -406,17 +406,6 @@ notification style.</li> </ul> </li> -<li>WebView -<ul> -<li>New {@link -android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground( -boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link -android.webkit.WebView} specify whether to use its own background for the -overscroll background. </li> -</ul> -</li> -</ul> - <h3 id="extralargescreens">Extra Large Screens</h3> <p>The platform now supports extra large screen sizes, such as those that might @@ -707,4 +696,4 @@ declaring the attribute prevents the application from being installed on earlier versions of the platform.</p> <p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API -Level?</a></p>
\ No newline at end of file +Level?</a></p> diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png Binary files differnew file mode 100644 index 0000000..d082d50 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png Binary files differnew file mode 100644 index 0000000..d29f818 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png Binary files differnew file mode 100644 index 0000000..af1a249 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/land_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png Binary files differnew file mode 100644 index 0000000..501690b --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png Binary files differnew file mode 100644 index 0000000..689a72a --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png Binary files differnew file mode 100644 index 0000000..b2265ef --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/port_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png Binary files differnew file mode 100644 index 0000000..8d8dee9 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_10/thumb.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_4/land_back.png Binary files differnew file mode 100644 index 0000000..57a011a --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/land_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_4/land_fore.png Binary files differnew file mode 100644 index 0000000..72c9654 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/land_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_4/land_shadow.png Binary files differnew file mode 100644 index 0000000..d80a5fd --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/land_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_4/port_back.png Binary files differnew file mode 100644 index 0000000..e64fae4 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/port_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_4/port_fore.png Binary files differnew file mode 100644 index 0000000..c9fb062 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/port_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_4/port_shadow.png Binary files differnew file mode 100644 index 0000000..b2064a3 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/port_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_4/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_4/thumb.png Binary files differnew file mode 100644 index 0000000..2988dc9 --- /dev/null +++ b/docs/html/distribute/promote/device-art-resources/nexus_4/thumb.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png Binary files differindex 2999f35..697fb7d 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png Binary files differindex cefdd35..735262f 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png Binary files differindex 8f7aec7..cfb7952 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/land_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png Binary files differindex b2908a8..5bb815a 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_back.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png Binary files differindex 7f4b0b4..1be3b21 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_fore.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png b/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png Binary files differindex c10bd53..7e8aff2 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/port_shadow.png diff --git a/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png b/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png Binary files differindex 8b5cc5a..b5db82e 100644 --- a/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png +++ b/docs/html/distribute/promote/device-art-resources/nexus_7/thumb.png diff --git a/docs/html/distribute/promote/device-art.jd b/docs/html/distribute/promote/device-art.jd index 93f772a..55b846e 100644 --- a/docs/html/distribute/promote/device-art.jd +++ b/docs/html/distribute/promote/device-art.jd @@ -18,7 +18,9 @@ feature image or screenshots for your Google Play app listing.</p> <p>Drag a screenshot from your desktop onto a device to the right.</p> </div> <div class="layout-content-col span-10"> - <ul id="device-list"></ul> + <ul class="device-list primary"></ul> + <a href="#" id="archive-expando">Older devices</a> + <ul class="device-list archive"></ul> </div> </div> @@ -57,12 +59,12 @@ feature image or screenshots for your Google Play app listing.</p> text-transform: uppercase; } - #device-list { + .device-list { padding: 0; margin: 0; } - #device-list li { + .device-list li { display: inline-block; vertical-align: bottom; margin: 0; @@ -70,11 +72,11 @@ feature image or screenshots for your Google Play app listing.</p> text-align: center; } - #device-list li .thumb-container { + .device-list li .thumb-container { display: inline-block; } - #device-list li .thumb-container img { + .device-list li .thumb-container img { margin-bottom: 8px; opacity: 0.6; @@ -83,7 +85,7 @@ feature image or screenshots for your Google Play app listing.</p> transition: transform 0.2s, opacity 0.2s; } - #device-list li.drag-hover .thumb-container img { + .device-list li.drag-hover .thumb-container img { opacity: 1; -webkit-transform: scale(1.1); @@ -91,16 +93,35 @@ feature image or screenshots for your Google Play app listing.</p> transform: scale(1.1); } - #device-list li .device-details { + .device-list li .device-details { font-size: 13px; line-height: 16px; color: #888; } - #device-list li .device-url { + .device-list li .device-url { font-weight: bold; } + #archive-expando { + display: block; + font-size: 13px; + font-weight: bold; + color: #333; + text-transform: uppercase; + margin-top: 16px; + padding-top: 16px; + padding-left: 28px; + border-top: 1px solid transparent; + background: transparent url({@docRoot}assets/images/styles/disclosure_down.png) + no-repeat scroll 0 8px; + } + + #archive-expando.expanded { + background-image: url({@docRoot}assets/images/styles/disclosure_up.png); + border-top: 1px solid #ccc; + } + #output { color: #f44; font-style: italic; @@ -117,7 +138,7 @@ feature image or screenshots for your Google Play app listing.</p> // Global constants var MSG_INVALID_INPUT_IMAGE = 'Invalid screenshot provided. Screenshots must be PNG files ' - + 'matching the target device\'s screen resolution in either portrait or landscape.'; + + 'matching the target device\'s screen aspect ratio in either portrait or landscape.'; var MSG_NO_INPUT_IMAGE = 'Drag a screenshot (in PNG format) from your desktop onto a ' + 'target device above.' var MSG_GENERATING_IMAGE = 'Generating device art…'; @@ -127,17 +148,44 @@ feature image or screenshots for your Google Play app listing.</p> // Device manifest. var DEVICES = [ { + id: 'nexus_4', + title: 'Nexus 4', + url: 'http://www.google.com/nexus/4/', + physicalSize: 4.7, + physicalHeight: 5.23, + density: 'XHDPI', + landRes: ['shadow', 'back', 'fore'], + landOffset: [349,214], + portRes: ['shadow', 'back', 'fore'], + portOffset: [213,350], + portSize: [768,1280] + }, + { id: 'nexus_7', title: 'Nexus 7', - url: 'http://www.android.com/devices/detail/nexus-7', + url: 'http://www.google.com/nexus/7/', physicalSize: 7, physicalHeight: 7.81, - density: 213, + density: '213dpi', landRes: ['shadow', 'back', 'fore'], - landOffset: [363,260], + landOffset: [315,270], portRes: ['shadow', 'back', 'fore'], - portOffset: [265,341], - portSize: [800,1280], + portOffset: [264,311], + portSize: [800,1280] + }, + { + id: 'nexus_10', + title: 'Nexus 10', + url: 'http://www.google.com/nexus/10/', + physicalSize: 10, + physicalHeight: 7, + actualResolution: [1600,2560], + density: 'XHDPI', + landRes: ['shadow', 'back', 'fore'], + landOffset: [227,217], + portRes: ['shadow', 'back', 'fore'], + portOffset: [217,223], + portSize: [800,1280] }, { id: 'xoom', @@ -145,12 +193,13 @@ feature image or screenshots for your Google Play app listing.</p> url: 'http://www.google.com/phone/detail/motorola-xoom', physicalSize: 10, physicalHeight: 6.61, - density: 160, + density: 'MDPI', landRes: ['shadow', 'back', 'fore'], landOffset: [218,191], portRes: ['shadow', 'back', 'fore'], portOffset: [199,200], portSize: [800,1280], + archived: true }, { id: 'galaxy_nexus', @@ -158,12 +207,13 @@ feature image or screenshots for your Google Play app listing.</p> url: 'http://www.android.com/devices/detail/galaxy-nexus', physicalSize: 4.65, physicalHeight: 5.33, - density: 320, + density: 'XHDPI', landRes: ['shadow', 'back', 'fore'], landOffset: [371,199], portRes: ['shadow', 'back', 'fore'], portOffset: [216,353], portSize: [720,1280], + archived: true }, { id: 'nexus_s', @@ -171,12 +221,13 @@ feature image or screenshots for your Google Play app listing.</p> url: 'http://www.google.com/phone/detail/nexus-s', physicalSize: 4.0, physicalHeight: 4.88, - density: 240, + density: 'HDPI', landRes: ['shadow', 'back', 'fore'], landOffset: [247,135], portRes: ['shadow', 'back', 'fore'], portOffset: [134,247], portSize: [480,800], + archived: true } ]; @@ -250,13 +301,23 @@ feature image or screenshots for your Google Play app listing.</p> $('#output').html(MSG_NO_INPUT_IMAGE); $('#frame-customizations').hide(); + $('.device-list.archive').hide(); $('#output-shadow, #output-glare').click(function() { - createFrame(g_currentDevice, g_currentImage); + createFrame(); }); // Build device list. $.each(DEVICES, function() { + var resolution = this.actualResolution || this.portSize; + var scaleFactorText = ''; + if (resolution[0] != this.portSize[0]) { + scaleFactorText = '<br>' + (100 * (this.portSize[0] / resolution[0])).toFixed(0) + + '% size output'; + } else { + scaleFactorText = '<br> '; + } + $('<li>') .append($('<div>') .addClass('thumb-container') @@ -269,14 +330,26 @@ feature image or screenshots for your Google Play app listing.</p> .html((this.url ? ('<a class="device-url" href="' + this.url + '">' + this.title + '</a>') : this.title) + - '<br>' + this.physicalSize + '" @ ' + this.density + 'dpi' + - '<br>' + this.portSize[0] + 'x' + this.portSize[1])) + '<br>' + this.physicalSize + '" @ ' + this.density + + '<br>' + (resolution[0] + 'x' + resolution[1]) + scaleFactorText)) .data('deviceId', this.id) - .appendTo('#device-list'); + .appendTo(this.archived ? '.device-list.archive' : '.device-list.primary'); + }); + + // Set up "older devices" expando. + $('#archive-expando').click(function() { + if ($(this).hasClass('expanded')) { + $(this).removeClass('expanded'); + $('.device-list.archive').hide(); + } else { + $(this).addClass('expanded'); + $('.device-list.archive').show(); + } + return false; }); // Set up drag and drop. - $('#device-list li') + $('.device-list li') .live('dragover', function(evt) { $(this).addClass('drag-hover'); evt.dataTransfer.dropEffect = 'link'; @@ -335,27 +408,19 @@ feature image or screenshots for your Google Play app listing.</p> */ function createFrame() { var port; - if (g_currentImage.naturalWidth == g_currentDevice.portSize[0] && - g_currentImage.naturalHeight == g_currentDevice.portSize[1]) { - if (!g_currentDevice.portRes) { - alert('No portrait frame is currently available for this device.'); - $('#output').html(MSG_NO_INPUT_IMAGE); - return; - } + + var aspect1 = g_currentImage.naturalWidth / g_currentImage.naturalHeight; + var aspect2 = g_currentDevice.portSize[0] / g_currentDevice.portSize[1]; + + if (aspect1 == aspect2) { port = true; - } else if (g_currentImage.naturalWidth == g_currentDevice.portSize[1] && - g_currentImage.naturalHeight == g_currentDevice.portSize[0]) { - if (!g_currentDevice.landRes) { - alert('No landscape frame is currently available for this device.'); - $('#output').html(MSG_NO_INPUT_IMAGE); - return; - } + } else if (aspect1 == 1 / aspect2) { port = false; } else { - alert('Screenshots for ' + g_currentDevice.title + ' must be ' + - g_currentDevice.portSize[0] + 'x' + g_currentDevice.portSize[1] + - ' or ' + - g_currentDevice.portSize[1] + 'x' + g_currentDevice.portSize[0] + '.'); + alert('The screenshot must have an aspect ratio of ' + + aspect2.toFixed(3) + ' or ' + (1 / aspect2).toFixed(3) + + ' (ideally ' + g_currentDevice.portSize[0] + 'x' + g_currentDevice.portSize[1] + + ' or ' + g_currentDevice.portSize[1] + 'x' + g_currentDevice.portSize[0] + ').'); $('#output').html(MSG_INVALID_INPUT_IMAGE); return; } @@ -378,6 +443,9 @@ feature image or screenshots for your Google Play app listing.</p> var width = resourceImages['back'].naturalWidth; var height = resourceImages['back'].naturalHeight; var offset = port ? g_currentDevice.portOffset : g_currentDevice.landOffset; + var size = port + ? g_currentDevice.portSize + : [g_currentDevice.portSize[1], g_currentDevice.portSize[0]]; var canvas = document.createElement('canvas'); canvas.width = width; @@ -388,7 +456,9 @@ feature image or screenshots for your Google Play app listing.</p> ctx.drawImage(resourceImages['shadow'], 0, 0); } ctx.drawImage(resourceImages['back'], 0, 0); - ctx.drawImage(g_currentImage, offset[0], offset[1]); + ctx.fillStyle = '#000'; + ctx.fillRect(offset[0], offset[1], size[0], size[1]); + ctx.drawImage(g_currentImage, offset[0], offset[1], size[0], size[1]); if (resourceImages['fore'] && $('#output-glare').is(':checked')) { ctx.drawImage(resourceImages['fore'], 0, 0); } diff --git a/docs/html/guide/faq/security.jd b/docs/html/guide/faq/security.jd index 52ee0d9..a6e07c8 100644 --- a/docs/html/guide/faq/security.jd +++ b/docs/html/guide/faq/security.jd @@ -57,9 +57,7 @@ key</a>.</p> <p>We appreciate researchers practicing responsible disclosure by emailing us with a detailed summary of the issue and keeping the issue confidential while users are at risk. In return, we will make sure to keep the researcher informed -of our progress in issuing a fix and will properly credit the reporter(s) when -we provide the patch. We will always move swiftly to mitigate or fix an -externally-reported flaw and provide updates to users. </p> +of our progress in issuing a fix. </p> <a name="informed" id="informed"></a><h2>How can I stay informed about Android security?</h2> diff --git a/docs/html/guide/google/gcm/gcm.jd b/docs/html/guide/google/gcm/gcm.jd index 5d3ea56..a402e8e 100644 --- a/docs/html/guide/google/gcm/gcm.jd +++ b/docs/html/guide/google/gcm/gcm.jd @@ -659,8 +659,10 @@ message sent by the application server. See <a href="adv.html#collapsible">Advan <td><code>data</code></td> <td>A JSON object whose fields represents the key-value pairs of the message's payload data. If present, the payload data it will be included in the Intent as application data, with the key being the extra's name. For instance, <code>"data":{"score":"3x1"}</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. + There is no limit on the number of key/value pairs, though there is a limit on the total size of the message (4kb). The values could be any JSON object, but we recommend using strings, since the values will be converted to strings in the GCM server anyway. If you want to include objects or other non-string data types (such as integers or booleans), you have to do the conversion to string yourself. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td> + </tr> <tr> <td><code>delay_while_idle</code></td> @@ -701,8 +703,10 @@ sent. Optional. The default value is <code>false</code>, and must be a JSON bool </tr> <tr> <td><code>data.<key></code></td> + <td>Payload data, expressed as parameters prefixed with <code>data.</code> and suffixed as the key. For instance, a parameter of <code>data.score=3x1</code> would result in an intent extra named <code>score</code> whose value is the string <code>3x1</code>. There is no limit on the number of key/value parameters, though there is a limit on the total size of the message. Also note that the key cannot be a reserved word (<code>from</code> or any word starting with <code>google.</code>). To complicate things slightly, there are some reserved words (such as <code>collapse_key</code>) that are technically allowed in payload data. However, if the request also contains the word, the value in the request will overwrite the value in the payload data. Hence using words that are defined as field names in this table is not recommended, even in cases where they are technically allowed. Optional.</td> + </tr> <tr> <td><code>delay_while_idle</code></td> @@ -912,13 +916,11 @@ Happens when the error code is <code>InvalidDataKey</code>.</dd> </ul> Check that the token you're sending inside the <code>Authorization</code> header is the correct API key associated with your project. You can check the validity of your API key by running the following command:<br/> - <pre># api_key=YOUR_API_KEY # curl --header "Authorization: key=$api_key" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"</pre> - If you receive a 401 HTTP status code, your API key is not valid. Otherwise you should see something like this:<br/> <pre> diff --git a/docs/html/guide/practices/security.jd b/docs/html/guide/practices/security.jd index ce59a9d..36eeff8 100644 --- a/docs/html/guide/practices/security.jd +++ b/docs/html/guide/practices/security.jd @@ -1,11 +1,11 @@ -page.title=Designing for Security +page.title=Designing for Security @jd:body <div id="qv-wrapper"> <div id="qv"> <h2>In this document</h2> <ol> -<li><a href="#Dalvik">Using Davlik Code</a></li> +<li><a href="#Dalvik">Using Dalvik Code</a></li> <li><a href="#Native">Using Native Code</a></li> <li><a href="#Data">Storing Data</a></li> <li><a href="#IPC">Using IPC</a></li> diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd index 7e031d9..9e8a825 100644 --- a/docs/html/guide/topics/appwidgets/index.jd +++ b/docs/html/guide/topics/appwidgets/index.jd @@ -2,7 +2,7 @@ page.title=App Widgets @jd:body <div id="qv-wrapper"> - <div id="qv"> + <div id="qv">re <h2>Quickview</h2> <ul> <li>App Widgets provide users access to some of your application features @@ -33,6 +33,11 @@ from </ol> </li> <li><a href="#preview">Setting a Preview Image</a></li> + <li><a href="#lockscreen">Enabling App Widgets on the Lockscreen + <ol> + <li><a href="#lockscreen-sizing">Sizing guidelines</li> + </ol> + </li> <li><a href="#collections">Using App Widgets with Collections</a> <ol> <li><a href="#collection_sample">Sample application</a></li> @@ -179,7 +184,9 @@ folder.</p> android:previewImage="@drawable/preview" android:initialLayout="@layout/example_appwidget" android:configure="com.example.android.ExampleAppWidgetConfigure" - android:resizeMode="horizontal|vertical"> + android:resizeMode="horizontal|vertical" + android:widgetCategory="home_screen|keyguard" + android:initialKeyguardLayout="@layout/example_keyguard"> </appwidget-provider> </pre> @@ -274,7 +281,21 @@ widget to show its resize handles, then drag the horizontal and/or vertical handles to change the size on the layout grid. Values for the <code>resizeMode</code> attribute include "horizontal", "vertical", and "none". To declare a widget as resizeable horizontally and vertically, supply the value -"horizontal|vertical". Introduced in Android 3.1.</li> </ul> +"horizontal|vertical". Introduced in Android 3.1.</li> + +<li>The <code>widgetCategory</code> attribute declares whether your App Widget can be displayed on the home screen, +the lock screen (keyguard), or both. Values for this attribute include "home_screen" and "keyguard". A widget that +is displayed on both needs to ensure that it follows the design guidelines for both widget classes. For more +information, see <a href="#lockscreen">Enabling App Widgets on the Lockscreen</a>. The default value is "home_screen". Introduced in Android 4.2. +</li> + +<li>The <code>initialKeyguardLayout</code> attribute points to the layout resource +that defines the lock screen App Widget layout. This works the same way as the +{@link android.appwidget.AppWidgetProviderInfo#initialLayout android:initialLayout}, +in that it provides a layout that can appear immediately until your app widget is initialized and able to update +the layout. Introduced in Android 4.2.</li> + +</ul> <p>See the {@link android.appwidget.AppWidgetProviderInfo} class for more information on the @@ -731,6 +752,66 @@ preview image, launch this application, select the app widget for your application and set it up how you'd like your preview image to appear, then save it and place it in your application's drawable resources.</p> +<h2 id="lockscreen">Enabling App Widgets on the Lockscreen</h2> + +<p>Android 4.2 introduces the ability for users to add widgets to the lock screen. To indicate that your app widget is available for use on the lock screen, declare the {@link android.appwidget.AppWidgetProviderInfo#widgetCategory android:widgetCategory} attribute in the XML file that specifies your {@link android.appwidget.AppWidgetProviderInfo}. This attribute supports two values: "home_screen" and "keyguard". An app widget can declare support for one or both.</p> + +<p>By default, every app widget supports placement on the Home screen, so "home_screen" is the default value for the +{@link android.appwidget.AppWidgetProviderInfo#widgetCategory android:widgetCategory} attribute. If you want your app widget to be available for the lock screen, add the "keyguard" value:</p> +<pre> +<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" + ... + android:widgetCategory="keyguard|home_screen"> +</appwidget-provider> +</pre> + +<p>If you declare a widget to be displayable on both keyguard (lockscreen) and home, it's likely that you'll want to customize the widget depending on where it is displayed. For example, you might create a separate layout file for keyguard vs. home. The next step is to detect the widget category at runtime and respond accordingly. + +You can detect whether your widget is on the lockscreen or home screen by calling +{@link android.appwidget.AppWidgetManager#getAppWidgetOptions getAppWidgetOptions()} +to get the widget's options as a {@link android.os.Bundle}. The returned bundle will include the key +{@link android.appwidget.AppWidgetManager#OPTION_APPWIDGET_HOST_CATEGORY}, whose value will be one of {@link android.appwidget.AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN} or +{@link android.appwidget.AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD}. This value is determined by the host into which the widget is bound. In the {@link android.appwidget.AppWidgetProvider}, you can then check the widget's category, for example:</p> + +<pre> +AppWidgetManager appWidgetManager; +int widgetId; +Bundle myOptions = appWidgetManager.getAppWidgetOptions (widgetId); + +// Get the value of OPTION_APPWIDGET_HOST_CATEGORY +int category = myOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, -1); + +// If the value is WIDGET_CATEGORY_KEYGUARD, it's a lockscreen widget +boolean isKeyguard = category == AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD; +</pre> + +<p>Once you know the widget's category, you can optionally load a different base layout, set different properties, and so on. For example:</p> + +<pre> +int baseLayout = isKeyguard ? R.layout.keyguard_widget_layout : R.layout.widget_layout; +</pre> + + +<p>You should also specify an initial layout for your app widget when on the lock screen with the +{@link android.appwidget.AppWidgetProviderInfo#initialKeyguardLayout android:initialKeyguardLayout} attribute. This works the same way as the +{@link android.appwidget.AppWidgetProviderInfo#initialLayout android:initialLayout}, in that it provides a layout that can appear immediately until your app widget is initialized and able to update the layout.</p> + +<h3 id="lockscreen-sizing">Sizing guidelines</h3> + +<p>When a widget is hosted on the lockscreen, the framework ignores the {@code minWidth}, {@code minHeight}, {@code minResizeWidth}, and {@code minResizeHeight} fields. If a widget is also a home screen widget, these parameters are still needed as they're still used on home, but they will be ignored for purposes of the lockscreen.</p> + +<p>The width of a lockscreen widget always fills the provided space. For the height of a lockscreen widget, you have the following options:</p> + +<ul> + <li>If the widget does not mark itself as vertically resizable ({@code android:resizeMode="vertical"}), then the widget height will always be "small": + <ul> + <li>On a phone in portrait mode, "small" is defined as the space remaining when an unlock UI is being displayed.</li> + <li>On tablets and landscape phones, "small" is set on a per-device basis.</li> + </ul> + </li> + <li>If the widget marks itself as vertically resizable, then the widget height shows up as "small" on portrait phones displaying an unlock UI. In all other cases, the widget sizes to fill the available height.</li> +</ul> + <h2 id="collections">Using App Widgets with Collections</h2> <p>Android 3.0 introduces App Widgets with collections. These kinds of App diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd index 844be11..2aedaec 100644 --- a/docs/html/guide/topics/manifest/activity-element.jd +++ b/docs/html/guide/topics/manifest/activity-element.jd @@ -218,7 +218,8 @@ separated by '{@code |}' — for example, "{@code locale|navigation|orientat <td>"{@code uiMode}"</td> <td>The user interface mode has changed — this can be caused when the user places the device into a desk/car dock or when the the night mode changes. See {@link -android.app.UiModeManager}. <em>Introduced in API Level 8</em>.</td> +android.app.UiModeManager}. + <em>Added in API level 8</em>.</td> </tr><tr> <td>"{@code orientation}"</td> <td>The screen orientation has changed — the user has rotated the device. @@ -246,7 +247,12 @@ smallestWidth configuration</a>. However, if your application targets API level your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device). <p><em>Added in API level 13.</em></p></td> - </tr> + </tr><tr> + <td>"{@code layoutDirection}"</td> + <td>The layout direction has changed. For example, changing from left-to-right (LTR) + to right-to-left (RTL). + <em>Added in API level 17.</em></td> + </tr> </table> <p> diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd index 2105a50..42cfdd5 100644 --- a/docs/html/guide/topics/manifest/application-element.jd +++ b/docs/html/guide/topics/manifest/application-element.jd @@ -23,6 +23,7 @@ parent.link=manifest-intro.html android:<a href="#persistent">persistent</a>=["true" | "false"] android:<a href="#proc">process</a>="<i>string</i>" android:<a href="#restoreany">restoreAnyVersion</a>=["true" | "false"] + android:<a href="#supportsrtl">supportsRtl</a>=["true" | "false"] android:<a href="#aff">taskAffinity</a>="<i>string</i>" android:<a href="#theme">theme</a>="<i>resource or theme</i>" android:<a href="#uioptions">uiOptions</a>=["none" | "splitActionBarWhenNarrow"] > @@ -271,7 +272,7 @@ applications, reducing resource usage. </p></dd> <dt><a name="restoreany"></a>{@code android:restoreAnyVersion}</dt> -<dd>Indicate that the application is prepared to attempt a restore of any +<dd>Indicates that the application is prepared to attempt a restore of any backed-up data set, even if the backup was stored by a newer version of the application than is currently installed on the device. Setting this attribute to {@code true} will permit the Backup Manager to @@ -281,6 +282,21 @@ incompatible. <em>Use with caution!</em> <p>The default value of this attribute is {@code false}. </p></dd> +<dt><a name="supportsrtl"></a>{@code android:supportsRtl}</dt> +<dd>Declares whether your application is willing to support right-to-left (RTL) layouts. +<p>If set to {@code true} and <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target" +>{@code targetSdkVersion}</a> is set to 17 or higher, various RTL APIs will be +activated and used by the system so your app can display RTL layouts. +If set to {@code false} or if <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target" +>{@code targetSdkVersion}</a> is set to 16 or lower, the RTL APIs will be ignored +or will have no effect and your app will behave the same regardless of the layout +direction associated to the user's Locale choice (your layouts will always be left-to-right). + +<p>The default value of this attribute is {@code false}.</p> + +<p>This attribute was added in API level 17.</p> +</dd> + <dt><a name="aff"></a>{@code android:taskAffinity}</dt> <dd>An affinity name that applies to all activities within the application, except for those that set a different affinity with their own diff --git a/docs/html/guide/topics/manifest/permission-element.jd b/docs/html/guide/topics/manifest/permission-element.jd index c256fb1..a23fb4b 100644 --- a/docs/html/guide/topics/manifest/permission-element.jd +++ b/docs/html/guide/topics/manifest/permission-element.jd @@ -111,7 +111,7 @@ The value can be set to one of the following strings: <td>"{@code signatureOrSystem}"</td> <td>A permission that the system grants only to applications that are in the Android system image <em>or</em> that are signed with the same - certificates as those in the system image. Please avoid using this + certificate as the application that declared the permission. Please avoid using this option, as the {@code signature} protection level should be sufficient for most needs and works regardless of exactly where applications are installed. The "{@code signatureOrSystem}" diff --git a/docs/html/guide/topics/manifest/provider-element.jd b/docs/html/guide/topics/manifest/provider-element.jd index 4558800..6cf6843 100644 --- a/docs/html/guide/topics/manifest/provider-element.jd +++ b/docs/html/guide/topics/manifest/provider-element.jd @@ -5,7 +5,9 @@ parent.link=manifest-intro.html <dl class="xml"> <dt>syntax:</dt> -<dd><pre class="stx"><provider android:<a href="#auth">authorities</a>="<i>list</i>" +<dd> +<pre class="stx"> +<provider android:<a href="#auth">authorities</a>="<i>list</i>" android:<a href="#enabled">enabled</a>=["true" | "false"] android:<a href="#exported">exported</a>=["true" | "false"] android:<a href="#gprmsn">grantUriPermissions</a>=["true" | "false"] @@ -20,10 +22,13 @@ parent.link=manifest-intro.html android:<a href="#sync">syncable</a>=["true" | "false"] android:<a href="#wprmsn">writePermission</a>="<i>string</i>" > . . . -</provider></pre></dd> +</provider></pre> +</dd> <dt>contained in:</dt> -<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code></dd> +<dd> + <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> +</dd> <dt>can contain:</dt> <dd><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code> @@ -31,58 +36,67 @@ parent.link=manifest-intro.html <br/><code><a href="{@docRoot}guide/topics/manifest/path-permission-element.html"><path-permission></a></code></dd> <dt>description:</dt> -<dd>Declares a content provider — a subclass of -{@link android.content.ContentProvider} — that supplies structured -access to data managed by the application. All content providers that -are part of the application must be represented by {@code <provider>} -elements in the manifest file. The system cannot see, and therefore will -not run, any that are not declared. (You need to declare only -those content providers that you develop as part of your application, -not those developed by others that your application uses.) - -<p> -The Android system identifies content providers by the authority part - of a {@code content:} URI. For example, suppose that the following URI -is passed to <code>{@link android.content.ContentResolver#query -ContentResolver.query()}</code>: - -<p style="margin-left: 2em">{@code content://com.example.project.healthcareprovider/nurses/rn}</p> - -<p> -The {@code content:} scheme identifies the data as belonging to a content -provider and the authority ({@code com.example.project.healthcareprovider}) -identifies the particular provider. The authority therefore must be unique. -Typically, as in this example, it's the fully qualified name of a -ContentProvider subclass. The path part of a URI may be used by a content -provider to identify particular data subsets, but those paths are not -declared in the manifest. -</p> - -<p> -For information on using and developing content providers, see a separate document, -<a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>. -</p></dd> +<dd> + Declares a content provider component. A content provider is a subclass of + {@link android.content.ContentProvider} that supplies structured access to data managed by the + application. All content providers in your application must be defined in a + {@code <provider>} element in the manifest file; otherwise, the system is unaware of them + and doesn't run them. + <p> + You only declare content providers that are part of your application. Content providers in + other applications that you use in your application should not be declared. + </p> + <p> + The Android system stores references to content providers according to an <b>authority</b> + string, part of the provider's <b>content URI</b>. For example, suppose you want to + access a content provider that stores information about health care professionals. To do + this, you call the method + {@link android.content.ContentResolver#query ContentResolver.query()}, which among other + arguments takes a URI that identifies the provider: + </p> +<pre> +content://com.example.project.healthcareprovider/nurses/rn +</pre> + <p> + The <code>content:</code> <b>scheme</b> identifies the URI as a content URI pointing to + an Android content provider. The authority + <code>com.example.project.healthcareprovider</code> identifies the provider itself; the + Android system looks up the authority in its list of known providers and their authorities. + The substring <code>nurses/rn</code> is a <b>path</b>, which the content provider can use + to identify subsets of the provider data. + </p> + <p> + Notice that when you define your provider in the <code><provider></code> element, you + don't include the scheme or the path in the <code>android:name</code> argument, only the + authority. + </p> + <p> + For information on using and developing content providers, see the API Guide, + <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>. + </p> +</dd> <dt>attributes:</dt> -<dd><dl class="attr"> -<dt><a name="auth"></a>{@code android:authorities}</dt> -<dd>A list of one or more URI authorities that identify data under the purview -of the content provider. -Multiple authorities are listed by separating their names with a semicolon. -To avoid conflicts, authority names should use a Java-style naming convention -(such as {@code com.example.provider.cartoonprovider}). Typically, it's the name -of the ContentProvider subclass. - -<p> -There is no default. At least one authority must be specified. -</p></dd> - -<dt><a name="enabled"></a>{@code android:enabled}</dt> -<dd>Whether or not the content provider can be instantiated by the system — -"{@code true}" if it can be, and "{@code false}" if not. The default value -is "{@code true}". - -<p> +<dd> + <dl class="attr"> + <dt><a name="auth"></a>{@code android:authorities}</dt> + <dd> + A list of one or more URI authorities that identify data offered by the content provider. + Multiple authorities are listed by separating their names with a semicolon. + To avoid conflicts, authority names should use a Java-style naming convention + (such as {@code com.example.provider.cartoonprovider}). Typically, it's the name + of the {@link android.content.ContentProvider} subclass that implements the provider + <p> + There is no default. At least one authority must be specified. + </p> + </dd> + + <dt><a name="enabled"></a>{@code android:enabled}</dt> + <dd>Whether or not the content provider can be instantiated by the system — + "{@code true}" if it can be, and "{@code false}" if not. The default value + is "{@code true}". + + <p> The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> element has its own <code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all application components, including content providers. The @@ -93,16 +107,37 @@ are by default) for the content provider to be enabled. If either is </p></dd> <dt><a name="exported"></a>{@code android:exported}</dt> -<dd>Whether or not the content provider can be used by components of other -applications — "{@code true}" if it can be, and "{@code false}" if not. -If "{@code false}", the provider is available only to components of the -same application or applications with the same user ID. The default value -is "{@code true}". - -<p> -You can export a content provider but still limit access to it with the -<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code> attribute. -</p></dd> +<dd> + Whether the content provider is available for other applications to use: + <ul> + <li> + <code>true</code>: The provider is available to other applications. Any application can + use the provider's content URI to access it, subject to the permissions specified for + the provider. + </li> + <li> + <code>false</code>: The provider is not available to other applications. Set + <code>android:exported="false"</code> to limit access to the provider to your + applications. Only applications that have the same user ID (UID) as the provider will + have access to it. + </li> + </ul> + <p> + The default value is <code>"true"</code> for applications that set either +<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">android:minSdkVersion</a></code> + or +<code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">android:targetSdkVersion</a></code> to + <code>"16"</code> or lower. For applications that + set either of these attributes to <code>"17"</code> or higher, the default is + <code>"false"</code>. + </p> + <p> + You can set <code>android:exported="false"</code> and still limit access to your + provider by setting permissions with the + <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#prmsn">permission</a></code> + attribute. + </p> +</dd> <dt><a name="gprmsn"></a>{@code android:grantUriPermissions}</dt> <dd>Whether or not those who ordinarily would not have permission to diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd index a111356..10b5a33 100644 --- a/docs/html/guide/topics/manifest/uses-feature-element.jd +++ b/docs/html/guide/topics/manifest/uses-feature-element.jd @@ -561,7 +561,7 @@ is sensitive to delays or lag in sound input or output.</td> </td> </tr> <tr> - <td rowspan="4">Camera</td> + <td rowspan="5">Camera</td> <td><code>android.hardware.camera</code></td> <td>The application uses the device's camera. If the device supports multiple cameras, the application uses the camera that facing @@ -583,6 +583,12 @@ is sensitive to delays or lag in sound input or output.</td> <td><code>android.hardware.camera.front</code></td> <td>Subfeature. The application uses a front-facing camera on the device.</td> </tr> +<tr> + <td><code>android.hardware.camera.any</code></td> + <td>The application uses at least one camera facing in any direction. Use this +in preference to <code>android.hardware.camera</code> if a back-facing camera is +not required.</td> +</tr> <tr> <td rowspan="3">Location</td> diff --git a/docs/html/guide/topics/providers/content-provider-basics.jd b/docs/html/guide/topics/providers/content-provider-basics.jd index 8c47ad7..527e713 100644 --- a/docs/html/guide/topics/providers/content-provider-basics.jd +++ b/docs/html/guide/topics/providers/content-provider-basics.jd @@ -2,9 +2,7 @@ page.title=Content Provider Basics @jd:body <div id="qv-wrapper"> <div id="qv"> - - - <!-- In this document --> +<!-- In this document --> <h2>In this document</h2> <ol> <li> @@ -238,15 +236,11 @@ page.title=Content Provider Basics </p> <p> For example, to get a list of the words and their locales from the User Dictionary Provider, - you call {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - ContentResolver.query()}. - The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - query()} method calls the - {@link android.content.ContentProvider#query(Uri, String[], String, String[], String) - ContentProvider.query()} method defined by the User Dictionary Provider. The following lines - of code show a - {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - ContentResolver.query()} call: + you call {@link android.content.ContentResolver#query ContentResolver.query()}. + The {@link android.content.ContentResolver#query query()} method calls the + {@link android.content.ContentProvider#query ContentProvider.query()} method defined by the + User Dictionary Provider. The following lines of code show a + {@link android.content.ContentResolver#query ContentResolver.query()} call: <p> <pre> // Queries the user dictionary and returns results @@ -259,7 +253,7 @@ mCursor = getContentResolver().query( </pre> <p> Table 2 shows how the arguments to - {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) + {@link android.content.ContentResolver#query query(Uri,projection,selection,selectionArgs,sortOrder)} match an SQL SELECT statement: </p> <p class="table-caption"> @@ -344,7 +338,7 @@ content://user_dictionary/words <code>4</code> from user dictionary, you can use this content URI: </p> <pre> -Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4); +Uri singleUri = ContentUris.withAppendedId(UserDictionary.Words.CONTENT_URI,4); </pre> <p> You often use id values when you've retrieved a set of rows and then want to update or delete @@ -354,7 +348,7 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4); <strong>Note:</strong> The {@link android.net.Uri} and {@link android.net.Uri.Builder} classes contain convenience methods for constructing well-formed Uri objects from strings. The {@link android.content.ContentUris} contains convenience methods for appending id values to - a URI. The previous snippet uses {@link android.content.ContentUris#withAppendedId(Uri, long) + a URI. The previous snippet uses {@link android.content.ContentUris#withAppendedId withAppendedId()} to append an id to the UserDictionary content URI. </p> @@ -367,10 +361,9 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4); </p> <p class="note"> For the sake of clarity, the code snippets in this section call - {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - ContentResolver.query()} on the "UI thread"". In actual code, however, you should - do queries asynchronously on a separate thread. One way to do this is to use the - {@link android.content.CursorLoader} class, which is described + {@link android.content.ContentResolver#query ContentResolver.query()} on the "UI thread"". In + actual code, however, you should do queries asynchronously on a separate thread. One way to do + this is to use the {@link android.content.CursorLoader} class, which is described in more detail in the <a href="{@docRoot}guide/components/loaders.html"> Loaders</a> guide. Also, the lines of code are snippets only; they don't show a complete application. @@ -391,8 +384,8 @@ Uri singleUri = ContentUri.withAppendedId(UserDictionary.Words.CONTENT_URI,4); To retrieve data from a provider, your application needs "read access permission" for the provider. You can't request this permission at run-time; instead, you have to specify that you need this permission in your manifest, using the - <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"> - <uses-permission></a></code> element and the exact permission name defined by the +<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> + element and the exact permission name defined by the provider. When you specify this element in your manifest, you are in effect "requesting" this permission for your application. When users install your application, they implicitly grant this request. @@ -436,10 +429,9 @@ String[] mSelectionArgs = {""}; </pre> <p> The next snippet shows how to use - {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - ContentResolver.query()}, using the User Dictionary Provider as an example. - A provider client query is similar to an SQL query, and it contains a set of columns to return, - a set of selection criteria, and a sort order. + {@link android.content.ContentResolver#query ContentResolver.query()}, using the User Dictionary + Provider as an example. A provider client query is similar to an SQL query, and it contains a + set of columns to return, a set of selection criteria, and a sort order. </p> <p> The set of columns that the query should return is called a <strong>projection</strong> @@ -448,9 +440,9 @@ String[] mSelectionArgs = {""}; <p> The expression that specifies the rows to retrieve is split into a selection clause and selection arguments. The selection clause is a combination of logical and Boolean expressions, - column names, and values (the variable <code>mSelection</code>). If you specify the replaceable - parameter <code>?</code> instead of a value, the query method retrieves the value from the - selection arguments array (the variable <code>mSelectionArgs</code>). + column names, and values (the variable <code>mSelectionClause</code>). If you specify the + replaceable parameter <code>?</code> instead of a value, the query method retrieves the value + from the selection arguments array (the variable <code>mSelectionArgs</code>). </p> <p> In the next snippet, if the user doesn't enter a word, the selection clause is set to @@ -517,7 +509,7 @@ if (null == mCursor) { This query is analogous to the SQL statement: </p> <pre> -SELECT _ID, word, frequency, locale FROM words WHERE word = <userinput> ORDER BY word ASC; +SELECT _ID, word, locale FROM words WHERE word = <userinput> ORDER BY word ASC; </pre> <p> In this SQL statement, the actual column names are used instead of contract class constants. @@ -575,16 +567,15 @@ selectionArgs[0] = mUserInput; <!-- Displaying the results --> <h3 id="DisplayResults">Displaying query results</h3> <p> - The {@link android.content.ContentResolver#query(Uri, String[], String, String[], String) - ContentResolver.query()} client method always returns a {@link android.database.Cursor} - containing the columns specified by the query's projection for the rows that match the query's - selection criteria. A {@link android.database.Cursor} object provides random read access to the - rows and columns it contains. Using {@link android.database.Cursor} methods, - you can iterate over the rows in the results, determine the data type of each column, get the - data out of a column, and examine other properties of the results. Some - {@link android.database.Cursor} implementations automatically update the object when the - provider's data changes, or trigger methods in an observer object when the - {@link android.database.Cursor} changes, or both. + The {@link android.content.ContentResolver#query ContentResolver.query()} client method always + returns a {@link android.database.Cursor} containing the columns specified by the query's + projection for the rows that match the query's selection criteria. A + {@link android.database.Cursor} object provides random read access to the rows and columns it + contains. Using {@link android.database.Cursor} methods, you can iterate over the rows in the + results, determine the data type of each column, get the data out of a column, and examine other + properties of the results. Some {@link android.database.Cursor} implementations automatically + update the object when the provider's data changes, or trigger methods in an observer object + when the {@link android.database.Cursor} changes, or both. </p> <p class="note"> <strong>Note:</strong> A provider may restrict access to columns based on the nature of the @@ -594,7 +585,7 @@ selectionArgs[0] = mUserInput; <p> If no rows match the selection criteria, the provider returns a {@link android.database.Cursor} object for which - {@link android.database.Cursor#getCount() Cursor.getCount()} is 0 (an empty cursor). + {@link android.database.Cursor#getCount Cursor.getCount()} is 0 (an empty cursor). </p> <p> If an internal error occurs, the results of the query depend on the particular provider. It may @@ -685,8 +676,8 @@ if (mCursor != null) { <p> {@link android.database.Cursor} implementations contain several "get" methods for retrieving different types of data from the object. For example, the previous snippet - uses {@link android.database.Cursor#getString(int) getString()}. They also have a - {@link android.database.Cursor#getType(int) getType()} method that returns a value indicating + uses {@link android.database.Cursor#getString getString()}. They also have a + {@link android.database.Cursor#getType getType()} method that returns a value indicating the data type of the column. </p> @@ -713,17 +704,16 @@ if (mCursor != null) { </p> <p> To get the permissions needed to access a provider, an application requests them with a - <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"> - <uses-permission></a></code> element in its manifest file. - When the Android Package Manager installs the application, a user must approve all of the - permissions the application requests. If the user approves all of them, Package Manager - continues the installation; if the user doesn't approve them, Package Manager +<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> + element in its manifest file. When the Android Package Manager installs the application, a user + must approve all of the permissions the application requests. If the user approves all of them, + Package Manager continues the installation; if the user doesn't approve them, Package Manager aborts the installation. </p> <p> The following - <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"> - <uses-permission></a></code> element requests read access to the User Dictionary Provider: +<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> + element requests read access to the User Dictionary Provider: </p> <pre> <uses-permission android:name="android.permission.READ_USER_DICTIONARY"> @@ -746,7 +736,7 @@ if (mCursor != null) { <h3 id="Inserting">Inserting data</h3> <p> To insert data into a provider, you call the - {@link android.content.ContentResolver#insert(Uri,ContentValues) ContentResolver.insert()} + {@link android.content.ContentResolver#insert ContentResolver.insert()} method. This method inserts a new row into the provider and returns a content URI for that row. This snippet shows how to insert a new word into the User Dictionary Provider: </p> @@ -777,8 +767,7 @@ mNewUri = getContentResolver().insert( The data for the new row goes into a single {@link android.content.ContentValues} object, which is similar in form to a one-row cursor. The columns in this object don't need to have the same data type, and if you don't want to specify a value at all, you can set a column - to <code>null</code> using {@link android.content.ContentValues#putNull(String) - ContentValues.putNull()}. + to <code>null</code> using {@link android.content.ContentValues#putNull ContentValues.putNull()}. </p> <p> The snippet doesn't add the <code>_ID</code> column, because this column is maintained @@ -799,17 +788,16 @@ content://user_dictionary/words/<id_value> </p> <p> To get the value of <code>_ID</code> from the returned {@link android.net.Uri}, call - {@link android.content.ContentUris#parseId(Uri) ContentUris.parseId()}. + {@link android.content.ContentUris#parseId ContentUris.parseId()}. </p> <h3 id="Updating">Updating data</h3> <p> To update a row, you use a {@link android.content.ContentValues} object with the updated values just as you do with an insertion, and selection criteria just as you do with a query. The client method you use is - {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[]) - ContentResolver.update()}. You only need to add values to the - {@link android.content.ContentValues} object for columns you're updating. If you want to clear - the contents of a column, set the value to <code>null</code>. + {@link android.content.ContentResolver#update ContentResolver.update()}. You only need to add + values to the {@link android.content.ContentValues} object for columns you're updating. If you + want to clear the contents of a column, set the value to <code>null</code>. </p> <p> The following snippet changes all the rows whose locale has the language "en" to a @@ -842,9 +830,8 @@ mRowsUpdated = getContentResolver().update( </pre> <p> You should also sanitize user input when you call - {@link android.content.ContentResolver#update(Uri, ContentValues, String, String[]) - ContentResolver.update()}. To learn more about this, read the section - <a href="#Injection">Protecting against malicious input</a>. + {@link android.content.ContentResolver#update ContentResolver.update()}. To learn more about + this, read the section <a href="#Injection">Protecting against malicious input</a>. </p> <h3 id="Deleting">Deleting data</h3> <p> @@ -873,9 +860,8 @@ mRowsDeleted = getContentResolver().delete( </pre> <p> You should also sanitize user input when you call - {@link android.content.ContentResolver#delete(Uri, String, String[]) - ContentResolver.delete()}. To learn more about this, read the section - <a href="#Injection">Protecting against malicious input</a>. + {@link android.content.ContentResolver#delete ContentResolver.delete()}. To learn more about + this, read the section <a href="#Injection">Protecting against malicious input</a>. </p> <!-- Provider Data Types --> <h2 id="DataTypes">Provider Data Types</h2> @@ -907,7 +893,7 @@ mRowsDeleted = getContentResolver().delete( The data types for the User Dictionary Provider are listed in the reference documentation for its contract class {@link android.provider.UserDictionary.Words} (contract classes are described in the section <a href="#ContractClasses">Contract Classes</a>). - You can also determine the data type by calling {@link android.database.Cursor#getType(int) + You can also determine the data type by calling {@link android.database.Cursor#getType Cursor.getType()}. </p> <p> @@ -918,7 +904,7 @@ mRowsDeleted = getContentResolver().delete( data structures or files. For example, the {@link android.provider.ContactsContract.Data} table in the Contacts Provider uses MIME types to label the type of contact data stored in each row. To get the MIME type corresponding to a content URI, call - {@link android.content.ContentResolver#getType(Uri) ContentResolver.getType()}. + {@link android.content.ContentResolver#getType ContentResolver.getType()}. </p> <p> The section <a href="#MIMETypeReference">MIME Type Reference</a> describes the @@ -935,8 +921,7 @@ mRowsDeleted = getContentResolver().delete( <li> <a href="#Batch">Batch access</a>: You can create a batch of access calls with methods in the {@link android.content.ContentProviderOperation} class, and then apply them with - {@link android.content.ContentResolver#applyBatch(String, ArrayList) - ContentResolver.applyBatch()}. + {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}. </li> <li> Asynchronous queries: You should do queries in a separate thread. One way to do this is to @@ -963,11 +948,10 @@ mRowsDeleted = getContentResolver().delete( To access a provider in "batch mode", you create an array of {@link android.content.ContentProviderOperation} objects and then dispatch them to a content provider with - {@link android.content.ContentResolver#applyBatch(String, ArrayList) - ContentResolver.applyBatch()}. You pass the content provider's <em>authority</em> to this - method, rather than a particular content URI, which allows each - {@link android.content.ContentProviderOperation} object in the array to work against a - different table. A call to {@link android.content.ContentResolver#applyBatch(String, ArrayList) + {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()}. You pass the + content provider's <em>authority</em> to this method, rather than a particular content URI. + This allows each {@link android.content.ContentProviderOperation} object in the array to work + against a different table. A call to {@link android.content.ContentResolver#applyBatch ContentResolver.applyBatch()} returns an array of results. </p> <p> @@ -1028,14 +1012,13 @@ mRowsDeleted = getContentResolver().delete( </p> <p> A provider defines URI permissions for content URIs in its manifest, using the - <code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn"> - android:grantUriPermission</a></code> - attribute of the <a href="{@docRoot}guide/topics/manifest/provider-element.html"> - {@code <provider>}</a> +<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmsn">android:grantUriPermission</a></code> + attribute of the +<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> element, as well as the - <a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">{@code - <grant-uri-permission>}</a> child element of the - <a href="{@docRoot}guide/topics/manifest/provider-element.html">{@code <provider>}</a> +<code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code> + child element of the +<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> element. The URI permissions mechanism is explained in more detail in the <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a> guide, in the section "URI Permissions". @@ -1053,7 +1036,7 @@ mRowsDeleted = getContentResolver().delete( Your application sends an intent containing the action {@link android.content.Intent#ACTION_PICK} and the "contacts" MIME type {@link android.provider.ContactsContract.RawContacts#CONTENT_ITEM_TYPE}, using the - method {@link android.app.Activity#startActivityForResult(Intent, int) + method {@link android.app.Activity#startActivityForResult startActivityForResult()}. </li> <li> @@ -1063,7 +1046,7 @@ mRowsDeleted = getContentResolver().delete( <li> In the selection activity, the user selects a contact to update. When this happens, the selection activity calls - {@link android.app.Activity#setResult(int, Intent) setResult(resultcode, intent)} + {@link android.app.Activity#setResult setResult(resultcode, intent)} to set up a intent to give back to your application. The intent contains the content URI of the contact the user selected, and the "extras" flags {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}. These flags grant URI @@ -1073,7 +1056,7 @@ mRowsDeleted = getContentResolver().delete( </li> <li> Your activity returns to the foreground, and the system calls your activity's - {@link android.app.Activity#onActivityResult(int, int, Intent) onActivityResult()} + {@link android.app.Activity#onActivityResult onActivityResult()} method. This method receives the result intent created by the selection activity in the People app. </li> diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index cf2c03e..b311b7f 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -329,6 +329,39 @@ your application for other languages.</p> indicates the current locale.</p> </td> </tr> + <tr id="LayoutDirectionQualifier"> + <td>Layout Direction</td> + <td><code>ldrtl</code><br/> + <code>ldltr</code><br/> + </td> + <td><p>The layout direction of your application. {@code ldrtl} means "layout-direction-right-to-left". + {@code ldltr} means "layout-direction-left-to-right" and is the default implicit value. + </p> + <p>This can apply to any resource such as layouts, drawables, or values. + </p> + <p>For example, if you want to provide some specific layout for the Arabic language and some + generic layout for any other "right-to-left" language (like Persian or Hebrew) then you would have: + </p> +<pre class="classic no-pretty-print"> +res/ + layout/ <span style="color:black"> + main.xml </span>(Default layout) + layout-ar/ <span style="color:black"> + main.xml </span>(Specific layout for Arabic) + layout-ldrtl/ <span style="color:black"> + main.xml </span>(Any "right-to-left" language, except + for Arabic, because the "ar" language qualifier + has a higher precedence.) +</pre> + <p class="note"><strong>Note:</strong> To enable right-to-left layout features + for your app, you must set <a + href="{@docRoot}guide/topics/manifest/application-element.html#supportsrtl">{@code + supportsRtl}</a> to {@code "true"} and set <a + href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target" + >{@code targetSdkVersion}</a> to 17 or higher.</p> + <p><em>Added in API level 17.</em></p> + </td> + </tr> <tr id="SmallestScreenWidthQualifier"> <td>smallestWidth</td> <td><code>sw<N>dp</code><br/><br/> diff --git a/docs/html/guide/topics/resources/string-resource.jd b/docs/html/guide/topics/resources/string-resource.jd index 5f5484e..da410a4 100644 --- a/docs/html/guide/topics/resources/string-resource.jd +++ b/docs/html/guide/topics/resources/string-resource.jd @@ -13,8 +13,7 @@ your application with strings:</p> <dt><a href="#StringArray">String Array</a></dt> <dd>XML resource that provides an array of strings.</dd> <dt><a href="#Plurals">Quantity Strings (Plurals)</a></dt> - <dd>XML resource that carries different strings for different quantities - of the same word or phrase.</dd> + <dd>XML resource that carries different strings for pluralization.</dd> </dl> <p>All strings are capable of applying some styling markup and formatting arguments. For @@ -231,10 +230,19 @@ so Android provides you with methods such as {@link android.content.res.Resources#getQuantityString(int,int) getQuantityString()} to select the appropriate resource for you. -<p>Note that the selection is made based on grammatical necessity. A string for <code>zero</code> -in English will be ignored even if the quantity is 0, because 0 isn't grammatically different -from 2, or any other number except 1 ("zero books", "one book", "two books", and so on). -Don't be misled either by the fact that, say, <code>two</code> sounds like it could only apply to +<p>Although historically called "quantity strings" (and still called that in API), quantity +strings should <i>only</i> be used for plurals. It would be a mistake to use quantity strings to +implement something like Gmail's "Inbox" versus "Inbox (12)" when there are unread messages, for +example. It might seem convenient to use quantity strings instead of an {@code if} statement, +but it's important to note that some languages (such as Chinese) don't make these grammatical +distinctions at all, so you'll always get the <code>other</code> string. + +<p>The selection of which string to use is made solely based on grammatical <i>necessity</i>. +In English, a string for <code>zero</code> will be ignored even if the quantity is 0, because 0 +isn't grammatically different from 2, or any other number except 1 ("zero books", "one book", +"two books", and so on). + +<p>Don't be misled either by the fact that, say, <code>two</code> sounds like it could only apply to the quantity 2: a language may require that 2, 12, 102 (and so on) are all treated like one another but differently to other quantities. Rely on your translator to know what distinctions their language actually insists upon. @@ -313,7 +321,7 @@ values, with non-exhaustive examples in parentheses: <td>{@code one}</td><td>When the language requires special treatment of numbers like one (as with the number 1 in English and most other languages; in Russian, any number ending in 1 but not ending in 11 is in this class).</td> </tr> <tr> - <td>{@code two}</td><td>When the language requires special treatment of numbers like two (as in Welsh).</td> + <td>{@code two}</td><td>When the language requires special treatment of numbers like two (as with 2 in Welsh, or 102 in Slovenian).</td> </tr> <tr> <td>{@code few}</td><td>When the language requires special treatment of "small" numbers (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14 in Polish).</td> @@ -322,7 +330,7 @@ values, with non-exhaustive examples in parentheses: <td>{@code many}</td><td>When the language requires special treatment of "large" numbers (as with numbers ending 11-99 in Maltese).</td> </tr> <tr> - <td>{@code other}</td><td>When the language does not require special treatment of the given quantity.</td> + <td>{@code other}</td><td>When the language does not require special treatment of the given quantity (as with all numbers in Chinese, or 42 in English).</td> </tr> </table> </dd> diff --git a/docs/html/images/testing/UIAutomatorViewer.png b/docs/html/images/testing/UIAutomatorViewer.png Binary files differnew file mode 100644 index 0000000..5a4aaa4 --- /dev/null +++ b/docs/html/images/testing/UIAutomatorViewer.png diff --git a/docs/html/images/tools/dev-options-inmilk.png b/docs/html/images/tools/dev-options-inmilk.png Binary files differnew file mode 100644 index 0000000..f0e323e --- /dev/null +++ b/docs/html/images/tools/dev-options-inmilk.png diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd index 6154d96..e0d0d3f 100644 --- a/docs/html/tools/building/building-cmdline.jd +++ b/docs/html/tools/building/building-cmdline.jd @@ -261,8 +261,18 @@ adb -s emulator-5554 install <em>path/to/your/app</em>.apk device:</p> <ul> - <li>Enable USB Debugging on your device. You can find the setting on most Android devices by - going to <strong>Settings > Applications > Development > USB debugging</strong>.</li> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> + </li> <li>Ensure that your development computer can detect your device when connected via USB</li> </ul> diff --git a/docs/html/tools/building/building-eclipse.jd b/docs/html/tools/building/building-eclipse.jd index c73fe97..304aa7e 100644 --- a/docs/html/tools/building/building-eclipse.jd +++ b/docs/html/tools/building/building-eclipse.jd @@ -84,8 +84,18 @@ parent.link=index.html <code>android:debuggable</code> attribute of the <code><application></code> element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li> - <li>Enable USB Debugging on your device. You can find the setting on most Android devices by - going to <strong>Settings > Applications > Development > USB debugging</strong>.</li> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> + </li> <li>Ensure that your development computer can detect your device when connected via USB</li> </ul> diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd index d5fd581..61cd08a 100644 --- a/docs/html/tools/device.jd +++ b/docs/html/tools/device.jd @@ -58,11 +58,17 @@ the <code><application></code> element.</p> <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest file, be sure to disable it before you build for release (your published application should usually <em>not</em> be debuggable).</p></li> - <li>Turn on "USB Debugging" on your device. - <p>On the device, go to <strong>Settings > Applications > Development</strong> - and enable <strong>USB debugging</strong> - (on an Android 4.0 device, the setting is -located in <strong>Settings > Developer options</strong>).</p> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> </li> <li>Set up your system to detect your device. <ul> diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd index b1e2ea0..08ac172 100644 --- a/docs/html/tools/extras/support-library.jd +++ b/docs/html/tools/extras/support-library.jd @@ -46,52 +46,75 @@ by the directory name, such as {@code v4/} and {@code v13/}.</p> <p>The sections below provide notes about successive releases of the Support Package, as denoted by revision number.</p> -<script type="text/javascript"> -function toggleDiv(link) { - var toggleable = $(link).parent(); - if (toggleable.hasClass("closed")) { - //$(".toggleme", toggleable).slideDown("fast"); - toggleable.removeClass("closed"); - toggleable.addClass("open"); - $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + -"assets/images/triangle-opened.png")); - } else { - //$(".toggleme", toggleable).slideUp("fast"); - toggleable.removeClass("open"); - toggleable.addClass("closed"); - $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + -"assets/images/triangle-closed.png")); - } - return false; -} -</script> -<style> -.toggleable { -padding: 5px 0 0; -} -.toggleme { - padding: 10px 0 0 20px; -} -.toggleable a { - text-decoration:none; -} -.toggleme a { - text-decoration:underline; -} -.toggleable.closed .toggleme { - display:none; -} -#jd-content .toggle-img { - margin:0 5px 3px 0; -} -</style> +<div class="toggle-content opened"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt="" +/>Support Package, revision 11</a> <em>(November 2012)</em> + </p> + <div class="toggle-content-toggleme"> + <dl> + <dt>Changes for v4 support library:</dt> + <dd> + <ul> + <li>User Interface + <ul> + <li>Added support for nested {@link android.support.v4.app.Fragment} classes.</li> + <li>Added improvements to {@link android.support.v4.app.FragmentManager} debugging. + </li> + <li>Fixed problem in {@link android.support.v4.app.FragmentTabHost} where fragment + and tab interaction could result in a {@link android.widget.ListView} state loss. + </li> + <li>Fixed issue with user-visible hint in + {@link android.support.v4.app.FragmentStatePagerAdapter}.</li> + <li>Added {@link android.support.v4.view.ViewPager.PageTransformer PageTransformer} + interface to {@link android.support.v4.view.ViewPager} to allow applications to + supply a custom transition behavior for scrolling.</li> + <li>Added new features and fixes to {@link android.support.v4.app.TaskStackBuilder} + from current release.</li> + <li>Fixed {@link android.support.v4.view.PagerTitleStrip} to correctly track the + {@link android.support.v4.view.PagerAdapter} currently in use.</li> + <li>Fixed display flickering, positioning, and text clipping problems with + {@link android.support.v4.view.PagerTitleStrip}.</li> + <li>Fixed {@link android.support.v4.view.PagerTabStrip} to properly respect padding + when drawing an underline.</li> + </ul> + </li> + <li>Accessibility + <ul> + <li>Added support for new accessibility gesture and touch event types in + {@link android.support.v4.view.accessibility.AccessibilityEventCompat}.</li> + <li>Added support for new accessibility APIs in + {@link android.support.v4.view.ViewCompat}.</li> + <li>Added support for {@link android.support.v4.view.ViewCompat#performAccessibilityAction + performAccessibilityAction()} method to {@link android.support.v4.view.ViewCompat}. + </li> + </ul> + </li> + <li>Added support for gestures with {@link android.support.v4.view.GestureDetectorCompat}. + </li> + <li>Added support for performing atomic operations on files using a new + {@link android.support.v4.util.AtomicFile} class.</li> + <li>Added support for the full set of {@code make} methods in + {@link android.support.v4.content.IntentCompat}.</li> + <li>Added {@link android.support.v4.util.LruCache#trimToSize trimToSize()} method in + {@link android.support.v4.util.LruCache} utility class.</li> + <li>Updated {@link android.support.v4.net.ConnectivityManagerCompat} to get NetworkInfo + from a {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} + broadcast.</li> + </ul> + </dd> + </dl> + </div> +</div> + -<div class="toggleable opened"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 10</a> <em>(August 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -105,11 +128,12 @@ padding: 5px 0 0; </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 9</a> <em>(June 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -173,11 +197,12 @@ isActiveNetworkMetered()} method.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 8</a> <em>(April 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -194,11 +219,12 @@ isActiveNetworkMetered()} method.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 7</a> <em>(March 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -209,7 +235,7 @@ attributing shared data to the source app. This class also provides compatible i new {@link android.widget.ShareActionProvider} in Android 4.0.</li> <li>Added {@link android.support.v4.app.NavUtils} and {@link android.support.v4.app.TaskStackBuilder} to provide support for implementing the -<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These +<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These additions include a way to implement the action bar's <em>Up</em> button across versions. For an example implementation of this pattern, see the AppNavigation sample in ({@code <em><sdk></em>/samples/<em><platform></em>/AppNavigation}).</li> @@ -222,11 +248,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 6</a> <em>(December 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <p class="note"><strong>Note:</strong> Reference for support library APIs are now available with the framework references, for example: {@link android.support.v4.app}.</p> @@ -274,11 +301,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 5</a> <em>(December 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -332,11 +360,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Support Package, revision 4</a> <em>(October 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -373,11 +402,12 @@ for creating standardized system notifications.</li> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Compatibility Package, revision 3</a> <em>(July 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -423,11 +453,12 @@ Android 3.2 and higher (all other APIs in the v4 library are already available w </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Compatibility Package, revision 2</a> <em>(May 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 library:</dt> <dd> @@ -442,11 +473,12 @@ Android 3.2 and higher (all other APIs in the v4 library are already available w </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Compatibility Package, revision 1</a> <em>(March 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <p>Initial release with the v4 library.</p> </div> </div> diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd index 282c791..19891e8 100644 --- a/docs/html/tools/help/android.jd +++ b/docs/html/tools/help/android.jd @@ -280,7 +280,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>create-test-project</code></td> + <td rowspan="3"><code>create test-project</code></td> <td><code>-n <name></code></td> @@ -306,7 +306,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="2"><code>update-test-project</code></td> + <td rowspan="2"><code>update test-project</code></td> <td><code>-p <path></code></td> @@ -324,7 +324,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="4"><code>create-lib-project</code></td> + <td rowspan="4"><code>create lib-project</code></td> <td><code>-k <packageName></code></td> @@ -358,7 +358,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>update-lib-project</code></td> + <td rowspan="3"><code>update lib-project</code></td> <td><code>-p <path></code></td> @@ -382,6 +382,30 @@ and may be out of date. For the most current list of options, execute <code>andr <td></td> </tr> + + <tr> + <td rowspan="3"><code>create uitest-project</code></td> + <td><code>-n <name></code></td> + <td>The name of the UI test project</td> + <td></td> + </tr> + + <tr> + <td><code>-t <name></code></td> + + <td>Target ID of the UI test project</td> + + <td>Required</td> + </tr> + + <tr> + <td><code>-p <path></code></td> + + <td>Location path of the UI test project</td> + + <td>Required</td> + </tr> + </table> <h3>Update actions</h3> diff --git a/docs/html/tools/help/uiautomator/IAutomationSupport.jd b/docs/html/tools/help/uiautomator/IAutomationSupport.jd new file mode 100644 index 0000000..4120f2b --- /dev/null +++ b/docs/html/tools/help/uiautomator/IAutomationSupport.jd @@ -0,0 +1,168 @@ +page.title=IAutomationSupport +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>Provides auxiliary support for running test cases + +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sendStatus(int, android.os.Bundle)">sendStatus</a></span>(int resultCode, Bundle status) + + <div class="jd-descrdiv">Allows the running test cases to send out interim status</div> + + </td></tr> + + + +</table> + + + + + + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="sendStatus(int, android.os.Bundle)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + void + </span> + <span class="sympad">sendStatus</span> + <span class="normal">(int resultCode, Bundle status)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Allows the running test cases to send out interim status</p></div> + + </div> +</div> + + + diff --git a/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd new file mode 100644 index 0000000..48c63ba --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd @@ -0,0 +1,1402 @@ +page.title=UiAutomatorTestCase +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<h2>Class Overview</h2> +<p>UI automation tests should extend this class. This class provides access + to the following: +<ul> +<li><code><a href="UiDevice.html">UiDevice</a></code> instance</li> +<li>Bundle for command line parameters</li> +</ul> +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiAutomatorTestCase()">UiAutomatorTestCase</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getAutomationSupport()">getAutomationSupport</a></span>() + + <div class="jd-descrdiv">Provides support for running tests to report interim status</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Bundle + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getParams()">getParams</a></span>() + + <div class="jd-descrdiv">Get command line parameters.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getUiDevice()">getUiDevice</a></span>() + + <div class="jd-descrdiv">Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep(long)">sleep</a></span>(long ms) + + <div class="jd-descrdiv">Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.TestCase" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.TestCase-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.TestCase + +<div id="inherited-methods-junit.framework.TestCase"> + <div id="inherited-methods-junit.framework.TestCase-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.TestCase-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getName</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + TestResult + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">runBare</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setName</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Assert" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Assert-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.Assert + +<div id="inherited-methods-junit.framework.Assert"> + <div id="inherited-methods-junit.framework.Assert-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Assert-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(short arg0, short arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, int arg1, int arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, short arg1, short arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(char arg0, char arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1, String arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(int arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, double arg1, double arg2, double arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, long arg1, long arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(byte arg0, byte arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(boolean arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, float arg1, float arg2, float arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, boolean arg1, boolean arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(float arg0, float arg1, float arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, byte arg1, byte arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(double arg0, double arg1, double arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, char arg1, char arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(long arg0, long arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failSame</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">format</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Test" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Test-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From interface + + junit.framework.Test + +<div id="inherited-methods-junit.framework.Test"> + <div id="inherited-methods-junit.framework.Test-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Test-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiAutomatorTestCase()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiAutomatorTestCase</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="getAutomationSupport()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </span> + <span class="sympad">getAutomationSupport</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Provides support for running tests to report interim status</p></div> + + </div> +</div> + + +<a id="getParams()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Bundle + </span> + <span class="sympad">getParams</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get command line parameters. On the command line when passing <code>-e key value</code> + pairs, the Bundle will have the key value pairs conveniently available to the + tests. +</p></div> + + </div> +</div> + + +<a id="getUiDevice()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getUiDevice</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>. Works similar to calling the static + <code><a href="UiDevice.html#getInstance()">getInstance()</a></code> from anywhere in the test classes. +</p></div> + + </div> +</div> + + +<a id="sleep(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">(long ms)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>ms</th> + <td>is in milliseconds. +</td> + </tr> + </table> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiCollection.jd b/docs/html/tools/help/uiautomator/UiCollection.jd new file mode 100644 index 0000000..ed92ca7 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiCollection.jd @@ -0,0 +1,1271 @@ +page.title=UiCollection +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Used to enumerate a container's user interface (UI) elements for the purpose of counting, + or targeting a sub elements by a child's text or description. +</p> + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiCollection(com.android.uiautomator.core.UiSelector)">UiCollection</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + +<a id="UiCollection(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiCollection</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has content-description text. + The returned UiObject will point at the <code>childPattern</code> instance that matched the + search and not at the identifying child element that matched the content description.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that is at the <code>instance</code> + specified. The operation is performed only on the visible items and no scrolling is performed + in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has a text attribute equal to + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the identifying child element that matched the + text attribute.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern)</span> + </h4> + <div class="api-level"> + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts child UI element instances matching the <code>childPattern</code> + argument. The method returns the number of matching UI elements that are + currently visible. The count does not include items of a scrollable list + that are off-screen.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> that represents the matching child UI + elements to count</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the number of matched childPattern under the current <code><a href="UiCollection.html">UiCollection</a></code> +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiDevice.jd b/docs/html/tools/help/uiautomator/UiDevice.jd new file mode 100644 index 0000000..0c0c7d9 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiDevice.jd @@ -0,0 +1,3058 @@ +page.title=UiDevice +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>UiDevice provides access to state information about the device. + You can also use this class to simulate user actions on the device, + such as pressing the d-pad or pressing the Home and Menu buttons.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearLastTraversedText()">clearLastTraversedText</a></span>() + + <div class="jd-descrdiv">Clears the text from the last UI traversal event.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click(int, int)">click</a></span>(int x, int y) + + <div class="jd-descrdiv">Perform a click at arbitrary coordinates specified by the user</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#dumpWindowHierarchy(java.lang.String)">dumpWindowHierarchy</a></span>(String fileName) + + <div class="jd-descrdiv">Helper method used for debugging to dump the current window's layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#freezeRotation()">freezeRotation</a></span>() + + <div class="jd-descrdiv">Disables the sensors and freezes the device rotation at its + current rotation state.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentActivityName()">getCurrentActivityName</a></span>() + + <div class="jd-descrdiv"> + <em> + This method is deprecated. + The results returned should be considered unreliable</em></div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentPackageName()">getCurrentPackageName</a></span>() + + <div class="jd-descrdiv">Retrieves the name of the last package to report accessibility events.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayHeight()">getDisplayHeight</a></span>() + + <div class="jd-descrdiv">Gets the height of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayRotation()">getDisplayRotation</a></span>() + + <div class="jd-descrdiv">Returns the current rotation of the display, as defined in Surface@return</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayWidth()">getDisplayWidth</a></span>() + + <div class="jd-descrdiv">Gets the width of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + static + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getInstance()">getInstance</a></span>() + + <div class="jd-descrdiv">Retrieves a singleton instance of UiDevice</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getLastTraversedText()">getLastTraversedText</a></span>() + + <div class="jd-descrdiv">Retrieves the text from the last UI traversal event received.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getProductName()">getProductName</a></span>() + + <div class="jd-descrdiv">Retrieves the product name of the device.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasAnyWatcherTriggered()">hasAnyWatcherTriggered</a></span>() + + <div class="jd-descrdiv">Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered</a></span>(String watcherName) + + <div class="jd-descrdiv">Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isNaturalOrientation()">isNaturalOrientation</a></span>() + + <div class="jd-descrdiv">Check if the device is in its natural orientation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScreenOn()">isScreenOn</a></span>() + + <div class="jd-descrdiv">Checks the power manager if the screen is ON.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressBack()">pressBack</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the BACK button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadCenter()">pressDPadCenter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the CENTER button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadDown()">pressDPadDown</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DOWN button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadLeft()">pressDPadLeft</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the LEFT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadRight()">pressDPadRight</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the RIGHT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadUp()">pressDPadUp</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the UP button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDelete()">pressDelete</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DELETE key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressEnter()">pressEnter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the ENTER key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressHome()">pressHome</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the HOME button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int)">pressKeyCode</a></span>(int keyCode) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int, int)">pressKeyCode</a></span>(int keyCode, int metaState) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressMenu()">pressMenu</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the MENU button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressRecentApps()">pressRecentApps</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the Recent Apps button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressSearch()">pressSearch</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the SEARCH button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher</a></span>(String name, <a href="UiWatcher.html">UiWatcher</a> watcher) + + <div class="jd-descrdiv">Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#removeWatcher(java.lang.String)">removeWatcher</a></span>(String name) + + <div class="jd-descrdiv">Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#resetWatcherTriggers()">resetWatcherTriggers</a></span>() + + <div class="jd-descrdiv">Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#runWatchers()">runWatchers</a></span>() + + <div class="jd-descrdiv">This method forces all registered watchers to run.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationLeft()">setOrientationLeft</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the left and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationNatural()">setOrientationNatural</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationRight()">setOrientationRight</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the right and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep()">sleep</a></span>() + + <div class="jd-descrdiv">This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(android.graphics.Point[], int)">swipe</a></span>(Point[] segments, int segmentSteps) + + <div class="jd-descrdiv">Performs a swipe between points in the Point array.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(int, int, int, int, int)">swipe</a></span>(int startX, int startY, int endX, int endY, int steps) + + <div class="jd-descrdiv">Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File, float, int)">takeScreenshot</a></span>(File storePath, float scale, int quality) + + <div class="jd-descrdiv">Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File)">takeScreenshot</a></span>(File storePath) + + <div class="jd-descrdiv">Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#unfreezeRotation()">unfreezeRotation</a></span>() + + <div class="jd-descrdiv">Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle(long)">waitForIdle</a></span>(long time) + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle()">waitForIdle</a></span>() + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForWindowUpdate(java.lang.String, long)">waitForWindowUpdate</a></span>(String packageName, long timeout) + + <div class="jd-descrdiv">Waits for a window content update event to occur.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#wakeUp()">wakeUp</a></span>() + + <div class="jd-descrdiv">This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the text from the last UI traversal event. + See <code><a href="#getLastTraversedText()">getLastTraversedText()</a></code>.</p></div> + + </div> +</div> + + +<a id="click(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">(int x, int y)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a click at arbitrary coordinates specified by the user</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>x</th> + <td>coordinate</td> + </tr> + <tr> + <th>y</th> + <td>coordinate</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the click succeeded else false</li></ul> + </div> + + </div> +</div> + + +<a id="dumpWindowHierarchy(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">dumpWindowHierarchy</span> + <span class="normal">(String fileName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Helper method used for debugging to dump the current window's layout hierarchy. + The file root location is /data/local/tmp</p></div> + + </div> +</div> + + +<a id="freezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">freezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Disables the sensors and freezes the device rotation at its + current rotation state.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getCurrentActivityName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentActivityName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + <p> + <p class="caution"> + <strong> + This method is deprecated.</strong><br/> The results returned should be considered unreliable + </p> + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the last activity to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of activity</li></ul> + </div> + + </div> +</div> + + +<a id="getCurrentPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the name of the last package to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of package</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayHeight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayHeight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the height of the display, in pixels. The size is adjusted based + on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>height in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the current rotation of the display, as defined in Surface@return</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="getDisplayWidth()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayWidth</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the width of the display, in pixels. The width and height details + are reported based on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>width in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getInstance()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + static + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getInstance</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves a singleton instance of UiDevice</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiDevice instance</li></ul> + </div> + + </div> +</div> + + +<a id="getLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the text from the last UI traversal event received. + + You can use this method to read the contents in a WebView container + because the accessibility framework fires events + as each text is highlighted. You can write a test to perform + directional arrow presses to focus on different elements inside a WebView, + and call this method to get the text from each traversed element. + If you are testing a view container that can return a reference to a + Document Object Model (DOM) object, your test should use the view's + DOM instead.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text of the last traversal event, else return an empty string</li></ul> + </div> + + </div> +</div> + + +<a id="getProductName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getProductName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the product name of the device. + + This method provides information on what type of device the test is running on. This value is + the same as returned by invoking #adb shell getprop ro.product.name.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>product name of the device</li></ul> + </div> + + </div> +</div> + + +<a id="hasAnyWatcherTriggered()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasAnyWatcherTriggered</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code> + See <code><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered(String)</a></code></p></div> + + </div> +</div> + + +<a id="hasWatcherTriggered(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasWatcherTriggered</span> + <span class="normal">(String watcherName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code>. If a UiWatcher runs and its + <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call returned <code>true</code>, then + the UiWatcher is considered triggered. This is helpful if a watcher is detecting errors + from ANR or crash dialogs and the test needs to know if a UiWatcher has been triggered.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if triggered else false</li></ul> + </div> + + </div> +</div> + + +<a id="isNaturalOrientation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isNaturalOrientation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the device is in its natural orientation. This is determined by checking if the + orientation is at 0 or 180 degrees.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is in natural orientation</li></ul> + </div> + + </div> +</div> + + +<a id="isScreenOn()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScreenOn</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks the power manager if the screen is ON.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the screen is ON else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressBack()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressBack</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the BACK button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadCenter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadCenter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the CENTER button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadDown()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadDown</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DOWN button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the LEFT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the RIGHT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the UP button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDelete()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDelete</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DELETE key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressEnter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressEnter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the ENTER key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressHome()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressHome</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the HOME button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode, int metaState)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>keyCode</th> + <td>the key code of the event.</td> + </tr> + <tr> + <th>metaState</th> + <td>an integer in which each bit set to 1 represents a pressed meta key</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressMenu()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressMenu</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the MENU button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressRecentApps()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressRecentApps</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the Recent Apps button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressSearch()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressSearch</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the SEARCH button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">registerWatcher</span> + <span class="normal">(String name, <a href="UiWatcher.html">UiWatcher</a> watcher)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>. See <code><a href="#runWatchers()">runWatchers()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>to register the UiWatcher</td> + </tr> + <tr> + <th>watcher</th> + <td><code><a href="UiWatcher.html">UiWatcher</a></code></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="removeWatcher(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">removeWatcher</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>used to register the UiWatcher</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiAutomationException</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="resetWatcherTriggers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">resetWatcherTriggers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered. + If a UiWatcher runs and its <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call + returned <code>true</code>, then the UiWatcher is considered triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="runWatchers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">runWatchers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method forces all registered watchers to run. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="setOrientationLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the left and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setOrientationNatural()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationNatural</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setOrientationRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the right and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="sleep()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipe(android.graphics.Point[], int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(Point[] segments, int segmentSteps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe between points in the Point array. Each step execution is throttled + to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>segments</th> + <td>is Point array containing at least one Point object</td> + </tr> + <tr> + <th>segmentSteps</th> + <td>steps to inject between two Points</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + + </div> +</div> + + +<a id="swipe(int, int, int, int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(int startX, int startY, int endX, int endY, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed. Each step execution is throttled to 5ms + per step. So for a 100 steps, the swipe will take about 1/2 second to complete.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>is the number of move steps sent to the system</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>false if the operation fails or the coordinates are invalid</li></ul> + </div> + + </div> +</div> + + +<a id="takeScreenshot(java.io.File, float, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath, float scale, int quality)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + <tr> + <th>scale</th> + <td>scale the screenshot down if needed; 1.0f for original size</td> + </tr> + <tr> + <th>quality</th> + <td>quality of the PNG compression; range: 0-100</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="takeScreenshot(java.io.File)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="unfreezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">unfreezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation. During a test execution, it is best to + keep the device frozen in a specific orientation until the test case execution has completed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForIdle(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">(long time)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle.</p></div> + + </div> +</div> + + +<a id="waitForIdle()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle. + Default wait timeout is 10 seconds</p></div> + + </div> +</div> + + +<a id="waitForWindowUpdate(java.lang.String, long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForWindowUpdate</span> + <span class="normal">(String packageName, long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for a window content update event to occur. + + If a package name for the window is specified, but the current window + does not have the same package name, the function returns immediately.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>packageName</th> + <td>the specified window package name (can be <code>null</code>). + If <code>null</code>, a window update from any front-end window will end the wait</td> + </tr> + <tr> + <th>timeout</th> + <td>the timeout for the wait</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if a window update occurred, false if timeout has elapsed or if the current + window does not have the specified package name</li></ul> + </div> + + </div> +</div> + + +<a id="wakeUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">wakeUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON. + + If the screen was OFF and it just got turned ON, this method will insert a 500ms delay + to allow the device time to wake up and accept input.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiObject.jd b/docs/html/tools/help/uiautomator/UiObject.jd new file mode 100644 index 0000000..799ac82 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObject.jd @@ -0,0 +1,2684 @@ +page.title=UiObject +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>A UiObject is a representation of a user interface (UI) element. It is not in any way directly bound to a + UI element as an object reference. A UiObject holds information to help it + locate a matching UI element at runtime based on the <code><a href="UiSelector.html">UiSelector</a></code> properties specified in + its constructor. Since a UiObject is a representative for a UI element, it can + be reused for different views with matching UI elements. +</p> + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObject(com.android.uiautomator.core.UiSelector)">UiObject</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObject(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObject</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearTextField()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearTextField</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the existing text contents in an editable field. + + The <code><a href="UiSelector.html">UiSelector</a></code> of this object must reference a UI element that is editable. + + When you call this method, the method first sets focus at the start edge of the field. + The method then simulates a long-press to select the existing text, and deletes the + selected text. + + If a "Select-All" option is displayed, the method will automatically attempt to use it + to ensure full text selection. + + Note that it is possible that not all the text in the field is selected; for example, + if the text contains separators such as spaces, slashes, at symbol etc. + Also, not all editable fields support the long-press functionality.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="click()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true id successful else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions. + + This method differ from <code><a href="#click()">click()</a></code> only in that this method waits for a + a new window transition as a result of the click. Some examples of a window transition: + <li>launching a new activity</li> + <li>bringing up a pop-up menu</li> + <li>bringing up a dialog</li></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>timeout before giving up on waiting for a new window</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="exists()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">exists</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if UI element exists. + + This methods performs a <code><a href="#waitForExists(long)">waitForExists(long)</a></code> with zero timeout. This + basically returns immediately whether the UI element represented by this UiObject + exists or not. If you need to wait longer for this UI element, then see + <code><a href="#waitForExists(long)">waitForExists(long)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element represented by this UiObject does exist +</li></ul> + </div> + + </div> +</div> + + +<a id="getBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the UI element's <code>bounds</code> property. See <code><a href="#getVisibleBounds()">getVisibleBounds()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChild(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChild</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the count of child UI elements.</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getContentDescription()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getContentDescription</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>content_desc</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>value of node attribute "content_desc"</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getFromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getFromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element from the parent element currently + represented by this object. Essentially this is starting the search from the parent + element and can also be used to find sibling UI elements to the one currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for the UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the UI element's <code>package</code> property</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + final + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">getSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Debugging helper. A test can dump the properties of a selector as a string + to its logs if needed. <code>getSelector().toString();</code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiSelector.html">UiSelector</a></code> +</li></ul> + </div> + + </div> +</div> + + +<a id="getText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>text</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text value of the current node represented by this UiObject</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td>if no match could be found +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getVisibleBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getVisibleBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the visible bounds of the UI element. + + If a portion of the UI element is visible, only the bounds of the visible portion are + reported.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiObjectNotFoundException</td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + </div> +</div> + + +<a id="isCheckable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isCheckable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checkable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isChecked()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isChecked</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checked</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isEnabled()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isEnabled</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>enabled</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocusable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocusable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focusable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocused()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocused</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focused</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isLongClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isLongClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>long-clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isScrollable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScrollable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>scrollable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isSelected()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isSelected</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>selected</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClick()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClick</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks the center of the visible bounds of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks on the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setText(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">setText</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the text in an editable field, after clearing the field's content. + + The <code><a href="UiSelector.html">UiSelector</a></code> selector of this object must reference a UI element that is editable. + + When you call this method, the method first simulates a <code><a href="#click()">click()</a></code> on + editable field to set focus. The method then clears the field's contents + and injects your specified text into the field. + + If you want to capture the original contents of the field, call <code><a href="#getText()">getText()</a></code> first. + You can then modify the text and use this method to update the field.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>string to set</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation is successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeDown(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeDown</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeLeft(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeLeft</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeRight(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeRight</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeUp(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeUp</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this UiObject. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true of successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForExists(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForExists</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become visible. + + This method waits until the UI element becomes visible on the display, or + until the timeout has elapsed. You can use this method in situations where + the content that you want to select is not immediately displayed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>the amount of time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element is displayed, else false if timeout elapsed while waiting +</li></ul> + </div> + + </div> +</div> + + +<a id="waitUntilGone(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitUntilGone</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become undetectable. + + This method waits until a UI element is no longer matchable, or until the + timeout has elapsed. + + A UI element becomes undetectable when the <code><a href="UiSelector.html">UiSelector</a></code> of the object is + unable to find a match because the element has either changed its state or is no + longer displayed. + + You can use this method when attempting to wait for some long operation + to compete, such as downloading a large file or connecting to a remote server.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the element is gone before timeout elapsed, else false if timeout elapsed + but a matching element is still found. +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd new file mode 100644 index 0000000..02c607d --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd @@ -0,0 +1,630 @@ +page.title=UiObjectNotFoundException +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Generated in test runs when a <code><a href="UiSelector.html">UiSelector</a></code> selector could not be matched + to any UI element displayed. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String)">UiObjectNotFoundException</a></span>(String msg) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String, java.lang.Throwable)">UiObjectNotFoundException</a></span>(String detailMessage, Throwable throwable) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.Throwable)">UiObjectNotFoundException</a></span>(Throwable throwable) + + </td></tr> + + + +</table> + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Throwable" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Throwable-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Throwable + +<div id="inherited-methods-java.lang.Throwable"> + <div id="inherited-methods-java.lang.Throwable-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Throwable-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fillInStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getCause</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getLocalizedMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + StackTraceElement[] + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">initCause</span>(Throwable arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintWriter arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintStream arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setStackTrace</span>(StackTraceElement[] arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObjectNotFoundException(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String msg)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.String, java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String detailMessage, Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiScrollable.jd b/docs/html/tools/help/uiautomator/UiScrollable.jd new file mode 100644 index 0000000..33566a2 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiScrollable.jd @@ -0,0 +1,2914 @@ +page.title=UiScrollable +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and provides support for searching for items in a + scrollable user interface (UI) elements. This class can be used with horizontally or vertically scrollable controls.. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiScrollable(com.android.uiautomator.core.UiSelector)">UiScrollable</a></span>(<a href="UiSelector.html">UiSelector</a> container) + + <div class="jd-descrdiv">UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingBackward()">flingBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingForward()">flingForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToBeginning(int)">flingToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToEnd(int)">flingToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getMaxSearchSwipes()">getMaxSearchSwipes</a></span>() + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + double + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSwipeDeadZonePercentage()">getSwipeDeadZonePercentage</a></span>() + + <div class="jd-descrdiv">Returns the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward(int)">scrollBackward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll backward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward()">scrollBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward()">scrollForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward(int)">scrollForward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll forward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollIntoView(com.android.uiautomator.core.UiSelector)">scrollIntoView</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int)">scrollToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int, int)">scrollToBeginning</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the beginning of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int, int)">scrollToEnd</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the end of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int)">scrollToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See {@link UiScrollable#scrollToEnd(int, int)</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsHorizontalList()">setAsHorizontalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsVerticalList()">setAsVerticalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes</a></span>(int swipes) + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setSwipeDeadZonePercentage(double)">setSwipeDeadZonePercentage</a></span>(double swipeDeadZonePercentage) + + <div class="jd-descrdiv">Sets the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiCollection" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiCollection-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiCollection.html">com.android.uiautomator.core.UiCollection</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiCollection"> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiScrollable(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiScrollable</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> container)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection. Further operations on + the items in the container will require specifying UiSelector as an item selector.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>container</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> selector +</td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="flingBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String may be a partial match for the content-description of a child element.</td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument within its + hierarchy with a matching content-description text. The returned UiObject will represent the + UI element matching the <code>childPattern</code> and not the sub element that matched the + content description.</p> + By default this operation will perform scroll search while attempting to find the UI element + See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector. It looks for any child matching the <code>childPattern</code> argument and + return the <code>instance</code> specified. The operation is performed only on the visible + items and no scrolling is performed in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument that has + a sub UI element anywhere within its sub hierarchy that has text attribute + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the text matched sub element</p> + By default this operation will perform scroll search while attempting to find the UI + element. + See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getMaxSearchSwipes()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getMaxSearchSwipes</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls currently allowed to perform a search can be read by this method. + See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>max value of the number of swipes currently allowed during a scroll search +</li></ul> + </div> + + </div> +</div> + + +<a id="getSwipeDeadZonePercentage()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + double + </span> + <span class="sympad">getSwipeDeadZonePercentage</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a value between 0 and 1 +</li></ul> + </div> + + </div> +</div> + + +<a id="scrollBackward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll backward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the top to bottom. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the left to right. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollDescriptionIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollDescriptionIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for anywhere within the contents of this scrollable.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll forward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the bottom to top. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the right to left. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollIntoView(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollIntoView</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument. + See <code><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView(String)</a></code> and <code><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView(String)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the item was found and now is in view else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollTextIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollTextIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the beginning of a scrollable UI element. The beginning could be the top most + in case of vertical lists or the left most in case of horizontal lists. Caution is required + on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the end of a scrollable UI element. The end could be the bottom most + in case of vertical controls or the right most for horizontal controls. Caution + is required on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See {@link UiScrollable#scrollToEnd(int, int)</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setAsHorizontalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsHorizontalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setAsVerticalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsVerticalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setMaxSearchSwipes(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setMaxSearchSwipes</span> + <span class="normal">(int swipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls allowed to perform a search can be modified by this method. + The current value can be read by calling <code><a href="#getMaxSearchSwipes()">getMaxSearchSwipes()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipes</th> + <td>is the number of search swipes until abort +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setSwipeDeadZonePercentage(double)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setSwipeDeadZonePercentage</span> + <span class="normal">(double swipeDeadZonePercentage)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must always start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipeDeadZonePercentage</th> + <td>is a value between 0 and 1 +</td> + </tr> + </table> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiSelector.jd b/docs/html/tools/help/uiautomator/UiSelector.jd new file mode 100644 index 0000000..96d3fd8 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiSelector.jd @@ -0,0 +1,2088 @@ +page.title=UiSelector +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + + +<h2>Class Overview</h2> +<p>This class provides the mechanism for tests to describe the UI elements they + intend to target. A UI element has many properties associated with it such as + text value, content-description, class name and multiple state information like + selected, enabled, checked etc. Additionally UiSelector allows targeting of UI + elements within a specific display hierarchies to distinguish similar elements + based in the hierarchies they're in.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiSelector()">UiSelector</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checked(boolean)">checked</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently checked (usually for checkboxes).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#childSelector(com.android.uiautomator.core.UiSelector)">childSelector</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.String)">className</a></span>(String className) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + <T> + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.Class<T>)">className</a></span>(Class<T> type) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#classNameMatches(java.lang.String)">classNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickable(boolean)">clickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#description(java.lang.String)">description</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionContains(java.lang.String)">descriptionContains</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionMatches(java.lang.String)">descriptionMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionStartsWith(java.lang.String)">descriptionStartsWith</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#enabled(boolean)">enabled</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are enabled.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focusable(boolean)">focusable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are focusable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focused(boolean)">focused</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that have focus.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#fromParent(com.android.uiautomator.core.UiSelector)">fromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#index(int)">index</a></span>(int index) + + <div class="jd-descrdiv">Set the search criteria to match the widget by its node + index in the layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#instance(int)">instance</a></span>(int instance) + + <div class="jd-descrdiv">Set the search criteria to match the + widget by its instance number.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickable(boolean)">longClickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are long-clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageName(java.lang.String)">packageName</a></span>(String name) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageNameMatches(java.lang.String)">packageNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollable(boolean)">scrollable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are scrollable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#selected(boolean)">selected</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently selected.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#text(java.lang.String)">text</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textContains(java.lang.String)">textContains</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textMatches(java.lang.String)">textMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textStartsWith(java.lang.String)">textStartsWith</a></span>(String text) + + <div class="jd-descrdiv">Text property is usually the widget's visible text on the display.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#toString()">toString</a></span>() + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="checked(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">checked</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently checked (usually for checkboxes). + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="childSelector(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">childSelector</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector. + + Use this selector to narrow the search scope to + child widgets under a specific parent widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(String className)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>className</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.Class<T>)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(Class<T> type)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="classNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">classNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="clickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">clickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="description(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">description</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument. + + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionContains</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must contain + the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="descriptionStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionStartsWith</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must start + with the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="enabled(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">enabled</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are enabled. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focusable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focusable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are focusable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focused(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focused</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that have focus. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="fromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">fromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget. + + Use this selector to narrow the search scope to + sibling widgets as well all child widgets under a parent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="index(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">index</span> + <span class="normal">(int index)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the widget by its node + index in the layout hierarchy. + + The index value must be 0 or greater. + + Using the index can be unreliable and should only + be used as a last resort for matching. Instead, + consider using the <code><a href="#instance(int)">instance(int)</a></code> method.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>index</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="instance(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">instance</span> + <span class="normal">(int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the + widget by its instance number. + + The instance value must be 0 or greater, where + the first instance is 0. + + For example, to simulate a user click on + the third image that is enabled in a UI screen, you + could specify a a search criteria where the instance is + 2, the <code><a href="#className(java.lang.String)">className(String)</a></code> matches the image + widget class, and <code><a href="#enabled(boolean)">enabled(boolean)</a></code> is true. + The code would look like this: + <code> + new UiSelector().className("android.widget.ImageView") + .enabled(true).instance(2); + </code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>instance</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="longClickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">longClickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are long-clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="packageName(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageName</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="packageNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="scrollable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">scrollable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are scrollable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="selected(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">selected</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently selected. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="text(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">text</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument. + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textContains</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must contain the string in + your input argument. Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="textStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textStartsWith</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Text property is usually the widget's visible text on the display. + + Adding this to the search criteria indicates that the search performed + should match a widget with text value starting with the text parameter. + + The matching will be case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="toString()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">toString</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiWatcher.jd b/docs/html/tools/help/uiautomator/UiWatcher.jd new file mode 100644 index 0000000..b416fad --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiWatcher.jd @@ -0,0 +1,78 @@ +page.title=UiWatcher +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<p>Represents a conditional watcher on the target device. To learn how to register a conditional + watcher, see <code><a href="UiDevice.html#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">UiDevice.registerWatcher()</a></code>. +</p> + +<div class="jd-descr"> + +<h2>Summary</h2> + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checkForCondition()">checkForCondition</a></span>() + + <div class="jd-descrdiv">The testing framework calls this handler method automatically when the framework + is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + +</table> + +</div><!-- jd-descr (summary) --> + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + +<a id="checkForCondition()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + boolean + </span> + <span class="sympad">checkForCondition</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>The testing framework calls this handler method automatically when the framework is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>. When a match is not found after a predetermined time has elapsed, the framework calls the checkForCondition() method of all registered watchers on the device. You can use this method to handle known blocking issues that are preventing the test from proceeding. For example, you can check if a dialog appeared that is blocking the the test, then close the dialog or perform some other appropriate action to allow the test to continue.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true to indicate a matched condition, or false if no matching condition is found +</li></ul> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/index.jd b/docs/html/tools/help/uiautomator/index.jd new file mode 100644 index 0000000..38ba177 --- /dev/null +++ b/docs/html/tools/help/uiautomator/index.jd @@ -0,0 +1,177 @@ +page.title=uiautomator +parent.title=Tools +parent.link=index.html +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ul> + <li><a href="#syntax">Syntax</a></li> + <li><a href="#options">Options</a></li> + <lI><a href="#api">uiautomator API</a> + <ul> + <li><a href="#classes">Classes</a></li> + <li><a href="#interfaces">Interfaces</a></li> + <li><a href="#exceptions">Exceptions</a></li> + </ul> + </lI> + </ul> + </div> +</div> + +<p>The {@code uiautomator} testing framework lets you test your user interface (UI) efficiently by creating automated functional UI testcases that can be run against your app on one or more devices.</p> +<p>For more information on testing with the {@code uiautomator} framework, see <a href="{@docRoot}tools/testing/testing_ui.html">UI Testing</a>.</p> + +<h2 id="syntax">Syntax</h2> +<p>To run your testcases on the target device, you can use the {@code adb shell} command to invoke the {@code uiautomator} tool. The syntax is: +<pre> +adb shell uiautomator runtest <jar> -c <test_class_or_method> [options] +</pre> +</p> +<p>Here’s an example:</p> +<pre>adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings</pre> + +<h2 id="options">Command-line Options</h2> +<p>The following table describes the subcommands and options for {@code uiautomator}.</p> + +<p class="table-caption" id="table1"> +<strong>Table 1.</strong> Command-line options for {@code uiautomator}</p> +<table> +<tr> + <th>Subcommand</th> + <th>Option</th> + <th>Description</th> +</tr> + +<tr> +<td rowspan="6"><code>runtest</code></td> +<td><nobr>{@code <jar>}</nobr></td> +<td><strong>Required</strong>. The {@code <jar>} argument is the name of one or more JAR files that you deployed to the target device which contain your uiautomator testcases. You can list more than one JAR file by using a space as a separator.</td> +</tr> + +<tr> +<td><nobr><code>-c <test_class_or_method> </code></nobr></td> +<td><strong>Required</strong>. The {@code <test_class_or_method>} argument is a list of one or more specific test classes or test methods from the JARs that you want {@code uiautomator} to run. <p>Each class or method must be fully qualified with the package name, in one of these formats: +<ul> +<li>{@code package_name.class_name}</li> +<li>{@code package_name.class_name#method_name}</li> +</ul> +You can list multiple classes or methods by using a space as a separator.</p></td> +</tr> + +<tr> +<td><nobr><code>--nohup</code></nobr></td> +<td>Runs the test to completion on the device even if its parent process is terminated (for example, if the device is disconnected).</td> +</tr> + +<tr> +<td><nobr><code>-e <NAME> <VALUE></code></nobr></td> +<td><p>Specify other name-value pairs to be passed to test classes. May be repeated.</p><p class="note"><strong>Note: </strong>The {@code -e} options cannot be combined; you must prefix each option with a separate {@code -e} flag. </p></td> +</tr> + +<tr> +<td><nobr><code>-e debug [true|false]</code></nobr></td> +<td>Wait for debugger to connect before starting.</td> +</tr> + +<tr> +<td><nobr><code>-e runner [CLASS]</code></nobr></td> +<td>Use the specified test runner class instead. If unspecified, the {@code uiautomator} framework’s default runner will be used.</td> +</tr> + +<tr> +<td><code>dump</code></td> +<td><code>[file]</code></td> +<td>Generate an XML file with a dump of the current UI hierarchy. If a filepath is not specified, by default, the generated dump file is stored on the device in this location {@code /storage/sdcard0/window_dump.xml}.</td> +</tr> + +<tr> +<td><code>events</code></td> +<td> </td> +<td>Prints out accessibility events to the console until the connection to the device is terminated</td> +</tr> +</table> + +<h2 id="api">uiautomator API</h2> +<p>The {@code uiautomator} API is bundled in the {@code uiautomator.jar} file under the {@code <android-sdk>/platforms/} directory. The API includes these key classes, interfaces, and exceptions that allow you to capture and manipulate UI components on the target app:</p> + +<h3 id="classes">Classes</h3> +<table> +<tr> + <th>Class</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code com.android.uiautomator.core.UiCollection}</a></nobr></td> +<td>Used to enumerate a container's user interface (UI) elements for the purpose of counting, or targeting a sub elements by a child's text or description.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code com.android.uiautomator.core.UiDevice}</a></nobr></td> +<td>Provides access to state information about the device. You can also use this class to simulate user actions on the device, such as pressing the d-pad hardware button or pressing the Home and Menu buttons.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code com.android.uiautomator.core.UiObject}</a></nobr></td> +<td>Represents a user interface (UI) element.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code com.android.uiautomator.core.UiScrollable}</a></nobr></td> +<td>Provides support for searching for items in a scrollable UI container.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code com.android.uiautomator.core.UiSelector}</a></nobr></td> +<td>Represents a query for one or more target UI elements on a device screen. </td> +</tr> + +</table> + +<h3 id="interfaces">Interfaces</h3> + +<table> +<tr> + <th>Interface</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiWatcher.html">{@code com.android.uiautomator.core.UiWatcher}</a></nobr></td> +<td>Represents a conditional watcher on the target device.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/IAutomationSupport.html">{@code com.android.uiautomator.testrunner.IAutomationSupport}</a></nobr></td> +<td>Provides auxiliary support for running test cases.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code com.android.uiautomator.testrunner.UiAutomatorTestCase}</a></nobr></td> +<td>Defines an environment for running multiple tests. All {@code uiautomator} test cases should extend this class.</td> +</tr> + +</table> + +<h3 id="exceptions">Exceptions</h3> + +<table> +<tr> + <th>Exception</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObjectNotFoundException.html">{@code com.android.uiautomator.core.UiObjectNotFoundException}</a></nobr></td> +<td>Indicates when a a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> could not be matched to any UI element displayed.</td> +</tr> + +</table> + + + + + + diff --git a/docs/html/tools/index.jd b/docs/html/tools/index.jd index 04e0d3b..38401aa 100644 --- a/docs/html/tools/index.jd +++ b/docs/html/tools/index.jd @@ -17,68 +17,88 @@ page.title=Developer Tools <div style="margin-top:20px;"></div> -<div class="col-6"> +<div class="col-7" style="margin-left:0"> <h3>Full Java IDE</h3> <ul> - <li>Android-specific refactoring, quick fixes, integrated navigation between Java and Android XML resources.</li> - <li>Enhanced XML editors for Android XML resources</li> - <li>Static analysis tools to catch performance, usability, and correctness problems</li> + <li>Android-specific refactoring, quick fixes, integrated navigation between Java and XML resources.</li> + <li>Enhanced XML editors for Android XML resources.</li> + <li>Static analysis tools to catch performance, usability, and correctness problems.</li> <li>Build support for complex projects, command-line support for CI through Ant. Includes ProGuard and app-signing. </li> <li>Template-based wizard to create standard Android projects and components.</li> </ul> </div> -<div class="col-6"> + +<div class="col-6" style="margin-right:0"> + <h3>Graphical UI Builders</h3> - <ul> <li>Build rich Android UI with drag and drop. <li>Visualize your UI on tablets, phones, and other devices. Switch themes, locales, even platform versions instantly, without building.</li> - <li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles</li> - <li>Editor support for working with custom UI components</li> + <li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles.</li> + <li>Editor support for working with custom UI components.</li> </ul> + +</div> + + +<div class="col-7" style="clear:both;margin-left:0;"> + +<h3>On-device Developer Options</h3> +<ul> + <li>Enable debugging over USB.</li> + <li>Quickly capture bug reports onto the device.</li> + <li>Show CPU usage on screen.</li> + <li>Draw debugging information on screen such as layout bounds, + updates on GPU views and hardware layers, touch location, and others.</li> + <li>Plus many more options to simulate app stresses or enable debugging options.</li> +</ul> +<p>To access these on your device, open the <em>Developer options</em> in the +system Settings. Note that on Android 4.2 and higher, the Developer options screen is +hidden by default. To make it available, go to +<b>Settings > About phone</b> and tap <b>Build number</b> seven times. Return to the previous +screen to find Developer options.</p> + </div> -<div class="col-6" style="clear:both"> +<div class="col-6" style="margin-right:0"> + <img src="{@docRoot}images/tools/dev-options-inmilk.png" alt="" style="margin:-10px 0 0;"> +</div> + + +<div class="col-7" style="clear:both;margin-left:0;"> <h3>Develop on Hardware Devices</h3> <ul> <li>Use any commercial Android hardware device or multiple devices.</li> - <li>Deploy your app to connected devices directy from the IDE</li> - <li>Live, on-device debugging, testing, and profiling</li> + <li>Deploy your app to connected devices directy from the IDE.</li> + <li>Live, on-device debugging, testing, and profiling.</li> </ul> </div> -<div class="col-6"> +<div class="col-6" style="margin-right:0"> <h3>Develop on Virtual Devices</h3> <ul> <li>Emulate any device. Use custom screen sizes, keyboards, and other hardware components. </li> <li>Advanced hardware emulation, including camera, sensors, multitouch, telephony.</li> - <li>Develop and test for broadest compatibility at lowest cost.</li> + <li>Develop and test for broad device compatibility.</li> </ul> </div> <div style="margin-top:20px;"></div> -<div class="col-5"> +<div class="col-7" style="margin-left:0"> <h3>Powerful Debugging</h3> <ul> - <li>Full Java debugger with on-device debugging and Android-specific tools</li> + <li>Full Java debugger with on-device debugging and Android-specific tools.</li> <li>Built-in memory analysis, performance/CPU profiling, OpenGL ES tracing.</li> <li>Graphical tools for debugging and optimizing UI, runtime inspecton of UI structure and performance.</li> - <li>Runtime graphical analysis of your app's network bandwidth usage.</li> + <li>Runtime graphical analysis of your app's network bandwidth usage.</li> </ul> -</div> - -<div style="float:right;width:360px;padding-top:1em;"> - <img src="{@docRoot}images/debugging-tall.png" align="left"> -</div> - -<div class="col-6"> <h3>Testing</h3> <ul> @@ -95,3 +115,8 @@ page.title=Developer Tools </ul> </div> +<div class="col-6" style="margin-right:0"> + <img src="{@docRoot}images/debugging-tall.png" align="left" style="margin-top:10px"> +</div> + + diff --git a/docs/html/tools/testing/testing_ui.jd b/docs/html/tools/testing/testing_ui.jd new file mode 100644 index 0000000..0aa7b78 --- /dev/null +++ b/docs/html/tools/testing/testing_ui.jd @@ -0,0 +1,356 @@ +page.title=UI Testing +parent.title=Testing +parent.link=index.html +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ol> + <li><a href="#overview">Overview</a></li> + <ul> + <li><a href="#workflow">Workflow</a></li> + </ul> + <li><a href="#uianalysis">Analyzing Your UI</a></li> + <li><a href="#prepare">Preparing to Test</a> + <ul> + <LI><a href="#loading">Load the App</a></LI> + <LI><a href="#identifyUI">Identify UI Components</a></LI> + <LI><a href="#accessibility">Ensure Accessibility</a></LI> + <LI><a href="#configure">Configure Development Environment</a></LI> + </ul> + </li> + <li><a href="#creating">Creating Tests</a> + <ul> + <LI><a href="#classes">uiautomator API</a></LI> + <li><a href="#sample">Sample Test Case</a> + </ul> + </li> + <li><a href="#builddeploy">Building and Deploying Tests</a></li> + <li><a href="#running">Running Tests</a></li> + <li><a href="#bestpractices">Best Practices</a></li> + </ol> + <h2>Key classes</h2> + <ol> + <li><a href="{@docRoot}tools/help/uiautomator/IAutomationSupport.html">IAutomationSupport</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">UiAutomatorTestCase</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">UiCollection</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">UiDevice</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiObject.html">UiObject</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">UiScrollable</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">UiSelector</a></li> + </ol> + <h2>See Also</h2> + <ol> + <li> + <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator (reference)</a> + </li> + </ol> + </div> +</div> + +<p> +In addition to unit testing the individual components that make up your Android application (such as activities, services, and content providers), it is also important that you test the behavior of your application’s user interface (UI) when it is running on a device. UI testing ensures that your application returns the correct UI output in response to a sequence of user actions on a device, such as entering keyboard input or pressing toolbars, menus, dialogs, images, and other UI controls. +</p> +<p> +Functional or black-box UI testing does not require testers to know the internal implementation details of the app, only its expected output when a user performs a specific action or enters a specific input. This approach allows for better separation of development and testing roles in your organization. +</p> +<p>One common approach to UI testing is to run tests manually and verify that the app is behaving as expected. However, this approach can be time-consuming, tedious, and error-prone. A more efficient and reliable approach is to automate the UI testing with a software testing framework. Automated testing involves creating programs to perform testing tasks (test cases) to cover specific usage scenarios, and then using the testing framework to run the test cases automatically and in a repeatable manner.</p> + +<h2 id="overview">Overview</h2> +<p>The Android SDK provides the following tools to support automated, functional UI testing on your application: +<ul> +<LI>{@code uiautomatorviewer} - A GUI tool to scan and analyze the UI components of an Android application.</LI> +<LI>{@code uiautomator} - A Java library containing APIs to create customized functional UI tests, and an execution engine to automate and run the tests.</LI> +</ul></p> + +<p>To use these tools, you must have the following versions of the Android development tools installed: +<ul> +<LI>Android SDK Tools, Revision 21 or higher</LI> +<LI>Android SDK Platform, API 16 or higher</LI> +</ul> +</p> + +<h3 id="workflow">Workflow for the the uiautomator testing framework</h3> +<p>Here's a short overview of the steps required to automate UI testing: +<ol> +<LI>Prepare to test by installing the app on a test device, analyzing the app’s UI components, and ensuring that your application is accessible by the test automation framework.</LI> +<li>Create automated tests to simulate specific user interactions on your application.</li> +<li>Compile your test cases into a JAR file and install it on your test device along with your app.</li> +<li>Run the tests and view the test results.</li> +<li>Correct any bugs or defects discovered in testing.</li> +</ol> +</p> + +<h2 id="uianalysis">Analyzing Your Application's UI</h2> +<p>Before you start writing your test cases, it's helpful to familiarize yourself with the UI components (including the views and controls) of the targeted application. You can use the {@code uiautomatorviewer} tool to take a snapshot of the foreground UI screen on any Android device that is connected to your development machine. The {@code uiautomatorviewer} tool provides a convenient visual interface to inspect the layout hierarchy and view the properties of the individual UI components that are displayed on the test device. Using this information, you can later create {@code uiautomator} tests with selector objects that target specific UI components to test.</p> + +<a href="{@docRoot}images/testing/UIAutomatorViewer.png"> + <img src="{@docRoot}images/testing/UIAutomatorViewer.png" + alt="User interface of uiautomatorviewer tool" height="327px" id="figure1"/> +</a> +<p class="img-caption"> + <strong>Figure 1.</strong> The {@code uiautomatorviewer} showing the captured interface of a test deviice. +</p> + +<p>To analyze the UI components of the application that you want to test:</p> +<ol> +<li>Connect your Android device to your development machine.</li> +<li>Open a terminal window and navigate to {@code <android-sdk>/tools/}.</li> +<LI>Run the tool with this command:<pre>$ uiautomatorviewer</pre></LI> +<li><p>To capture a screen for analysis, click the <strong>Device Screenshot</strong> button in the GUI of the {@code uiautomatorviewer} tool.</p> +<p class="note"><strong>Note: </strong>If you have more than one device connected, specify the device for screen capture by setting the {@code ANDROID_SERIAL} environment variable: + <ol type="a"> + <li>Find the serial numbers for your connected devices by running this command:<pre>$ adb devices</pre> </li> + <li>Set the {@code ANDROID_SERIAL} environment variable to select the device to test: + <ul> + <li>In Windows: <pre>set ANDROID_SERIAL=<device serial number></pre></li> + <li>In UNIX: <pre>export ANDROID_SERIAL=<device serial number></pre></li> + </ul> + </li> + </ol> +If you are connected to only a single device, you do not need to set the ANDROID_SERIAL environment variable.</p> +</li> +<li>View the UI properties for your application: + <ul> + <LI>Hover over the snapshot in the left-hand panel to see the UI components identified by the {@code uiautomatorviewer} tool. You can view the component’s properties listed in the lower right-hand panel, and the layout hierarchy in the upper right-hand panel.</LI> + <li>Optionally, click on the <strong>Toggle NAF Nodes</strong> button to see UI components that are not accessible to the {@code uiautomator} testing framework. Only limited information may be available for these components.</li> + </ul> +</li> +</ol> + +<h2 id="prepare">Preparing to Test</h2> +<p>Before using the {@code uiautomator} testing framework, complete these pre-flight tasks: +</p> +<h3 id="loading">Load the application to a device</h3> +<p>If you are reading this document, chances are that the Android application that you want to test has not been published yet. If you have a copy of the APK file, you can install the APK onto a test device by using the {@code adb} tool. To learn how to install an APK file using the {@code adb} tool, see the <a href="@docRoot}/tools/help/adb.html#move">{@code adb}</a> documentation. </p> + +<h3 id="identifyUI">Identify the application’s UI components</h3> +<p>Before writing your {@code uiautomator} tests, first identify the UI components in the application that you want to test. Typically, good candidates for testing are UI components that are visible and that users can interact with. The UI components should also have visible text labels, <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code android:contentDescription}</a> values, or both. + +<p>You can inspect the visible screen objects in an application conveniently by using the {@code uiautomatorviewer} tool. For more information about how to analyze an application screen with this tool, see the section <a href="#uianalaysis">Analyzing Your Application’s UI</a>. For more information about the common types of UI components provided by Android, see <a href="{@docRoot}guide/topics/ui/index.html">User Interface</a>.</p> + +<h3 id="accessibility">Ensure that the application is accessible</h3> +<p>This step is required because the {@code uiautomator} tool depends on the accessibility features of the Android framework to execute your functional UI tests. You should include these minimum optimizations to support the {@code uiautomator} tool: +<ul> +<LI>Use the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code android:contentDescription}</a> attribute to label the {@link android.widget.ImageButton}, {@link android.widget.ImageView}, {@link android.widget.CheckBox} and other user interface controls.</LI> +<li>Provide an <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code android:hint}</a> attribute <em>instead</em> of a content description for {@link android.widget.EditText} fields</li> +<li>Associate an <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code android:hint}</a> attribute with any graphical icons used by controls that provide feedback to the user (for example, status or state information).</li> +<li>Make sure that all the user interface elements are accessible with a directional controller, such as a trackball or D-pad.</li> +<li>Use the {@code uiautomatorviewer} tool to ensure that the UI component is accessible to the testing framework. You can also test the application by turning on accessibility services like TalkBack and Explore by Touch, and try using your application using only directional controls. </li> +</ul> +</p> + +<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p> + +<p class="note"><strong>Note: </strong>To identify the non-accessible components in the UI, click on the <strong>Toggle NAF Nodes</strong> option in the {@code uiautomatorviewer} tool.</p> + +<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}/guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p> + +<h3 id="configure">Configure your development environment</h3> +<p>If you're developing in Eclipse, the Android SDK provides additional tools that help you write test cases using {@code uiautomator} and buiild your JAR file. In order to set up Eclipse to assist you, you need to create a project that includes the {@code uiautomator} client library, along with the Android SDK library. To configure Eclipse:</p> +<ol> +<li>Create a new Java project in Eclipse, and give your project a name that is relevant to the tests you’re about to create (for example, "MyAppNameTests"). In the project, you will create the test cases that are specific to the application that you want to test.</li> +<li>From the <strong>Project Explorer</strong>, right-click on the new project that you created, then select <strong>Properties > Java Build Path</strong>, and do the following: + <ol type="a"> + <LI>Click <strong>Add Library > JUnit</strong> then select <strong>JUnit3</strong> to add JUnit support.</LI> + <li>Click <strong>Add External JARs...</strong> and navigate to the SDK directory. Under the platforms directory, select the latest SDK version and add both the {@code uiautomator.jar} and {@code android.jar} files.</li> + </ol> +</li> +</ol> +<p>If you did not configure Eclipse as your development environment, make sure that the {@code uiautomator.jar} and {@code android.jar} files from the {@code <android-sdk>/platforms/<sdk>} directory are in your Java class path.</p> +<p>Once you have completed these prerequisite tasks, you're almost ready to start creating your {@code uiautomator} tests. </li> + +<h2 id="creating">Creating uiautomator Tests</h2> +<p>To build a test that runs in the {@code uiautomator} framework, create a test case that extends the <a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code UiAutomatorTestCase}</a> class. In Eclipse, the test case file goes under the {@code src} directory in your project. Later, you will build the test case as a JAR file, then copy this file to the test device. The test JAR file is not an APK file and resides separately from the application that you want to test on the device.</p> + +<p>Because the <a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code UiAutomatorTestCase}</a> class extends {@code junit.framework.TestCase}, you can use the JUnit {@code Assert} class to test that UI components in the app return the expected results. To learn more about JUnit, you can read the documentation on the <a href="http://www.junit.org/">junit.org</a> home page.</p> + +<p>The first thing your test case should do is access the device that contains the target app. It’s also good practice to start the test from the Home screen of the device. From the Home screen (or some other starting location you’ve chosen in the target app), you can use the classes provided by the {@code uiautomator} API to simulate user actions and to test specific UI components. For an example of how to put together a {@code uiautomator} test case, see the <a href="#sample">sample test case</a>.</p> + +<h3 id="classes">uiautomator API</h3> +<p>The {@code uiautomator} API is bundled in the {@code uiautomator.jar} file under the {@code <android-sdk>/platforms/} directory. The API includes these key classes that allow you to capture and manipulate UI components on the target app:</p> +<dl> +<DT><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a></DT> +<dd><p>Represents the device state. In your tests, you can call methods on the <a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a> instance to check for the state of various properties, such as current orientation or display size. Your tests also can use the <a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a> instance to perform device level actions, such as forcing the device into a specific rotation, pressing the d-pad hardware button, or pressing the Home and Menu buttons.</p> +<p>To get an instance of <a href="{@docRoot}tools/help/UiDevice.html">{@code UiDevice}</a> and simulate a Home button press: +<pre> +getUiDevice().pressHome(); +</pre></p></dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a></dt> +<dd>Represents a search criteria to query and get a handle on specific elements in the currently displayed UI. +If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target {@code UiObject}. When constructing a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a>, you can chain together multiple properties to refine your search. If no matching UI element is found, a <a href="{@docRoot}tools/help/uiautomator/UiAutomatorObjectNotFoundException.html">{@code UiAutomatorObjectNotFoundException}</a> is thrown. You can use the <a href="{@docRoot}tools/help/uiautomator/UiSelector.html#childSelector(com.android.uiautomator.core.UiSelector)">{@code childSelector()}</a> method to nest multiple <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> instances. For example, the following code example shows how to specify a search to find the first {@link android.widget.ListView} in the currently displayed UI, then search within that {@link android.widget.ListView} to find a UI element with the text property {@code Apps}. +<pre> +UiObject appItem = new UiObject(new UiSelector() + .className("android.widget.ListView").instance(1) + .childSelector(new UiSelector().text("Apps"))); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a></dt> +<dd>Represents a UI element. To create a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instance, use a {@code UiSelector} that describes how to search for, or select, the UI element. +<p>The following code example shows how to construct <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instances that represent a <strong>Cancel</strong> button and a <strong>OK</strong> button in your application.</p> +<pre> +UiObject cancelButton = new UiObject(new UiSelector().text("Cancel")); +UiObject okButton = new UiObject(new UiSelector().text("OK")); +</pre> +<p>You can reuse the <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instances that you have created in other parts of your app testing, as needed. Note that the {@code uiautomator} test framework searches the current display for a match every time your test uses a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instance to click on a UI element or query a property.</p> +<p>In the following code example, the {@code uiautomator} test framework searches for a UI element with the text property {@code OK}. If a match is found and if the element is enabled, the framework simulates a user click action on the element.</p> +<pre> +if(okButton.exists() && okButton.isEnabled()) +{ + okButton.click(); +} +</pre> +<p>You can also restrict the search to find only elements of a specific class. For example, to find matches of the {@link android.widget.Button} class:</p> +<pre> +UiObject cancelButton = new UiObject(new UiSelector().text("Cancel") + .className("android.widget.Button")); +UiObject okButton = new UiObject(new UiSelector().text("OK") + .className("android.widget.Button")); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a></dt> +<dd>Represents a collection of items, for example songs in a music album or a list of emails in an inbox. Similar to a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a>, you construct a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> instance by specifying a <a href="{@docRoot}tools/help/UiSelector.html">{@code UiSelector}</a>. The <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> for a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> should search for a UI element that is a container or wrapper of other child UI elements (such as a layout view that contains child UI elements). For example, the following code snippet shows how to construct a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> to represent a video album that is displayed within a {@link android.widget.FrameLayout}: +<pre> +UiCollection videos = new UiCollection(new UiSelector() + .className("android.widget.FrameLayout")); +</pre> +<p>If the videos are listed within a {@link android.widget.LinearLayout} view, and you want to to retrieve the number of videos in this collection:</p> +<pre> +int count = videos.getChildCount(new UiSelector() + .className("android.widget.LinearLayout")); +</pre> +<p>If you want to find a specific video that is labeled with the text element {@code Cute Baby Laughing} from the collection and simulate a user-click on the video:</p> +<pre> +UiObject video = videos.getChildByText(new UiSelector() + .className("android.widget.LinearLayout"), "Cute Baby Laughing"); +video.click(); +</pre> +<p>Similarly, you can simulate other user actions on the UI object. For example, if you want +to simulate selecting a checkbox that is associated with the video:</p> +<pre> +UiObject checkBox = video.getChild(new UiSelector() + .className("android.widget.Checkbox")); +if(!checkBox.isSelected()) checkbox.click(); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code UiScrollable}</a></dt> +<dd>Represents a scrollable collection of UI elements. You can use the <a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code UiScrollable}</a> class to simulate vertical or horizontal scrolling across a display. This technique is helpful when a UI element is positioned off-screen and you need to scroll to bring it into view. +<p>For example, the following code shows how to simulate scrolling down the Settings menu and clicking on an <strong>About tablet</strong> option:</p> +<pre> +UiScrollable settingsItem = new UiScrollable(new UiSelector() + .className("android.widget.ListView")); +UiObject about = settingsItem.getChildByText(new UiSelector() + .className("android.widget.LinearLayout"), "About tablet"); +about.click() +</pre> +</dd> +</dl> +<p>For more information about these APIs, see the <a href="{@docRoot}tools/help/uiautomator/index.html">{@code uiautomator}</a> reference.</p> + +<h3 id="sample">A sample uiautomator test case</h3> +<p>The following code example shows a simple test case which simulates a user bringing up the Settings app in a stock Android device. The test case mimics all the steps that a user would typically take to perform this task, including opening the Home screen, launching the <strong>All Apps</strong> screen, scrolling to the <strong>Settings</strong> app icon, and clicking on the icon to enter the Settings app.</p> +<pre> +package com.uia.example.my; + +// Import the uiautomator libraries +import com.android.uiautomator.core.UiObject; +import com.android.uiautomator.core.UiObjectNotFoundException; +import com.android.uiautomator.core.UiScrollable; +import com.android.uiautomator.core.UiSelector; +import com.android.uiautomator.testrunner.UiAutomatorTestCase; + +public class LaunchSettings extends UiAutomatorTestCase { + + public void testDemo() throws UiObjectNotFoundException { + + // Simulate a short press on the HOME button. + getUiDevice().pressHome(); + + // We’re now in the home screen. Next, we want to simulate + // a user bringing up the All Apps screen. + // If you use the uiautomatorviewer tool to capture a snapshot + // of the Home screen, notice that the All Apps button’s + // content-description property has the value “Apps”. We can + // use this property to create a UiSelector to find the button. + UiObject allAppsButton = new UiObject(new UiSelector() + .description("Apps")); + + // Simulate a click to bring up the All Apps screen. + allAppsButton.clickAndWaitForNewWindow(); + + // In the All Apps screen, the Settings app is located in + // the Apps tab. To simulate the user bringing up the Apps tab, + // we create a UiSelector to find a tab with the text + // label “Apps”. + UiObject appsTab = new UiObject(new UiSelector() + .text("Apps")); + + // Simulate a click to enter the Apps tab. + appsTab.click(); + + // Next, in the apps tabs, we can simulate a user swiping until + // they come to the Settings app icon. Since the container view + // is scrollable, we can use a UiScrollable object. + UiScrollable appViews = new UiScrollable(new UiSelector() + .scrollable(true)); + + // Set the swiping mode to horizontal (the default is vertical) + appViews.setAsHorizontalList(); + + // Create a UiSelector to find the Settings app and simulate + // a user click to launch the app. + UiObject settingsApp = appViews.getChildByText(new UiSelector() + .className(android.widget.TextView.class.getName()), + "Settings"); + settingsApp.clickAndWaitForNewWindow(); + + // Validate that the package name is the expected one + UiObject settingsValidation = new UiObject(new UiSelector() + .packageName("com.android.settings")); + assertTrue("Unable to detect Settings", + settingsValidation.exists()); + } +} +</pre> + +<h2 id="builddeploy">Building and Deploying Your uiautomator Tests</h2> +<p>Once you have coded your test, follow these steps to build and deploy your test JAR to your target Android test device:</p> +<ol> +<li>Create the required build configuration files to build the output JAR. To generate the build configuration files, open a terminal and run the following command: +<pre><android-sdk>/tools/android uitest-project -n <name> -t 1 -p <path></pre> +The {@code <name>} is the name of the project that contains your {@code uiautomator} test source files, and the {@code <path>} is the path to the corresponding project directory. +</li> +<LI>From the command line, set the {@code ANDROID_HOME} variable: +<ul> +<li>In Windows: +<pre>set ANDROID_HOME=<path_to_your_sdk></pre> +</li> +<li>In UNIX: +<pre>export ANDROID_HOME=<path_to_your_sdk></pre> +</li> +</ul> +</LI> +<li>Go to the project directory where your {@code build.xml} file is located and build your test JAR. <pre>ant build</pre></li> +<li>Deploy your generated test JAR file to the test device by using the {@code adb push} command: <pre>adb push <path_to_output_jar> /data/local/tmp/</pre> +<p>Here’s an example: <pre>adb push ~/dev/workspace/LaunchSettings/bin/LaunchSettings.jar /data/local/tmp/</pre></p> +</li> +</ol> + +<h2 id="running">Running uiautomator Tests</h2> +<p>Here’s an example of how to run a test that is implemented in the {@code LaunchSettings.jar} file. The tests are bundled in the {@code com.uia.example.my} package:</p> +<pre>adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings</pre> +<p>To learn more about the syntax, subcommands, and options for {@code uiautomator}, see the <a href="{@docRoot}tools/help/uiautomator/index.html">{@code uiautomator}</a> reference.</p> + + +<h2 id="bestpractices">Best Practices</h2> +<p>Here are some best practices for functional UI testing with the {@code uiautomator} framework: </p> +<ul> +<LI>Ensure that you validate the same UI functions on your application across the various types of devices that your application might run on (for example, devices with different screen densities).</LI> +<li>You should also test your UI against common scenarios such as in-coming phone calls, network interruptions, and user-initiated switching to other applications on the device.</li> +</ul> + diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 56bbd5a..46665b2 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -93,6 +93,10 @@ <a href="<?cs var:toroot?>tools/testing/testing_accessibility.html"> <span class="en">Accessibility Testing</span></a> </li> + <li> + <a href="<?cs var:toroot?>tools/testing/testing_ui.html"> + <span class="en">UI Testing</span></a> + </li> <li> <a href="<?cs var:toroot ?>tools/testing/what_to_test.html"> <span class="en">What To Test</span></a> @@ -166,6 +170,20 @@ class="en">MonkeyRunner</span></a></li> <li><a href="<?cs var:toroot ?>tools/help/systrace.html">Systrace</a></li> <li><a href="<?cs var:toroot ?>tools/help/gltracer.html">Tracer for OpenGL ES</a></li> <li><a href="<?cs var:toroot ?>tools/help/traceview.html">Traceview</a></li> + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/uiautomator/index.html"><span class="en">uiautomator</span></a></div> + <ul> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/IAutomationSupport.html"><span class="en">IAutomationSupport</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiAutomatorTestCase.html"><span class="en">UiAutomatorTestCase</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiCollection.html"><span class="en">UiCollection</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiDevice.html"><span class="en">UiDevice</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiObject.html"><span class="en">UiObject</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiObjectNotFoundException.html"><span class="en">UiObjectNotFoundException</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiScrollable.html"><span class="en">UiScrollable</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiSelector.html"><span class="en">UiSelector</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiWatcher.html"><span class="en">UiWatcher</span></a></li> + </ul> + </li> <li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li> </ul> </li> diff --git a/docs/html/training/basics/firstapp/running-app.jd b/docs/html/training/basics/firstapp/running-app.jd index 0c428e7..80603b2 100644 --- a/docs/html/training/basics/firstapp/running-app.jd +++ b/docs/html/training/basics/firstapp/running-app.jd @@ -40,7 +40,7 @@ Android project, it includes a default set of "Hello World" source files that al immediately run the app.</p> <p>How you run your app depends on two things: whether you have a real Android-powered device and -whether you’re using Eclipse. This lesson shows you how to install and run your app on a +whether you're using Eclipse. This lesson shows you how to install and run your app on a real device and on the Android emulator, and in both cases with either Eclipse or the command line tools.</p> @@ -85,12 +85,21 @@ important that you understand how to run your app before you start developing.</ <ol> <li>Plug in your device to your development machine with a USB cable. -If you’re developing on Windows, you might need to install the appropriate USB driver for your +If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the <a href="{@docRoot}tools/extras/oem-usb.html">OEM USB -Drivers</a> document.</li> - <li>Ensure that <strong>USB debugging</strong> is enabled in the device Settings (open Settings -and navitage to <strong>Applications > Development</strong> on most devices, or click -<strong>Developer options</strong> on Android 4.0 and higher).</li> +Drivers</a> document.</li> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> + </li> </ol> <p>To run the app from Eclipse, open one of your project's files and click @@ -118,7 +127,7 @@ lesson</a>.</p> <h2 id="Emulator">Run on the Emulator</h2> -<p>Whether you’re using Eclipse or the command line, to run your app on the emulator you need to +<p>Whether you're using Eclipse or the command line, to run your app on the emulator you need to first create an <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a> (AVD). An AVD is a device configuration for the Android emulator that allows you to model different devices.</p> |
