1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/test/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>UiScrollable</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192<div class="sum-details-links"> 193 194Summary: 195 196 197 198 199 200 201 <a href="#inhconstants">Inherited Constants</a> 202 203 204 205 206 207 | <a href="#pubctors">Ctors</a> 208 209 210 211 212 | <a href="#pubmethods">Methods</a> 213 214 215 216 | <a href="#promethods">Protected Methods</a> 217 218 219 220 | <a href="#inhmethods">Inherited Methods</a> 221 222| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 223 224</div><!-- end sum-details-links --> 225</div><!-- end api-info-block --> 226 227<div class="api apilevel-" id="jd-content"> 228 229<!-- ======== START OF CLASS DATA ======== --> 230 231<h1 class="api-title">UiScrollable</h1> 232<p> 233<code class="api-signature"> 234 public 235 236 237 238 class 239 UiScrollable 240</code> 241<br> 242 243 244<code class="api-signature"> 245 246 247 248</code> 249 250<code class="api-signature"> 251 252 253 254</code> 255 256<code class="api-signature"> 257 258 extends <a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a> 259 260 261 262</code> 263 264<code class="api-signature"> 265 266 267 268</code> 269 270</p><table class="jd-inheritance-table"> 271 272 273 <tr> 274 275 <td colspan="4" class="jd-inheritance-class-cell">java.lang.Object 276 </td> 277 </tr> 278 279 280 <tr> 281 282 <td class="jd-inheritance-space"> ↳</td> 283 284 <td colspan="3" class="jd-inheritance-class-cell"><a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 285 </td> 286 </tr> 287 288 289 <tr> 290 291 <td class="jd-inheritance-space"> </td> 292 293 <td class="jd-inheritance-space"> ↳</td> 294 295 <td colspan="2" class="jd-inheritance-class-cell"><a href="/reference/android/support/test/uiautomator/UiCollection.html">android.support.test.uiautomator.UiCollection</a> 296 </td> 297 </tr> 298 299 300 <tr> 301 302 <td class="jd-inheritance-space"> </td> 303 304 <td class="jd-inheritance-space"> </td> 305 306 <td class="jd-inheritance-space"> ↳</td> 307 308 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.uiautomator.UiScrollable 309 </td> 310 </tr> 311 312 313</table> 314 315 316 317 318<br><hr> 319 320 321 <p>UiScrollable is a <code><a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></code> and provides support for searching 322 for items in scrollable layout elements. This class can be used with 323 horizontally or vertically scrollable controls.</p> 324 325 326 327 328 329 330 331<h2 class="api-section">Summary</h2> 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348<!-- =========== ENUM CONSTANT SUMMARY =========== --> 349<table id="inhconstants" class="responsive constants inhtable"> 350<tr><th><h3>Inherited constants</h3></th></tr> 351 352 353 354 355 <tr class="api apilevel-" > 356 <td> 357 358 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-constants-android.support.test.uiautomator.UiObject" class="jd-expando-trigger closed" 359 ><img height="34" id="inherited-constants-android.support.test.uiautomator.UiObject-trigger" 360 src="/assets/images/styles/disclosure_down.png" 361 class="jd-expando-trigger-img" /></a>From 362 class 363 <code> 364 <a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 365 </code> 366 <div id="inherited-constants-android.support.test.uiautomator.UiObject"> 367 <div id="inherited-constants-android.support.test.uiautomator.UiObject-list" 368 class="jd-inheritedlinks"> 369 </div> 370 <div id="inherited-constants-android.support.test.uiautomator.UiObject-summary" style="display: none;"> 371 <table class="jd-sumtable-expando responsive"> 372 373 374 375 <tr class="api apilevel-" > 376 <td><code>int</code></td> 377 <td width="100%"> 378 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#FINGER_TOUCH_HALF_WIDTH">FINGER_TOUCH_HALF_WIDTH</a></code> 379 <p> 380 381 382</p> 383 </td> 384 </tr> 385 386 387 <tr class="api apilevel-" > 388 <td><code>int</code></td> 389 <td width="100%"> 390 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#SWIPE_MARGIN_LIMIT">SWIPE_MARGIN_LIMIT</a></code> 391 <p> 392 393 394</p> 395 </td> 396 </tr> 397 398 399 <tr class="api apilevel-" > 400 <td><code>long</code></td> 401 <td width="100%"> 402 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_EVENT_TMEOUT">WAIT_FOR_EVENT_TMEOUT</a></code> 403 <p><em> 404 This constant is deprecated. 405 use <code><a href="/reference/android/support/test/uiautomator/Configurator.html#setScrollAcknowledgmentTimeout(long)">setScrollAcknowledgmentTimeout(long)</a></code> 406</em> 407 408 409</p> 410 </td> 411 </tr> 412 413 414 <tr class="api apilevel-" > 415 <td><code>long</code></td> 416 <td width="100%"> 417 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_SELECTOR_POLL">WAIT_FOR_SELECTOR_POLL</a></code> 418 <p> 419 420 421</p> 422 </td> 423 </tr> 424 425 426 <tr class="api apilevel-" > 427 <td><code>long</code></td> 428 <td width="100%"> 429 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_SELECTOR_TIMEOUT">WAIT_FOR_SELECTOR_TIMEOUT</a></code> 430 <p><em> 431 This constant is deprecated. 432 use <code><a href="/reference/android/support/test/uiautomator/Configurator.html#setWaitForSelectorTimeout(long)">setWaitForSelectorTimeout(long)</a></code> 433</em> 434 435 436</p> 437 </td> 438 </tr> 439 440 441 <tr class="api apilevel-" > 442 <td><code>long</code></td> 443 <td width="100%"> 444 <code><a href="/reference/android/support/test/uiautomator/UiObject.html#WAIT_FOR_WINDOW_TMEOUT">WAIT_FOR_WINDOW_TMEOUT</a></code> 445 <p> 446 447 448</p> 449 </td> 450 </tr> 451 452 453</table> 454 </div> 455 </div> 456 </td></tr> 457 458 459 460 461</table> 462 463 464 465 466 467 468 469 470 471<!-- ======== CONSTRUCTOR SUMMARY ======== --> 472<table id="pubctors" class="responsive constructors"> 473<tr><th colspan="2"><h3>Public constructors</h3></th></tr> 474 475 476 477 478 <tr class="api apilevel-" > 479 480 481 <td width="100%"> 482 <code> 483 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#UiScrollable(android.support.test.uiautomator.UiSelector)">UiScrollable</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> container) 484 </code> 485 486 <p>Constructor. 487 488 489</p> 490 491 </td> 492 </tr> 493 494 495 496</table> 497 498 499 500 501 502 503<!-- ========== METHOD SUMMARY =========== --> 504<table id="pubmethods" class="responsive methods"> 505<tr><th colspan="2"><h3>Public methods</h3></th></tr> 506 507 508 509 510 <tr class="api apilevel-" > 511 512 513 <td><code> 514 515 516 517 518 519 boolean</code> 520 </td> 521 522 <td width="100%"> 523 <code> 524 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#flingBackward()">flingBackward</a>() 525 </code> 526 527 <p>Performs a backwards fling action with the default number of fling 528 steps (5). 529 530 531</p> 532 533 </td> 534 </tr> 535 536 537 538 <tr class="api apilevel-" > 539 540 541 <td><code> 542 543 544 545 546 547 boolean</code> 548 </td> 549 550 <td width="100%"> 551 <code> 552 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#flingForward()">flingForward</a>() 553 </code> 554 555 <p>Performs a forward fling with the default number of fling steps (5). 556 557 558</p> 559 560 </td> 561 </tr> 562 563 564 565 <tr class="api apilevel-" > 566 567 568 <td><code> 569 570 571 572 573 574 boolean</code> 575 </td> 576 577 <td width="100%"> 578 <code> 579 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#flingToBeginning(int)">flingToBeginning</a>(int maxSwipes) 580 </code> 581 582 <p>Performs a fling gesture to reach the beginning of a scrollable layout element. 583 584 585</p> 586 587 </td> 588 </tr> 589 590 591 592 <tr class="api apilevel-" > 593 594 595 <td><code> 596 597 598 599 600 601 boolean</code> 602 </td> 603 604 <td width="100%"> 605 <code> 606 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#flingToEnd(int)">flingToEnd</a>(int maxSwipes) 607 </code> 608 609 <p>Performs a fling gesture to reach the end of a scrollable layout element. 610 611 612</p> 613 614 </td> 615 </tr> 616 617 618 619 <tr class="api apilevel-" > 620 621 622 <td><code> 623 624 625 626 627 628 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 629 </td> 630 631 <td width="100%"> 632 <code> 633 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByDescription</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 634 </code> 635 636 <p>Searches for a child element in the present scrollable container. 637 638 639</p> 640 641 </td> 642 </tr> 643 644 645 646 <tr class="api apilevel-" > 647 648 649 <td><code> 650 651 652 653 654 655 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 656 </td> 657 658 <td width="100%"> 659 <code> 660 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)">getChildByDescription</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) 661 </code> 662 663 <p>Searches for a child element in the present scrollable container. 664 665 666</p> 667 668 </td> 669 </tr> 670 671 672 673 <tr class="api apilevel-" > 674 675 676 <td><code> 677 678 679 680 681 682 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 683 </td> 684 685 <td width="100%"> 686 <code> 687 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByInstance(android.support.test.uiautomator.UiSelector, int)">getChildByInstance</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, int instance) 688 </code> 689 690 <p>Searches for a child element in the present scrollable container that 691 matches the selector you provided. 692 693 694</p> 695 696 </td> 697 </tr> 698 699 700 701 <tr class="api apilevel-" > 702 703 704 <td><code> 705 706 707 708 709 710 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 711 </td> 712 713 <td width="100%"> 714 <code> 715 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)">getChildByText</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) 716 </code> 717 718 <p>Searches for a child element in the present scrollable container. 719 720 721</p> 722 723 </td> 724 </tr> 725 726 727 728 <tr class="api apilevel-" > 729 730 731 <td><code> 732 733 734 735 736 737 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 738 </td> 739 740 <td width="100%"> 741 <code> 742 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByText</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 743 </code> 744 745 <p>Searches for a child element in the present scrollable 746 container. 747 748 749</p> 750 751 </td> 752 </tr> 753 754 755 756 <tr class="api apilevel-" > 757 758 759 <td><code> 760 761 762 763 764 765 int</code> 766 </td> 767 768 <td width="100%"> 769 <code> 770 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getMaxSearchSwipes()">getMaxSearchSwipes</a>() 771 </code> 772 773 <p>Gets the maximum number of scrolls allowed when performing a 774 scroll action in search of a child element. 775 776 777</p> 778 779 </td> 780 </tr> 781 782 783 784 <tr class="api apilevel-" > 785 786 787 <td><code> 788 789 790 791 792 793 double</code> 794 </td> 795 796 <td width="100%"> 797 <code> 798 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#getSwipeDeadZonePercentage()">getSwipeDeadZonePercentage</a>() 799 </code> 800 801 <p>Returns the percentage of a widget's size that's considered as a no-touch 802 zone when swiping. 803 804 805</p> 806 807 </td> 808 </tr> 809 810 811 812 <tr class="api apilevel-" > 813 814 815 <td><code> 816 817 818 819 820 821 boolean</code> 822 </td> 823 824 <td width="100%"> 825 <code> 826 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollBackward(int)">scrollBackward</a>(int steps) 827 </code> 828 829 <p>Performs a backward scroll. 830 831 832</p> 833 834 </td> 835 </tr> 836 837 838 839 <tr class="api apilevel-" > 840 841 842 <td><code> 843 844 845 846 847 848 boolean</code> 849 </td> 850 851 <td width="100%"> 852 <code> 853 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollBackward()">scrollBackward</a>() 854 </code> 855 856 <p>Performs a backward scroll with the default number of scroll steps (55). 857 858 859</p> 860 861 </td> 862 </tr> 863 864 865 866 <tr class="api apilevel-" > 867 868 869 <td><code> 870 871 872 873 874 875 boolean</code> 876 </td> 877 878 <td width="100%"> 879 <code> 880 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView</a>(String text) 881 </code> 882 883 <p>Performs a forward scroll action on the scrollable layout element until 884 the content-description is found, or until swipe attempts have been exhausted. 885 886 887</p> 888 889 </td> 890 </tr> 891 892 893 894 <tr class="api apilevel-" > 895 896 897 <td><code> 898 899 900 901 902 903 boolean</code> 904 </td> 905 906 <td width="100%"> 907 <code> 908 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollForward(int)">scrollForward</a>(int steps) 909 </code> 910 911 <p>Performs a forward scroll. 912 913 914</p> 915 916 </td> 917 </tr> 918 919 920 921 <tr class="api apilevel-" > 922 923 924 <td><code> 925 926 927 928 929 930 boolean</code> 931 </td> 932 933 <td width="100%"> 934 <code> 935 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollForward()">scrollForward</a>() 936 </code> 937 938 <p>Performs a forward scroll with the default number of scroll steps (55). 939 940 941</p> 942 943 </td> 944 </tr> 945 946 947 948 <tr class="api apilevel-" > 949 950 951 <td><code> 952 953 954 955 956 957 boolean</code> 958 </td> 959 960 <td width="100%"> 961 <code> 962 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollIntoView(android.support.test.uiautomator.UiSelector)">scrollIntoView</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 963 </code> 964 965 <p>Perform a scroll forward action to move through the scrollable layout 966 element until a visible item that matches the selector is found. 967 968 969</p> 970 971 </td> 972 </tr> 973 974 975 976 <tr class="api apilevel-" > 977 978 979 <td><code> 980 981 982 983 984 985 boolean</code> 986 </td> 987 988 <td width="100%"> 989 <code> 990 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollIntoView(android.support.test.uiautomator.UiObject)">scrollIntoView</a>(<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> obj) 991 </code> 992 993 <p>Perform a forward scroll action to move through the scrollable layout element until 994 a visible item that matches the <code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> is found. 995 996 997</p> 998 999 </td> 1000 </tr> 1001 1002 1003 1004 <tr class="api apilevel-" > 1005 1006 1007 <td><code> 1008 1009 1010 1011 1012 1013 boolean</code> 1014 </td> 1015 1016 <td width="100%"> 1017 <code> 1018 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollTextIntoView(java.lang.String)">scrollTextIntoView</a>(String text) 1019 </code> 1020 1021 <p>Performs a forward scroll action on the scrollable layout element until 1022 the text you provided is visible, or until swipe attempts have been exhausted. 1023 1024 1025</p> 1026 1027 </td> 1028 </tr> 1029 1030 1031 1032 <tr class="api apilevel-" > 1033 1034 1035 <td><code> 1036 1037 1038 1039 1040 1041 boolean</code> 1042 </td> 1043 1044 <td width="100%"> 1045 <code> 1046 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollToBeginning(int)">scrollToBeginning</a>(int maxSwipes) 1047 </code> 1048 1049 <p>Scrolls to the beginning of a scrollable layout element. 1050 1051 1052</p> 1053 1054 </td> 1055 </tr> 1056 1057 1058 1059 <tr class="api apilevel-" > 1060 1061 1062 <td><code> 1063 1064 1065 1066 1067 1068 boolean</code> 1069 </td> 1070 1071 <td width="100%"> 1072 <code> 1073 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollToBeginning(int, int)">scrollToBeginning</a>(int maxSwipes, int steps) 1074 </code> 1075 1076 <p>Scrolls to the beginning of a scrollable layout element. 1077 1078 1079</p> 1080 1081 </td> 1082 </tr> 1083 1084 1085 1086 <tr class="api apilevel-" > 1087 1088 1089 <td><code> 1090 1091 1092 1093 1094 1095 boolean</code> 1096 </td> 1097 1098 <td width="100%"> 1099 <code> 1100 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollToEnd(int)">scrollToEnd</a>(int maxSwipes) 1101 </code> 1102 1103 <p>Scrolls to the end of a scrollable layout element. 1104 1105 1106</p> 1107 1108 </td> 1109 </tr> 1110 1111 1112 1113 <tr class="api apilevel-" > 1114 1115 1116 <td><code> 1117 1118 1119 1120 1121 1122 boolean</code> 1123 </td> 1124 1125 <td width="100%"> 1126 <code> 1127 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollToEnd(int, int)">scrollToEnd</a>(int maxSwipes, int steps) 1128 </code> 1129 1130 <p>Scrolls to the end of a scrollable layout element. 1131 1132 1133</p> 1134 1135 </td> 1136 </tr> 1137 1138 1139 1140 <tr class="api apilevel-" > 1141 1142 1143 <td><code> 1144 1145 1146 1147 1148 1149 <a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code> 1150 </td> 1151 1152 <td width="100%"> 1153 <code> 1154 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#setAsHorizontalList()">setAsHorizontalList</a>() 1155 </code> 1156 1157 <p>Set the direction of swipes to be horizontal when performing scroll actions. 1158 1159 1160</p> 1161 1162 </td> 1163 </tr> 1164 1165 1166 1167 <tr class="api apilevel-" > 1168 1169 1170 <td><code> 1171 1172 1173 1174 1175 1176 <a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code> 1177 </td> 1178 1179 <td width="100%"> 1180 <code> 1181 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#setAsVerticalList()">setAsVerticalList</a>() 1182 </code> 1183 1184 <p>Set the direction of swipes to be vertical when performing scroll actions. 1185 1186 1187</p> 1188 1189 </td> 1190 </tr> 1191 1192 1193 1194 <tr class="api apilevel-" > 1195 1196 1197 <td><code> 1198 1199 1200 1201 1202 1203 <a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code> 1204 </td> 1205 1206 <td width="100%"> 1207 <code> 1208 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#setMaxSearchSwipes(int)">setMaxSearchSwipes</a>(int swipes) 1209 </code> 1210 1211 <p>Sets the maximum number of scrolls allowed when performing a 1212 scroll action in search of a child element. 1213 1214 1215</p> 1216 1217 </td> 1218 </tr> 1219 1220 1221 1222 <tr class="api apilevel-" > 1223 1224 1225 <td><code> 1226 1227 1228 1229 1230 1231 <a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code> 1232 </td> 1233 1234 <td width="100%"> 1235 <code> 1236 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#setSwipeDeadZonePercentage(double)">setSwipeDeadZonePercentage</a>(double swipeDeadZonePercentage) 1237 </code> 1238 1239 <p>Sets the percentage of a widget's size that's considered as no-touch 1240 zone when swiping. 1241 1242 1243</p> 1244 1245 </td> 1246 </tr> 1247 1248 1249 1250</table> 1251 1252 1253 1254 1255<!-- ========== METHOD SUMMARY =========== --> 1256<table id="promethods" class="reponsive methods"> 1257<tr><th colspan="2"><h3>Protected methods</h3></th></tr> 1258 1259 1260 1261 1262 <tr class="api apilevel-" > 1263 1264 1265 <td><code> 1266 1267 1268 1269 1270 1271 boolean</code> 1272 </td> 1273 1274 <td width="100%"> 1275 <code> 1276 <a href="/reference/android/support/test/uiautomator/UiScrollable.html#exists(android.support.test.uiautomator.UiSelector)">exists</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 1277 </code> 1278 1279 <p>Used privately when performing swipe searches to decide if an element has become 1280 visible or not. 1281 1282 1283</p> 1284 1285 </td> 1286 </tr> 1287 1288 1289 1290</table> 1291 1292 1293 1294 1295 1296<!-- ========== METHOD SUMMARY =========== --> 1297<table id="inhmethods" class="methods inhtable"> 1298<tr><th><h3>Inherited methods</h3></th></tr> 1299 1300 1301<tr class="api apilevel-" > 1302<td colspan="2"> 1303 1304 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.uiautomator.UiCollection" class="jd-expando-trigger closed" 1305 ><img height="34" id="inherited-methods-android.support.test.uiautomator.UiCollection-trigger" 1306 src="/assets/images/styles/disclosure_down.png" 1307 class="jd-expando-trigger-img" /></a>From 1308class 1309<code> 1310 1311 <a href="/reference/android/support/test/uiautomator/UiCollection.html">android.support.test.uiautomator.UiCollection</a> 1312 1313</code> 1314<div id="inherited-methods-android.support.test.uiautomator.UiCollection"> 1315 <div id="inherited-methods-android.support.test.uiautomator.UiCollection-list" 1316 class="jd-inheritedlinks"> 1317 </div> 1318 <div id="inherited-methods-android.support.test.uiautomator.UiCollection-summary" style="display: none;"> 1319 <table class="jd-sumtable-expando responsive"> 1320 1321 1322 1323 1324 <tr class="api apilevel-" > 1325 1326 1327 <td><code> 1328 1329 1330 1331 1332 1333 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1334 </td> 1335 1336 <td width="100%"> 1337 <code> 1338 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByDescription</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 1339 </code> 1340 1341 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 1342 selector. 1343 1344 1345</p> 1346 1347 </td> 1348 </tr> 1349 1350 1351 1352 <tr class="api apilevel-" > 1353 1354 1355 <td><code> 1356 1357 1358 1359 1360 1361 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1362 </td> 1363 1364 <td width="100%"> 1365 <code> 1366 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByInstance(android.support.test.uiautomator.UiSelector, int)">getChildByInstance</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, int instance) 1367 </code> 1368 1369 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 1370 selector. 1371 1372 1373</p> 1374 1375 </td> 1376 </tr> 1377 1378 1379 1380 <tr class="api apilevel-" > 1381 1382 1383 <td><code> 1384 1385 1386 1387 1388 1389 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1390 </td> 1391 1392 <td width="100%"> 1393 <code> 1394 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByText</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, String text) 1395 </code> 1396 1397 <p>Searches for child UI element within the constraints of this UiCollection <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 1398 selector. 1399 1400 1401</p> 1402 1403 </td> 1404 </tr> 1405 1406 1407 1408 <tr class="api apilevel-" > 1409 1410 1411 <td><code> 1412 1413 1414 1415 1416 1417 int</code> 1418 </td> 1419 1420 <td width="100%"> 1421 <code> 1422 <a href="/reference/android/support/test/uiautomator/UiCollection.html#getChildCount(android.support.test.uiautomator.UiSelector)">getChildCount</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern) 1423 </code> 1424 1425 <p>Counts child UI element instances matching the <code>childPattern</code> 1426 argument. 1427 1428 1429</p> 1430 1431 </td> 1432 </tr> 1433 1434 1435 1436 </table> 1437 </div> 1438</div> 1439</td></tr> 1440 1441 1442 1443<tr class="api apilevel-" > 1444<td colspan="2"> 1445 1446 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.uiautomator.UiObject" class="jd-expando-trigger closed" 1447 ><img height="34" id="inherited-methods-android.support.test.uiautomator.UiObject-trigger" 1448 src="/assets/images/styles/disclosure_down.png" 1449 class="jd-expando-trigger-img" /></a>From 1450class 1451<code> 1452 1453 <a href="/reference/android/support/test/uiautomator/UiObject.html">android.support.test.uiautomator.UiObject</a> 1454 1455</code> 1456<div id="inherited-methods-android.support.test.uiautomator.UiObject"> 1457 <div id="inherited-methods-android.support.test.uiautomator.UiObject-list" 1458 class="jd-inheritedlinks"> 1459 </div> 1460 <div id="inherited-methods-android.support.test.uiautomator.UiObject-summary" style="display: none;"> 1461 <table class="jd-sumtable-expando responsive"> 1462 1463 1464 1465 1466 <tr class="api apilevel-" > 1467 1468 1469 <td><code> 1470 1471 1472 1473 1474 1475 void</code> 1476 </td> 1477 1478 <td width="100%"> 1479 <code> 1480 <a href="/reference/android/support/test/uiautomator/UiObject.html#clearTextField()">clearTextField</a>() 1481 </code> 1482 1483 <p>Clears the existing text contents in an editable field. 1484 1485 1486</p> 1487 1488 </td> 1489 </tr> 1490 1491 1492 1493 <tr class="api apilevel-" > 1494 1495 1496 <td><code> 1497 1498 1499 1500 1501 1502 boolean</code> 1503 </td> 1504 1505 <td width="100%"> 1506 <code> 1507 <a href="/reference/android/support/test/uiautomator/UiObject.html#click()">click</a>() 1508 </code> 1509 1510 <p>Performs a click at the center of the visible bounds of the UI element represented 1511 by this UiObject. 1512 1513 1514</p> 1515 1516 </td> 1517 </tr> 1518 1519 1520 1521 <tr class="api apilevel-" > 1522 1523 1524 <td><code> 1525 1526 1527 1528 1529 1530 boolean</code> 1531 </td> 1532 1533 <td width="100%"> 1534 <code> 1535 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a>() 1536 </code> 1537 1538 <p>Waits for window transitions that would typically take longer than the 1539 usual default timeouts. 1540 1541 1542</p> 1543 1544 </td> 1545 </tr> 1546 1547 1548 1549 <tr class="api apilevel-" > 1550 1551 1552 <td><code> 1553 1554 1555 1556 1557 1558 boolean</code> 1559 </td> 1560 1561 <td width="100%"> 1562 <code> 1563 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a>(long timeout) 1564 </code> 1565 1566 <p>Performs a click at the center of the visible bounds of the UI element represented 1567 by this UiObject and waits for window transitions. 1568 1569 1570</p> 1571 1572 </td> 1573 </tr> 1574 1575 1576 1577 <tr class="api apilevel-" > 1578 1579 1580 <td><code> 1581 1582 1583 1584 1585 1586 boolean</code> 1587 </td> 1588 1589 <td width="100%"> 1590 <code> 1591 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickBottomRight()">clickBottomRight</a>() 1592 </code> 1593 1594 <p>Clicks the bottom and right corner of the UI element 1595 1596 1597</p> 1598 1599 </td> 1600 </tr> 1601 1602 1603 1604 <tr class="api apilevel-" > 1605 1606 1607 <td><code> 1608 1609 1610 1611 1612 1613 boolean</code> 1614 </td> 1615 1616 <td width="100%"> 1617 <code> 1618 <a href="/reference/android/support/test/uiautomator/UiObject.html#clickTopLeft()">clickTopLeft</a>() 1619 </code> 1620 1621 <p>Clicks the top and left corner of the UI element 1622 1623 1624</p> 1625 1626 </td> 1627 </tr> 1628 1629 1630 1631 <tr class="api apilevel-" > 1632 1633 1634 <td><code> 1635 1636 1637 1638 1639 1640 boolean</code> 1641 </td> 1642 1643 <td width="100%"> 1644 <code> 1645 <a href="/reference/android/support/test/uiautomator/UiObject.html#dragTo(android.support.test.uiautomator.UiObject, int)">dragTo</a>(<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> destObj, int steps) 1646 </code> 1647 1648 <p>Drags this object to a destination UiObject. 1649 1650 1651</p> 1652 1653 </td> 1654 </tr> 1655 1656 1657 1658 <tr class="api apilevel-" > 1659 1660 1661 <td><code> 1662 1663 1664 1665 1666 1667 boolean</code> 1668 </td> 1669 1670 <td width="100%"> 1671 <code> 1672 <a href="/reference/android/support/test/uiautomator/UiObject.html#dragTo(int, int, int)">dragTo</a>(int destX, int destY, int steps) 1673 </code> 1674 1675 <p>Drags this object to arbitrary coordinates. 1676 1677 1678</p> 1679 1680 </td> 1681 </tr> 1682 1683 1684 1685 <tr class="api apilevel-" > 1686 1687 1688 <td><code> 1689 1690 1691 1692 1693 1694 boolean</code> 1695 </td> 1696 1697 <td width="100%"> 1698 <code> 1699 <a href="/reference/android/support/test/uiautomator/UiObject.html#exists()">exists</a>() 1700 </code> 1701 1702 <p>Check if view exists. 1703 1704 1705</p> 1706 1707 </td> 1708 </tr> 1709 1710 1711 1712 <tr class="api apilevel-" > 1713 1714 1715 <td><code> 1716 1717 1718 1719 1720 1721 AccessibilityNodeInfo</code> 1722 </td> 1723 1724 <td width="100%"> 1725 <code> 1726 <a href="/reference/android/support/test/uiautomator/UiObject.html#findAccessibilityNodeInfo(long)">findAccessibilityNodeInfo</a>(long timeout) 1727 </code> 1728 1729 <p>Finds a matching UI element in the accessibility hierarchy, by 1730 using the selector for this UiObject. 1731 1732 1733</p> 1734 1735 </td> 1736 </tr> 1737 1738 1739 1740 <tr class="api apilevel-" > 1741 1742 1743 <td><code> 1744 1745 1746 1747 1748 1749 Rect</code> 1750 </td> 1751 1752 <td width="100%"> 1753 <code> 1754 <a href="/reference/android/support/test/uiautomator/UiObject.html#getBounds()">getBounds</a>() 1755 </code> 1756 1757 <p>Returns the view's <code>bounds</code> property. 1758 1759 1760</p> 1761 1762 </td> 1763 </tr> 1764 1765 1766 1767 <tr class="api apilevel-" > 1768 1769 1770 <td><code> 1771 1772 1773 1774 1775 1776 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1777 </td> 1778 1779 <td width="100%"> 1780 <code> 1781 <a href="/reference/android/support/test/uiautomator/UiObject.html#getChild(android.support.test.uiautomator.UiSelector)">getChild</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 1782 </code> 1783 1784 <p>Creates a new UiObject for a child view that is under the present UiObject. 1785 1786 1787</p> 1788 1789 </td> 1790 </tr> 1791 1792 1793 1794 <tr class="api apilevel-" > 1795 1796 1797 <td><code> 1798 1799 1800 1801 1802 1803 int</code> 1804 </td> 1805 1806 <td width="100%"> 1807 <code> 1808 <a href="/reference/android/support/test/uiautomator/UiObject.html#getChildCount()">getChildCount</a>() 1809 </code> 1810 1811 <p>Counts the child views immediately under the present UiObject. 1812 1813 1814</p> 1815 1816 </td> 1817 </tr> 1818 1819 1820 1821 <tr class="api apilevel-" > 1822 1823 1824 <td><code> 1825 1826 1827 1828 1829 1830 String</code> 1831 </td> 1832 1833 <td width="100%"> 1834 <code> 1835 <a href="/reference/android/support/test/uiautomator/UiObject.html#getClassName()">getClassName</a>() 1836 </code> 1837 1838 <p>Retrieves the <code>className</code> property of the UI element. 1839 1840 1841</p> 1842 1843 </td> 1844 </tr> 1845 1846 1847 1848 <tr class="api apilevel-" > 1849 1850 1851 <td><code> 1852 1853 1854 1855 1856 1857 String</code> 1858 </td> 1859 1860 <td width="100%"> 1861 <code> 1862 <a href="/reference/android/support/test/uiautomator/UiObject.html#getContentDescription()">getContentDescription</a>() 1863 </code> 1864 1865 <p>Reads the <code>content_desc</code> property of the UI element 1866 1867 1868</p> 1869 1870 </td> 1871 </tr> 1872 1873 1874 1875 <tr class="api apilevel-" > 1876 1877 1878 <td><code> 1879 1880 1881 1882 1883 1884 <a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> 1885 </td> 1886 1887 <td width="100%"> 1888 <code> 1889 <a href="/reference/android/support/test/uiautomator/UiObject.html#getFromParent(android.support.test.uiautomator.UiSelector)">getFromParent</a>(<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector) 1890 </code> 1891 1892 <p>Creates a new UiObject for a sibling view or a child of the sibling view, 1893 relative to the present UiObject. 1894 1895 1896</p> 1897 1898 </td> 1899 </tr> 1900 1901 1902 1903 <tr class="api apilevel-" > 1904 1905 1906 <td><code> 1907 1908 1909 1910 1911 1912 String</code> 1913 </td> 1914 1915 <td width="100%"> 1916 <code> 1917 <a href="/reference/android/support/test/uiautomator/UiObject.html#getPackageName()">getPackageName</a>() 1918 </code> 1919 1920 <p>Reads the view's <code>package</code> property 1921 1922 1923</p> 1924 1925 </td> 1926 </tr> 1927 1928 1929 1930 <tr class="api apilevel-" > 1931 1932 1933 <td><code> 1934 1935 1936 1937 final 1938 1939 <a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> 1940 </td> 1941 1942 <td width="100%"> 1943 <code> 1944 <a href="/reference/android/support/test/uiautomator/UiObject.html#getSelector()">getSelector</a>() 1945 </code> 1946 1947 <p>Debugging helper. 1948 1949 1950</p> 1951 1952 </td> 1953 </tr> 1954 1955 1956 1957 <tr class="api apilevel-" > 1958 1959 1960 <td><code> 1961 1962 1963 1964 1965 1966 String</code> 1967 </td> 1968 1969 <td width="100%"> 1970 <code> 1971 <a href="/reference/android/support/test/uiautomator/UiObject.html#getText()">getText</a>() 1972 </code> 1973 1974 <p>Reads the <code>text</code> property of the UI element 1975 1976 1977</p> 1978 1979 </td> 1980 </tr> 1981 1982 1983 1984 <tr class="api apilevel-" > 1985 1986 1987 <td><code> 1988 1989 1990 1991 1992 1993 Rect</code> 1994 </td> 1995 1996 <td width="100%"> 1997 <code> 1998 <a href="/reference/android/support/test/uiautomator/UiObject.html#getVisibleBounds()">getVisibleBounds</a>() 1999 </code> 2000 2001 <p>Returns the visible bounds of the view. 2002 2003 2004</p> 2005 2006 </td> 2007 </tr> 2008 2009 2010 2011 <tr class="api apilevel-" > 2012 2013 2014 <td><code> 2015 2016 2017 2018 2019 2020 boolean</code> 2021 </td> 2022 2023 <td width="100%"> 2024 <code> 2025 <a href="/reference/android/support/test/uiautomator/UiObject.html#isCheckable()">isCheckable</a>() 2026 </code> 2027 2028 <p>Checks if the UI element's <code>checkable</code> property is currently true. 2029 2030 2031</p> 2032 2033 </td> 2034 </tr> 2035 2036 2037 2038 <tr class="api apilevel-" > 2039 2040 2041 <td><code> 2042 2043 2044 2045 2046 2047 boolean</code> 2048 </td> 2049 2050 <td width="100%"> 2051 <code> 2052 <a href="/reference/android/support/test/uiautomator/UiObject.html#isChecked()">isChecked</a>() 2053 </code> 2054 2055 <p>Check if the UI element's <code>checked</code> property is currently true 2056 2057 2058</p> 2059 2060 </td> 2061 </tr> 2062 2063 2064 2065 <tr class="api apilevel-" > 2066 2067 2068 <td><code> 2069 2070 2071 2072 2073 2074 boolean</code> 2075 </td> 2076 2077 <td width="100%"> 2078 <code> 2079 <a href="/reference/android/support/test/uiautomator/UiObject.html#isClickable()">isClickable</a>() 2080 </code> 2081 2082 <p>Checks if the UI element's <code>clickable</code> property is currently true. 2083 2084 2085</p> 2086 2087 </td> 2088 </tr> 2089 2090 2091 2092 <tr class="api apilevel-" > 2093 2094 2095 <td><code> 2096 2097 2098 2099 2100 2101 boolean</code> 2102 </td> 2103 2104 <td width="100%"> 2105 <code> 2106 <a href="/reference/android/support/test/uiautomator/UiObject.html#isEnabled()">isEnabled</a>() 2107 </code> 2108 2109 <p>Checks if the UI element's <code>enabled</code> property is currently true. 2110 2111 2112</p> 2113 2114 </td> 2115 </tr> 2116 2117 2118 2119 <tr class="api apilevel-" > 2120 2121 2122 <td><code> 2123 2124 2125 2126 2127 2128 boolean</code> 2129 </td> 2130 2131 <td width="100%"> 2132 <code> 2133 <a href="/reference/android/support/test/uiautomator/UiObject.html#isFocusable()">isFocusable</a>() 2134 </code> 2135 2136 <p>Check if the UI element's <code>focusable</code> property is currently true. 2137 2138 2139</p> 2140 2141 </td> 2142 </tr> 2143 2144 2145 2146 <tr class="api apilevel-" > 2147 2148 2149 <td><code> 2150 2151 2152 2153 2154 2155 boolean</code> 2156 </td> 2157 2158 <td width="100%"> 2159 <code> 2160 <a href="/reference/android/support/test/uiautomator/UiObject.html#isFocused()">isFocused</a>() 2161 </code> 2162 2163 <p>Check if the UI element's <code>focused</code> property is currently true 2164 2165 2166</p> 2167 2168 </td> 2169 </tr> 2170 2171 2172 2173 <tr class="api apilevel-" > 2174 2175 2176 <td><code> 2177 2178 2179 2180 2181 2182 boolean</code> 2183 </td> 2184 2185 <td width="100%"> 2186 <code> 2187 <a href="/reference/android/support/test/uiautomator/UiObject.html#isLongClickable()">isLongClickable</a>() 2188 </code> 2189 2190 <p>Check if the view's <code>long-clickable</code> property is currently true 2191 2192 2193</p> 2194 2195 </td> 2196 </tr> 2197 2198 2199 2200 <tr class="api apilevel-" > 2201 2202 2203 <td><code> 2204 2205 2206 2207 2208 2209 boolean</code> 2210 </td> 2211 2212 <td width="100%"> 2213 <code> 2214 <a href="/reference/android/support/test/uiautomator/UiObject.html#isScrollable()">isScrollable</a>() 2215 </code> 2216 2217 <p>Check if the view's <code>scrollable</code> property is currently true 2218 2219 2220</p> 2221 2222 </td> 2223 </tr> 2224 2225 2226 2227 <tr class="api apilevel-" > 2228 2229 2230 <td><code> 2231 2232 2233 2234 2235 2236 boolean</code> 2237 </td> 2238 2239 <td width="100%"> 2240 <code> 2241 <a href="/reference/android/support/test/uiautomator/UiObject.html#isSelected()">isSelected</a>() 2242 </code> 2243 2244 <p>Checks if the UI element's <code>selected</code> property is currently true. 2245 2246 2247</p> 2248 2249 </td> 2250 </tr> 2251 2252 2253 2254 <tr class="api apilevel-" > 2255 2256 2257 <td><code> 2258 2259 2260 2261 2262 2263 boolean</code> 2264 </td> 2265 2266 <td width="100%"> 2267 <code> 2268 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClick()">longClick</a>() 2269 </code> 2270 2271 <p>Long clicks the center of the visible bounds of the UI element 2272 2273 2274</p> 2275 2276 </td> 2277 </tr> 2278 2279 2280 2281 <tr class="api apilevel-" > 2282 2283 2284 <td><code> 2285 2286 2287 2288 2289 2290 boolean</code> 2291 </td> 2292 2293 <td width="100%"> 2294 <code> 2295 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClickBottomRight()">longClickBottomRight</a>() 2296 </code> 2297 2298 <p>Long clicks bottom and right corner of the UI element 2299 2300 2301</p> 2302 2303 </td> 2304 </tr> 2305 2306 2307 2308 <tr class="api apilevel-" > 2309 2310 2311 <td><code> 2312 2313 2314 2315 2316 2317 boolean</code> 2318 </td> 2319 2320 <td width="100%"> 2321 <code> 2322 <a href="/reference/android/support/test/uiautomator/UiObject.html#longClickTopLeft()">longClickTopLeft</a>() 2323 </code> 2324 2325 <p>Long clicks on the top and left corner of the UI element 2326 2327 2328</p> 2329 2330 </td> 2331 </tr> 2332 2333 2334 2335 <tr class="api apilevel-" > 2336 2337 2338 <td><code> 2339 2340 2341 2342 2343 2344 boolean</code> 2345 </td> 2346 2347 <td width="100%"> 2348 <code> 2349 <a href="/reference/android/support/test/uiautomator/UiObject.html#performMultiPointerGesture(android.view.MotionEvent.PointerCoords[]...)">performMultiPointerGesture</a>(PointerCoords... touches) 2350 </code> 2351 2352 <p>Performs a multi-touch gesture. 2353 2354 2355</p> 2356 2357 </td> 2358 </tr> 2359 2360 2361 2362 <tr class="api apilevel-" > 2363 2364 2365 <td><code> 2366 2367 2368 2369 2370 2371 boolean</code> 2372 </td> 2373 2374 <td width="100%"> 2375 <code> 2376 <a href="/reference/android/support/test/uiautomator/UiObject.html#performTwoPointerGesture(android.graphics.Point, android.graphics.Point, android.graphics.Point, android.graphics.Point, int)">performTwoPointerGesture</a>(Point startPoint1, Point startPoint2, Point endPoint1, Point endPoint2, int steps) 2377 </code> 2378 2379 <p>Generates a two-pointer gesture with arbitrary starting and ending points. 2380 2381 2382</p> 2383 2384 </td> 2385 </tr> 2386 2387 2388 2389 <tr class="api apilevel-" > 2390 2391 2392 <td><code> 2393 2394 2395 2396 2397 2398 boolean</code> 2399 </td> 2400 2401 <td width="100%"> 2402 <code> 2403 <a href="/reference/android/support/test/uiautomator/UiObject.html#pinchIn(int, int)">pinchIn</a>(int percent, int steps) 2404 </code> 2405 2406 <p>Performs a two-pointer gesture, where each pointer moves diagonally 2407 toward the other, from the edges to the center of this UiObject . 2408 2409 2410</p> 2411 2412 </td> 2413 </tr> 2414 2415 2416 2417 <tr class="api apilevel-" > 2418 2419 2420 <td><code> 2421 2422 2423 2424 2425 2426 boolean</code> 2427 </td> 2428 2429 <td width="100%"> 2430 <code> 2431 <a href="/reference/android/support/test/uiautomator/UiObject.html#pinchOut(int, int)">pinchOut</a>(int percent, int steps) 2432 </code> 2433 2434 <p>Performs a two-pointer gesture, where each pointer moves diagonally 2435 opposite across the other, from the center out towards the edges of the 2436 this UiObject. 2437 2438 2439</p> 2440 2441 </td> 2442 </tr> 2443 2444 2445 2446 <tr class="api apilevel-" > 2447 2448 2449 <td><code> 2450 2451 2452 2453 2454 2455 boolean</code> 2456 </td> 2457 2458 <td width="100%"> 2459 <code> 2460 <a href="/reference/android/support/test/uiautomator/UiObject.html#setText(java.lang.String)">setText</a>(String text) 2461 </code> 2462 2463 <p>Sets the text in an editable field, after clearing the field's content. 2464 2465 2466</p> 2467 2468 </td> 2469 </tr> 2470 2471 2472 2473 <tr class="api apilevel-" > 2474 2475 2476 <td><code> 2477 2478 2479 2480 2481 2482 boolean</code> 2483 </td> 2484 2485 <td width="100%"> 2486 <code> 2487 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeDown(int)">swipeDown</a>(int steps) 2488 </code> 2489 2490 <p>Performs the swipe down action on the UiObject. 2491 2492 2493</p> 2494 2495 </td> 2496 </tr> 2497 2498 2499 2500 <tr class="api apilevel-" > 2501 2502 2503 <td><code> 2504 2505 2506 2507 2508 2509 boolean</code> 2510 </td> 2511 2512 <td width="100%"> 2513 <code> 2514 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeLeft(int)">swipeLeft</a>(int steps) 2515 </code> 2516 2517 <p>Performs the swipe left action on the UiObject. 2518 2519 2520</p> 2521 2522 </td> 2523 </tr> 2524 2525 2526 2527 <tr class="api apilevel-" > 2528 2529 2530 <td><code> 2531 2532 2533 2534 2535 2536 boolean</code> 2537 </td> 2538 2539 <td width="100%"> 2540 <code> 2541 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeRight(int)">swipeRight</a>(int steps) 2542 </code> 2543 2544 <p>Performs the swipe right action on the UiObject. 2545 2546 2547</p> 2548 2549 </td> 2550 </tr> 2551 2552 2553 2554 <tr class="api apilevel-" > 2555 2556 2557 <td><code> 2558 2559 2560 2561 2562 2563 boolean</code> 2564 </td> 2565 2566 <td width="100%"> 2567 <code> 2568 <a href="/reference/android/support/test/uiautomator/UiObject.html#swipeUp(int)">swipeUp</a>(int steps) 2569 </code> 2570 2571 <p>Performs the swipe up action on the UiObject. 2572 2573 2574</p> 2575 2576 </td> 2577 </tr> 2578 2579 2580 2581 <tr class="api apilevel-" > 2582 2583 2584 <td><code> 2585 2586 2587 2588 2589 2590 boolean</code> 2591 </td> 2592 2593 <td width="100%"> 2594 <code> 2595 <a href="/reference/android/support/test/uiautomator/UiObject.html#waitForExists(long)">waitForExists</a>(long timeout) 2596 </code> 2597 2598 <p>Waits a specified length of time for a view to become visible. 2599 2600 2601</p> 2602 2603 </td> 2604 </tr> 2605 2606 2607 2608 <tr class="api apilevel-" > 2609 2610 2611 <td><code> 2612 2613 2614 2615 2616 2617 boolean</code> 2618 </td> 2619 2620 <td width="100%"> 2621 <code> 2622 <a href="/reference/android/support/test/uiautomator/UiObject.html#waitUntilGone(long)">waitUntilGone</a>(long timeout) 2623 </code> 2624 2625 <p>Waits a specified length of time for a view to become undetectable. 2626 2627 2628</p> 2629 2630 </td> 2631 </tr> 2632 2633 2634 2635 </table> 2636 </div> 2637</div> 2638</td></tr> 2639 2640 2641 2642<tr class="api apilevel-" > 2643<td colspan="2"> 2644 2645 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 2646 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 2647 src="/assets/images/styles/disclosure_down.png" 2648 class="jd-expando-trigger-img" /></a>From 2649class 2650<code> 2651 2652 java.lang.Object 2653 2654</code> 2655<div id="inherited-methods-java.lang.Object"> 2656 <div id="inherited-methods-java.lang.Object-list" 2657 class="jd-inheritedlinks"> 2658 </div> 2659 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 2660 <table class="jd-sumtable-expando responsive"> 2661 2662 2663 2664 2665 <tr class="api apilevel-" > 2666 2667 2668 <td><code> 2669 2670 2671 2672 2673 2674 Object</code> 2675 </td> 2676 2677 <td width="100%"> 2678 <code> 2679 clone() 2680 </code> 2681 2682 </td> 2683 </tr> 2684 2685 2686 2687 <tr class="api apilevel-" > 2688 2689 2690 <td><code> 2691 2692 2693 2694 2695 2696 boolean</code> 2697 </td> 2698 2699 <td width="100%"> 2700 <code> 2701 equals(Object arg0) 2702 </code> 2703 2704 </td> 2705 </tr> 2706 2707 2708 2709 <tr class="api apilevel-" > 2710 2711 2712 <td><code> 2713 2714 2715 2716 2717 2718 void</code> 2719 </td> 2720 2721 <td width="100%"> 2722 <code> 2723 finalize() 2724 </code> 2725 2726 </td> 2727 </tr> 2728 2729 2730 2731 <tr class="api apilevel-" > 2732 2733 2734 <td><code> 2735 2736 2737 2738 final 2739 2740 Class<?></code> 2741 </td> 2742 2743 <td width="100%"> 2744 <code> 2745 getClass() 2746 </code> 2747 2748 </td> 2749 </tr> 2750 2751 2752 2753 <tr class="api apilevel-" > 2754 2755 2756 <td><code> 2757 2758 2759 2760 2761 2762 int</code> 2763 </td> 2764 2765 <td width="100%"> 2766 <code> 2767 hashCode() 2768 </code> 2769 2770 </td> 2771 </tr> 2772 2773 2774 2775 <tr class="api apilevel-" > 2776 2777 2778 <td><code> 2779 2780 2781 2782 final 2783 2784 void</code> 2785 </td> 2786 2787 <td width="100%"> 2788 <code> 2789 notify() 2790 </code> 2791 2792 </td> 2793 </tr> 2794 2795 2796 2797 <tr class="api apilevel-" > 2798 2799 2800 <td><code> 2801 2802 2803 2804 final 2805 2806 void</code> 2807 </td> 2808 2809 <td width="100%"> 2810 <code> 2811 notifyAll() 2812 </code> 2813 2814 </td> 2815 </tr> 2816 2817 2818 2819 <tr class="api apilevel-" > 2820 2821 2822 <td><code> 2823 2824 2825 2826 2827 2828 String</code> 2829 </td> 2830 2831 <td width="100%"> 2832 <code> 2833 toString() 2834 </code> 2835 2836 </td> 2837 </tr> 2838 2839 2840 2841 <tr class="api apilevel-" > 2842 2843 2844 <td><code> 2845 2846 2847 2848 final 2849 2850 void</code> 2851 </td> 2852 2853 <td width="100%"> 2854 <code> 2855 wait(long arg0, int arg1) 2856 </code> 2857 2858 </td> 2859 </tr> 2860 2861 2862 2863 <tr class="api apilevel-" > 2864 2865 2866 <td><code> 2867 2868 2869 2870 final 2871 2872 void</code> 2873 </td> 2874 2875 <td width="100%"> 2876 <code> 2877 wait(long arg0) 2878 </code> 2879 2880 </td> 2881 </tr> 2882 2883 2884 2885 <tr class="api apilevel-" > 2886 2887 2888 <td><code> 2889 2890 2891 2892 final 2893 2894 void</code> 2895 </td> 2896 2897 <td width="100%"> 2898 <code> 2899 wait() 2900 </code> 2901 2902 </td> 2903 </tr> 2904 2905 2906 2907 </table> 2908 </div> 2909</div> 2910</td></tr> 2911 2912 2913</table> 2914 2915 2916 2917<!-- XML Attributes --> 2918 2919 2920<!-- Enum Values --> 2921 2922 2923<!-- Constants --> 2924 2925 2926<!-- Fields --> 2927 2928 2929<!-- Public ctors --> 2930 2931 2932<!-- ========= CONSTRUCTOR DETAIL ======== --> 2933<h2 class="api-section">Public constructors</h2> 2934 2935 2936 2937<A NAME="UiScrollable(android.support.test.uiautomator.UiSelector)"></A> 2938 2939<div class="api apilevel-"> 2940 <h3 class="api-name">UiScrollable</h3> 2941 <div class="api-level"> 2942 <div></div> 2943 2944 2945 2946 </div> 2947<pre class="api-signature no-pretty-print"> 2948UiScrollable (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> container)</pre> 2949 2950 2951 2952 2953 <p>Constructor.</p> 2954 2955 <table class="responsive"> 2956 <tr><th colspan=2>Parameters</th></tr> 2957 <tr> 2958 <td><code>container</code></td> 2959 <td width="100%"> 2960 <code>UiSelector</code>: 2961 a <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector to identify the scrollable 2962 layout element.</td> 2963 </tr> 2964 </table> 2965 2966</div> 2967 2968 2969 2970 2971 2972<!-- ========= CONSTRUCTOR DETAIL ======== --> 2973<!-- Protected ctors --> 2974 2975 2976 2977<!-- ========= METHOD DETAIL ======== --> 2978<!-- Public methdos --> 2979 2980<h2 class="api-section">Public methods</h2> 2981 2982 2983 2984<A NAME="flingBackward()"></A> 2985 2986<div class="api apilevel-"> 2987 <h3 class="api-name">flingBackward</h3> 2988 <div class="api-level"> 2989 <div></div> 2990 2991 2992 2993 </div> 2994<pre class="api-signature no-pretty-print"> 2995boolean flingBackward ()</pre> 2996 2997 2998 2999 3000 <p>Performs a backwards fling action with the default number of fling 3001 steps (5). If the swipe direction is set to vertical, 3002 then the swipe will be performed from top to bottom. If the swipe 3003 direction is set to horizontal, then the swipes will be performed from 3004 left to right. Make sure to take into account devices configured with 3005 right-to-left languages like Arabic and Hebrew.</p> 3006 3007 <table class="responsive"> 3008 <tr><th colspan=2>Returns</th></tr> 3009 <tr> 3010 <td><code>boolean</code></td> 3011 <td width="100%">true if scrolled, and false if can't scroll anymore</td> 3012 </tr> 3013 </table> 3014 <table class="responsive"> 3015 <tr><th colspan=2>Throws</th></tr> 3016 <tr> 3017 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3018 <td width="100%"></td> 3019 </tr> 3020 </table> 3021 3022 3023</div> 3024 3025 3026<A NAME="flingForward()"></A> 3027 3028<div class="api apilevel-"> 3029 <h3 class="api-name">flingForward</h3> 3030 <div class="api-level"> 3031 <div></div> 3032 3033 3034 3035 </div> 3036<pre class="api-signature no-pretty-print"> 3037boolean flingForward ()</pre> 3038 3039 3040 3041 3042 <p>Performs a forward fling with the default number of fling steps (5). 3043 If the swipe direction is set to vertical, then the swipes will be 3044 performed from bottom to top. If the swipe 3045 direction is set to horizontal, then the swipes will be performed from 3046 right to left. Make sure to take into account devices configured with 3047 right-to-left languages like Arabic and Hebrew.</p> 3048 3049 <table class="responsive"> 3050 <tr><th colspan=2>Returns</th></tr> 3051 <tr> 3052 <td><code>boolean</code></td> 3053 <td width="100%">true if scrolled, false if can't scroll anymore</td> 3054 </tr> 3055 </table> 3056 <table class="responsive"> 3057 <tr><th colspan=2>Throws</th></tr> 3058 <tr> 3059 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3060 <td width="100%"></td> 3061 </tr> 3062 </table> 3063 3064 3065</div> 3066 3067 3068<A NAME="flingToBeginning(int)"></A> 3069 3070<div class="api apilevel-"> 3071 <h3 class="api-name">flingToBeginning</h3> 3072 <div class="api-level"> 3073 <div></div> 3074 3075 3076 3077 </div> 3078<pre class="api-signature no-pretty-print"> 3079boolean flingToBeginning (int maxSwipes)</pre> 3080 3081 3082 3083 3084 <p>Performs a fling gesture to reach the beginning of a scrollable layout element. 3085 The beginning can be at the top-most edge in the case of vertical controls, or 3086 the left-most edge for horizontal controls. Make sure to take into 3087 account devices configured with right-to-left languages like Arabic and Hebrew.</p> 3088 3089 <table class="responsive"> 3090 <tr><th colspan=2>Returns</th></tr> 3091 <tr> 3092 <td><code>boolean</code></td> 3093 <td width="100%">true on scrolled else false</td> 3094 </tr> 3095 </table> 3096 <table class="responsive"> 3097 <tr><th colspan=2>Throws</th></tr> 3098 <tr> 3099 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3100 <td width="100%"></td> 3101 </tr> 3102 </table> 3103 3104 3105</div> 3106 3107 3108<A NAME="flingToEnd(int)"></A> 3109 3110<div class="api apilevel-"> 3111 <h3 class="api-name">flingToEnd</h3> 3112 <div class="api-level"> 3113 <div></div> 3114 3115 3116 3117 </div> 3118<pre class="api-signature no-pretty-print"> 3119boolean flingToEnd (int maxSwipes)</pre> 3120 3121 3122 3123 3124 <p>Performs a fling gesture to reach the end of a scrollable layout element. 3125 The end can be at the bottom-most edge in the case of vertical controls, or 3126 the right-most edge for horizontal controls. Make sure to take into 3127 account devices configured with right-to-left languages like Arabic and Hebrew.</p> 3128 3129 <table class="responsive"> 3130 <tr><th colspan=2>Returns</th></tr> 3131 <tr> 3132 <td><code>boolean</code></td> 3133 <td width="100%">true on scrolled, else false</td> 3134 </tr> 3135 </table> 3136 <table class="responsive"> 3137 <tr><th colspan=2>Throws</th></tr> 3138 <tr> 3139 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3140 <td width="100%"></td> 3141 </tr> 3142 </table> 3143 3144 3145</div> 3146 3147 3148<A NAME="getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)"></A> 3149 3150<div class="api apilevel-"> 3151 <h3 class="api-name">getChildByDescription</h3> 3152 <div class="api-level"> 3153 <div></div> 3154 3155 3156 3157 </div> 3158<pre class="api-signature no-pretty-print"> 3159<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByDescription (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 3160 String text)</pre> 3161 3162 3163 3164 3165 <p>Searches for a child element in the present scrollable container. 3166 The search first looks for a child element that matches the selector 3167 you provided, then looks for the content-description in its children elements. 3168 If both search conditions are fulfilled, the method returns a {@ link UiObject} 3169 representing the element matching the selector (not the child element in its 3170 subhierarchy containing the content-description). By default, this method performs a 3171 scroll search. 3172 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)">getChildByDescription(UiSelector, String, boolean)</a></code></p> 3173 3174 <table class="responsive"> 3175 <tr><th colspan=2>Parameters</th></tr> 3176 <tr> 3177 <td><code>childPattern</code></td> 3178 <td width="100%"> 3179 <code>UiSelector</code>: 3180 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> for a child in a scollable layout element</td> 3181 </tr> 3182 <tr> 3183 <td><code>text</code></td> 3184 <td width="100%"> 3185 <code>String</code>: 3186 Content-description to find in the children of 3187 the <code>childPattern</code> match</td> 3188 </tr> 3189 </table> 3190 <table class="responsive"> 3191 <tr><th colspan=2>Returns</th></tr> 3192 <tr> 3193 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3194 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> representing the child element that matches the search conditions</td> 3195 </tr> 3196 </table> 3197 <table class="responsive"> 3198 <tr><th colspan=2>Throws</th></tr> 3199 <tr> 3200 <td><code></code></td> 3201 <td width="100%">UiObjectNotFoundException</td> 3202 </tr> 3203 <tr> 3204 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3205 <td width="100%"></td> 3206 </tr> 3207 </table> 3208 3209 3210</div> 3211 3212 3213<A NAME="getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)"></A> 3214 3215<div class="api apilevel-"> 3216 <h3 class="api-name">getChildByDescription</h3> 3217 <div class="api-level"> 3218 <div></div> 3219 3220 3221 3222 </div> 3223<pre class="api-signature no-pretty-print"> 3224<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByDescription (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 3225 String text, 3226 boolean allowScrollSearch)</pre> 3227 3228 3229 3230 3231 <p>Searches for a child element in the present scrollable container. 3232 The search first looks for a child element that matches the selector 3233 you provided, then looks for the content-description in its children elements. 3234 If both search conditions are fulfilled, the method returns a {@ link UiObject} 3235 representing the element matching the selector (not the child element in its 3236 subhierarchy containing the content-description).</p> 3237 3238 <table class="responsive"> 3239 <tr><th colspan=2>Parameters</th></tr> 3240 <tr> 3241 <td><code>childPattern</code></td> 3242 <td width="100%"> 3243 <code>UiSelector</code>: 3244 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> for a child in a scollable layout element</td> 3245 </tr> 3246 <tr> 3247 <td><code>text</code></td> 3248 <td width="100%"> 3249 <code>String</code>: 3250 Content-description to find in the children of 3251 the <code>childPattern</code> match (may be a partial match)</td> 3252 </tr> 3253 <tr> 3254 <td><code>allowScrollSearch</code></td> 3255 <td width="100%"> 3256 <code>boolean</code>: 3257 set to true if scrolling is allowed</td> 3258 </tr> 3259 </table> 3260 <table class="responsive"> 3261 <tr><th colspan=2>Returns</th></tr> 3262 <tr> 3263 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3264 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> representing the child element that matches the search conditions</td> 3265 </tr> 3266 </table> 3267 <table class="responsive"> 3268 <tr><th colspan=2>Throws</th></tr> 3269 <tr> 3270 <td><code></code></td> 3271 <td width="100%">UiObjectNotFoundException</td> 3272 </tr> 3273 <tr> 3274 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3275 <td width="100%"></td> 3276 </tr> 3277 </table> 3278 3279 3280</div> 3281 3282 3283<A NAME="getChildByInstance(android.support.test.uiautomator.UiSelector, int)"></A> 3284 3285<div class="api apilevel-"> 3286 <h3 class="api-name">getChildByInstance</h3> 3287 <div class="api-level"> 3288 <div></div> 3289 3290 3291 3292 </div> 3293<pre class="api-signature no-pretty-print"> 3294<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByInstance (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 3295 int instance)</pre> 3296 3297 3298 3299 3300 <p>Searches for a child element in the present scrollable container that 3301 matches the selector you provided. The search is performed without 3302 scrolling and only on visible elements.</p> 3303 3304 <table class="responsive"> 3305 <tr><th colspan=2>Parameters</th></tr> 3306 <tr> 3307 <td><code>childPattern</code></td> 3308 <td width="100%"> 3309 <code>UiSelector</code>: 3310 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> for a child in a scollable layout element</td> 3311 </tr> 3312 <tr> 3313 <td><code>instance</code></td> 3314 <td width="100%"> 3315 <code>int</code>: 3316 int number representing the occurance of 3317 a <code>childPattern</code> match</td> 3318 </tr> 3319 </table> 3320 <table class="responsive"> 3321 <tr><th colspan=2>Returns</th></tr> 3322 <tr> 3323 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3324 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> representing the child element that matches the search conditions</td> 3325 </tr> 3326 </table> 3327 <table class="responsive"> 3328 <tr><th colspan=2>Throws</th></tr> 3329 <tr> 3330 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3331 <td width="100%"></td> 3332 </tr> 3333 </table> 3334 3335 3336</div> 3337 3338 3339<A NAME="getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)"></A> 3340 3341<div class="api apilevel-"> 3342 <h3 class="api-name">getChildByText</h3> 3343 <div class="api-level"> 3344 <div></div> 3345 3346 3347 3348 </div> 3349<pre class="api-signature no-pretty-print"> 3350<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByText (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 3351 String text, 3352 boolean allowScrollSearch)</pre> 3353 3354 3355 3356 3357 <p>Searches for a child element in the present scrollable container. The 3358 search first looks for a child element that matches the 3359 selector you provided, then looks for the text in its children elements. 3360 If both search conditions are fulfilled, the method returns a {@ link UiObject} 3361 representing the element matching the selector (not the child element in its 3362 subhierarchy containing the text).</p> 3363 3364 <table class="responsive"> 3365 <tr><th colspan=2>Parameters</th></tr> 3366 <tr> 3367 <td><code>childPattern</code></td> 3368 <td width="100%"> 3369 <code>UiSelector</code>: 3370 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector for a child in a scrollable layout element</td> 3371 </tr> 3372 <tr> 3373 <td><code>text</code></td> 3374 <td width="100%"> 3375 <code>String</code>: 3376 String to find in the children of the <code>childPattern</code> match</td> 3377 </tr> 3378 <tr> 3379 <td><code>allowScrollSearch</code></td> 3380 <td width="100%"> 3381 <code>boolean</code>: 3382 set to true if scrolling is allowed</td> 3383 </tr> 3384 </table> 3385 <table class="responsive"> 3386 <tr><th colspan=2>Returns</th></tr> 3387 <tr> 3388 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3389 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> representing the child element that matches the search conditions</td> 3390 </tr> 3391 </table> 3392 <table class="responsive"> 3393 <tr><th colspan=2>Throws</th></tr> 3394 <tr> 3395 <td><code></code></td> 3396 <td width="100%">UiObjectNotFoundException</td> 3397 </tr> 3398 <tr> 3399 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3400 <td width="100%"></td> 3401 </tr> 3402 </table> 3403 3404 3405</div> 3406 3407 3408<A NAME="getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)"></A> 3409 3410<div class="api apilevel-"> 3411 <h3 class="api-name">getChildByText</h3> 3412 <div class="api-level"> 3413 <div></div> 3414 3415 3416 3417 </div> 3418<pre class="api-signature no-pretty-print"> 3419<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> getChildByText (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> childPattern, 3420 String text)</pre> 3421 3422 3423 3424 3425 <p>Searches for a child element in the present scrollable 3426 container. The search first looks for a child element that matches the 3427 selector you provided, then looks for the text in its children elements. 3428 If both search conditions are fulfilled, the method returns a {@ link UiObject} 3429 representing the element matching the selector (not the child element in its 3430 subhierarchy containing the text). By default, this method performs a 3431 scroll search. 3432 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String, boolean)">getChildByText(UiSelector, String, boolean)</a></code></p> 3433 3434 <table class="responsive"> 3435 <tr><th colspan=2>Parameters</th></tr> 3436 <tr> 3437 <td><code>childPattern</code></td> 3438 <td width="100%"> 3439 <code>UiSelector</code>: 3440 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector for a child in a scrollable layout element</td> 3441 </tr> 3442 <tr> 3443 <td><code>text</code></td> 3444 <td width="100%"> 3445 <code>String</code>: 3446 String to find in the children of the <code>childPattern</code> match</td> 3447 </tr> 3448 </table> 3449 <table class="responsive"> 3450 <tr><th colspan=2>Returns</th></tr> 3451 <tr> 3452 <td><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3453 <td width="100%"><code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> representing the child element that matches the search conditions</td> 3454 </tr> 3455 </table> 3456 <table class="responsive"> 3457 <tr><th colspan=2>Throws</th></tr> 3458 <tr> 3459 <td><code></code></td> 3460 <td width="100%">UiObjectNotFoundException</td> 3461 </tr> 3462 <tr> 3463 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3464 <td width="100%"></td> 3465 </tr> 3466 </table> 3467 3468 3469</div> 3470 3471 3472<A NAME="getMaxSearchSwipes()"></A> 3473 3474<div class="api apilevel-"> 3475 <h3 class="api-name">getMaxSearchSwipes</h3> 3476 <div class="api-level"> 3477 <div></div> 3478 3479 3480 3481 </div> 3482<pre class="api-signature no-pretty-print"> 3483int getMaxSearchSwipes ()</pre> 3484 3485 3486 3487 3488 <p>Gets the maximum number of scrolls allowed when performing a 3489 scroll action in search of a child element. 3490 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code> and 3491 <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code>.</p> 3492 3493 <table class="responsive"> 3494 <tr><th colspan=2>Returns</th></tr> 3495 <tr> 3496 <td><code>int</code></td> 3497 <td width="100%">max the number of search swipes to perform until giving up</td> 3498 </tr> 3499 </table> 3500 3501</div> 3502 3503 3504<A NAME="getSwipeDeadZonePercentage()"></A> 3505 3506<div class="api apilevel-"> 3507 <h3 class="api-name">getSwipeDeadZonePercentage</h3> 3508 <div class="api-level"> 3509 <div></div> 3510 3511 3512 3513 </div> 3514<pre class="api-signature no-pretty-print"> 3515double getSwipeDeadZonePercentage ()</pre> 3516 3517 3518 3519 3520 <p>Returns the percentage of a widget's size that's considered as a no-touch 3521 zone when swiping. The no-touch zone is set as a percentage of a widget's total 3522 width or height, denoting a margin around the swipable area of the widget. 3523 Swipes must start and end inside this margin. This is important when the 3524 widget being swiped may not respond to the swipe if started at a point 3525 too near to the edge. The default is 10% from either edge.</p> 3526 3527 <table class="responsive"> 3528 <tr><th colspan=2>Returns</th></tr> 3529 <tr> 3530 <td><code>double</code></td> 3531 <td width="100%">a value between 0 and 1</td> 3532 </tr> 3533 </table> 3534 3535</div> 3536 3537 3538<A NAME="scrollBackward(int)"></A> 3539 3540<div class="api apilevel-"> 3541 <h3 class="api-name">scrollBackward</h3> 3542 <div class="api-level"> 3543 <div></div> 3544 3545 3546 3547 </div> 3548<pre class="api-signature no-pretty-print"> 3549boolean scrollBackward (int steps)</pre> 3550 3551 3552 3553 3554 <p>Performs a backward scroll. If the swipe direction is set to vertical, 3555 then the swipes will be performed from top to bottom. If the swipe 3556 direction is set to horizontal, then the swipes will be performed from 3557 left to right. Make sure to take into account devices configured with 3558 right-to-left languages like Arabic and Hebrew.</p> 3559 3560 <table class="responsive"> 3561 <tr><th colspan=2>Parameters</th></tr> 3562 <tr> 3563 <td><code>steps</code></td> 3564 <td width="100%"> 3565 <code>int</code>: 3566 number of steps. Use this to control the speed of the scroll action.</td> 3567 </tr> 3568 </table> 3569 <table class="responsive"> 3570 <tr><th colspan=2>Returns</th></tr> 3571 <tr> 3572 <td><code>boolean</code></td> 3573 <td width="100%">true if scrolled, false if can't scroll anymore</td> 3574 </tr> 3575 </table> 3576 <table class="responsive"> 3577 <tr><th colspan=2>Throws</th></tr> 3578 <tr> 3579 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3580 <td width="100%"></td> 3581 </tr> 3582 </table> 3583 3584 3585</div> 3586 3587 3588<A NAME="scrollBackward()"></A> 3589 3590<div class="api apilevel-"> 3591 <h3 class="api-name">scrollBackward</h3> 3592 <div class="api-level"> 3593 <div></div> 3594 3595 3596 3597 </div> 3598<pre class="api-signature no-pretty-print"> 3599boolean scrollBackward ()</pre> 3600 3601 3602 3603 3604 <p>Performs a backward scroll with the default number of scroll steps (55). 3605 If the swipe direction is set to vertical, 3606 then the swipes will be performed from top to bottom. If the swipe 3607 direction is set to horizontal, then the swipes will be performed from 3608 left to right. Make sure to take into account devices configured with 3609 right-to-left languages like Arabic and Hebrew.</p> 3610 3611 <table class="responsive"> 3612 <tr><th colspan=2>Returns</th></tr> 3613 <tr> 3614 <td><code>boolean</code></td> 3615 <td width="100%">true if scrolled, and false if can't scroll anymore</td> 3616 </tr> 3617 </table> 3618 <table class="responsive"> 3619 <tr><th colspan=2>Throws</th></tr> 3620 <tr> 3621 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3622 <td width="100%"></td> 3623 </tr> 3624 </table> 3625 3626 3627</div> 3628 3629 3630<A NAME="scrollDescriptionIntoView(java.lang.String)"></A> 3631 3632<div class="api apilevel-"> 3633 <h3 class="api-name">scrollDescriptionIntoView</h3> 3634 <div class="api-level"> 3635 <div></div> 3636 3637 3638 3639 </div> 3640<pre class="api-signature no-pretty-print"> 3641boolean scrollDescriptionIntoView (String text)</pre> 3642 3643 3644 3645 3646 <p>Performs a forward scroll action on the scrollable layout element until 3647 the content-description is found, or until swipe attempts have been exhausted. 3648 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p> 3649 3650 <table class="responsive"> 3651 <tr><th colspan=2>Parameters</th></tr> 3652 <tr> 3653 <td><code>text</code></td> 3654 <td width="100%"> 3655 <code>String</code>: 3656 content-description to find within the contents of this scrollable layout element.</td> 3657 </tr> 3658 </table> 3659 <table class="responsive"> 3660 <tr><th colspan=2>Returns</th></tr> 3661 <tr> 3662 <td><code>boolean</code></td> 3663 <td width="100%">true if item is found; else, false</td> 3664 </tr> 3665 </table> 3666 <table class="responsive"> 3667 <tr><th colspan=2>Throws</th></tr> 3668 <tr> 3669 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3670 <td width="100%"></td> 3671 </tr> 3672 </table> 3673 3674 3675</div> 3676 3677 3678<A NAME="scrollForward(int)"></A> 3679 3680<div class="api apilevel-"> 3681 <h3 class="api-name">scrollForward</h3> 3682 <div class="api-level"> 3683 <div></div> 3684 3685 3686 3687 </div> 3688<pre class="api-signature no-pretty-print"> 3689boolean scrollForward (int steps)</pre> 3690 3691 3692 3693 3694 <p>Performs a forward scroll. If the swipe direction is set to vertical, 3695 then the swipes will be performed from bottom to top. If the swipe 3696 direction is set to horizontal, then the swipes will be performed from 3697 right to left. Make sure to take into account devices configured with 3698 right-to-left languages like Arabic and Hebrew.</p> 3699 3700 <table class="responsive"> 3701 <tr><th colspan=2>Parameters</th></tr> 3702 <tr> 3703 <td><code>steps</code></td> 3704 <td width="100%"> 3705 <code>int</code>: 3706 number of steps. Use this to control the speed of the scroll action</td> 3707 </tr> 3708 </table> 3709 <table class="responsive"> 3710 <tr><th colspan=2>Returns</th></tr> 3711 <tr> 3712 <td><code>boolean</code></td> 3713 <td width="100%">true if scrolled, false if can't scroll anymore</td> 3714 </tr> 3715 </table> 3716 <table class="responsive"> 3717 <tr><th colspan=2>Throws</th></tr> 3718 <tr> 3719 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3720 <td width="100%"></td> 3721 </tr> 3722 </table> 3723 3724 3725</div> 3726 3727 3728<A NAME="scrollForward()"></A> 3729 3730<div class="api apilevel-"> 3731 <h3 class="api-name">scrollForward</h3> 3732 <div class="api-level"> 3733 <div></div> 3734 3735 3736 3737 </div> 3738<pre class="api-signature no-pretty-print"> 3739boolean scrollForward ()</pre> 3740 3741 3742 3743 3744 <p>Performs a forward scroll with the default number of scroll steps (55). 3745 If the swipe direction is set to vertical, 3746 then the swipes will be performed from bottom to top. If the swipe 3747 direction is set to horizontal, then the swipes will be performed from 3748 right to left. Make sure to take into account devices configured with 3749 right-to-left languages like Arabic and Hebrew.</p> 3750 3751 <table class="responsive"> 3752 <tr><th colspan=2>Returns</th></tr> 3753 <tr> 3754 <td><code>boolean</code></td> 3755 <td width="100%">true if scrolled, false if can't scroll anymore</td> 3756 </tr> 3757 </table> 3758 <table class="responsive"> 3759 <tr><th colspan=2>Throws</th></tr> 3760 <tr> 3761 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3762 <td width="100%"></td> 3763 </tr> 3764 </table> 3765 3766 3767</div> 3768 3769 3770<A NAME="scrollIntoView(android.support.test.uiautomator.UiSelector)"></A> 3771 3772<div class="api apilevel-"> 3773 <h3 class="api-name">scrollIntoView</h3> 3774 <div class="api-level"> 3775 <div></div> 3776 3777 3778 3779 </div> 3780<pre class="api-signature no-pretty-print"> 3781boolean scrollIntoView (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector)</pre> 3782 3783 3784 3785 3786 <p>Perform a scroll forward action to move through the scrollable layout 3787 element until a visible item that matches the selector is found. 3788 3789 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView(String)</a></code> and <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#scrollTextIntoView(java.lang.String)">scrollTextIntoView(String)</a></code>.</p> 3790 3791 <table class="responsive"> 3792 <tr><th colspan=2>Parameters</th></tr> 3793 <tr> 3794 <td><code>selector</code></td> 3795 <td width="100%"> 3796 <code>UiSelector</code>: 3797 <code><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></code> selector</td> 3798 </tr> 3799 </table> 3800 <table class="responsive"> 3801 <tr><th colspan=2>Returns</th></tr> 3802 <tr> 3803 <td><code>boolean</code></td> 3804 <td width="100%">true if the item was found and now is in view; else, false</td> 3805 </tr> 3806 </table> 3807 <table class="responsive"> 3808 <tr><th colspan=2>Throws</th></tr> 3809 <tr> 3810 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3811 <td width="100%"></td> 3812 </tr> 3813 </table> 3814 3815 3816</div> 3817 3818 3819<A NAME="scrollIntoView(android.support.test.uiautomator.UiObject)"></A> 3820 3821<div class="api apilevel-"> 3822 <h3 class="api-name">scrollIntoView</h3> 3823 <div class="api-level"> 3824 <div></div> 3825 3826 3827 3828 </div> 3829<pre class="api-signature no-pretty-print"> 3830boolean scrollIntoView (<a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a> obj)</pre> 3831 3832 3833 3834 3835 <p>Perform a forward scroll action to move through the scrollable layout element until 3836 a visible item that matches the <code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code> is found.</p> 3837 3838 <table class="responsive"> 3839 <tr><th colspan=2>Parameters</th></tr> 3840 <tr> 3841 <td><code>obj</code></td> 3842 <td width="100%"> 3843 <code>UiObject</code>: 3844 <code><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></code></td> 3845 </tr> 3846 </table> 3847 <table class="responsive"> 3848 <tr><th colspan=2>Returns</th></tr> 3849 <tr> 3850 <td><code>boolean</code></td> 3851 <td width="100%">true if the item was found and now is in view else false</td> 3852 </tr> 3853 </table> 3854 <table class="responsive"> 3855 <tr><th colspan=2>Throws</th></tr> 3856 <tr> 3857 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3858 <td width="100%"></td> 3859 </tr> 3860 </table> 3861 3862 3863</div> 3864 3865 3866<A NAME="scrollTextIntoView(java.lang.String)"></A> 3867 3868<div class="api apilevel-"> 3869 <h3 class="api-name">scrollTextIntoView</h3> 3870 <div class="api-level"> 3871 <div></div> 3872 3873 3874 3875 </div> 3876<pre class="api-signature no-pretty-print"> 3877boolean scrollTextIntoView (String text)</pre> 3878 3879 3880 3881 3882 <p>Performs a forward scroll action on the scrollable layout element until 3883 the text you provided is visible, or until swipe attempts have been exhausted. 3884 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p> 3885 3886 <table class="responsive"> 3887 <tr><th colspan=2>Parameters</th></tr> 3888 <tr> 3889 <td><code>text</code></td> 3890 <td width="100%"> 3891 <code>String</code>: 3892 test to look for</td> 3893 </tr> 3894 </table> 3895 <table class="responsive"> 3896 <tr><th colspan=2>Returns</th></tr> 3897 <tr> 3898 <td><code>boolean</code></td> 3899 <td width="100%">true if item is found; else, false</td> 3900 </tr> 3901 </table> 3902 <table class="responsive"> 3903 <tr><th colspan=2>Throws</th></tr> 3904 <tr> 3905 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3906 <td width="100%"></td> 3907 </tr> 3908 </table> 3909 3910 3911</div> 3912 3913 3914<A NAME="scrollToBeginning(int)"></A> 3915 3916<div class="api apilevel-"> 3917 <h3 class="api-name">scrollToBeginning</h3> 3918 <div class="api-level"> 3919 <div></div> 3920 3921 3922 3923 </div> 3924<pre class="api-signature no-pretty-print"> 3925boolean scrollToBeginning (int maxSwipes)</pre> 3926 3927 3928 3929 3930 <p>Scrolls to the beginning of a scrollable layout element. The beginning 3931 can be at the top-most edge in the case of vertical controls, or the 3932 left-most edge for horizontal controls. Make sure to take into account 3933 devices configured with right-to-left languages like Arabic and Hebrew.</p> 3934 3935 <table class="responsive"> 3936 <tr><th colspan=2>Returns</th></tr> 3937 <tr> 3938 <td><code>boolean</code></td> 3939 <td width="100%">true on scrolled else false</td> 3940 </tr> 3941 </table> 3942 <table class="responsive"> 3943 <tr><th colspan=2>Throws</th></tr> 3944 <tr> 3945 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 3946 <td width="100%"></td> 3947 </tr> 3948 </table> 3949 3950 3951</div> 3952 3953 3954<A NAME="scrollToBeginning(int, int)"></A> 3955 3956<div class="api apilevel-"> 3957 <h3 class="api-name">scrollToBeginning</h3> 3958 <div class="api-level"> 3959 <div></div> 3960 3961 3962 3963 </div> 3964<pre class="api-signature no-pretty-print"> 3965boolean scrollToBeginning (int maxSwipes, 3966 int steps)</pre> 3967 3968 3969 3970 3971 <p>Scrolls to the beginning of a scrollable layout element. The beginning 3972 can be at the top-most edge in the case of vertical controls, or the 3973 left-most edge for horizontal controls. Make sure to take into account 3974 devices configured with right-to-left languages like Arabic and Hebrew.</p> 3975 3976 <table class="responsive"> 3977 <tr><th colspan=2>Parameters</th></tr> 3978 <tr> 3979 <td><code>maxSwipes</code></td> 3980 <td width="100%"> 3981 <code>int</code> 3982 <!-- no parameter comment --></td> 3983 </tr> 3984 <tr> 3985 <td><code>steps</code></td> 3986 <td width="100%"> 3987 <code>int</code>: 3988 use steps to control the speed, so that it may be a scroll, or fling</td> 3989 </tr> 3990 </table> 3991 <table class="responsive"> 3992 <tr><th colspan=2>Returns</th></tr> 3993 <tr> 3994 <td><code>boolean</code></td> 3995 <td width="100%">true on scrolled else false</td> 3996 </tr> 3997 </table> 3998 <table class="responsive"> 3999 <tr><th colspan=2>Throws</th></tr> 4000 <tr> 4001 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 4002 <td width="100%"></td> 4003 </tr> 4004 </table> 4005 4006 4007</div> 4008 4009 4010<A NAME="scrollToEnd(int)"></A> 4011 4012<div class="api apilevel-"> 4013 <h3 class="api-name">scrollToEnd</h3> 4014 <div class="api-level"> 4015 <div></div> 4016 4017 4018 4019 </div> 4020<pre class="api-signature no-pretty-print"> 4021boolean scrollToEnd (int maxSwipes)</pre> 4022 4023 4024 4025 4026 <p>Scrolls to the end of a scrollable layout element. The end can be at the 4027 bottom-most edge in the case of vertical controls, or the right-most edge for 4028 horizontal controls. Make sure to take into account devices configured with 4029 right-to-left languages like Arabic and Hebrew.</p> 4030 4031 <table class="responsive"> 4032 <tr><th colspan=2>Returns</th></tr> 4033 <tr> 4034 <td><code>boolean</code></td> 4035 <td width="100%">true on scrolled, else false</td> 4036 </tr> 4037 </table> 4038 <table class="responsive"> 4039 <tr><th colspan=2>Throws</th></tr> 4040 <tr> 4041 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 4042 <td width="100%"></td> 4043 </tr> 4044 </table> 4045 4046 4047</div> 4048 4049 4050<A NAME="scrollToEnd(int, int)"></A> 4051 4052<div class="api apilevel-"> 4053 <h3 class="api-name">scrollToEnd</h3> 4054 <div class="api-level"> 4055 <div></div> 4056 4057 4058 4059 </div> 4060<pre class="api-signature no-pretty-print"> 4061boolean scrollToEnd (int maxSwipes, 4062 int steps)</pre> 4063 4064 4065 4066 4067 <p>Scrolls to the end of a scrollable layout element. The end can be at the 4068 bottom-most edge in the case of vertical controls, or the right-most edge for 4069 horizontal controls. Make sure to take into account devices configured with 4070 right-to-left languages like Arabic and Hebrew.</p> 4071 4072 <table class="responsive"> 4073 <tr><th colspan=2>Parameters</th></tr> 4074 <tr> 4075 <td><code>maxSwipes</code></td> 4076 <td width="100%"> 4077 <code>int</code> 4078 <!-- no parameter comment --></td> 4079 </tr> 4080 <tr> 4081 <td><code>steps</code></td> 4082 <td width="100%"> 4083 <code>int</code>: 4084 use steps to control the speed, so that it may be a scroll, or fling</td> 4085 </tr> 4086 </table> 4087 <table class="responsive"> 4088 <tr><th colspan=2>Returns</th></tr> 4089 <tr> 4090 <td><code>boolean</code></td> 4091 <td width="100%">true on scrolled else false</td> 4092 </tr> 4093 </table> 4094 <table class="responsive"> 4095 <tr><th colspan=2>Throws</th></tr> 4096 <tr> 4097 <td><code><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></code></td> 4098 <td width="100%"></td> 4099 </tr> 4100 </table> 4101 4102 4103</div> 4104 4105 4106<A NAME="setAsHorizontalList()"></A> 4107 4108<div class="api apilevel-"> 4109 <h3 class="api-name">setAsHorizontalList</h3> 4110 <div class="api-level"> 4111 <div></div> 4112 4113 4114 4115 </div> 4116<pre class="api-signature no-pretty-print"> 4117<a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a> setAsHorizontalList ()</pre> 4118 4119 4120 4121 4122 <p>Set the direction of swipes to be horizontal when performing scroll actions.</p> 4123 4124 <table class="responsive"> 4125 <tr><th colspan=2>Returns</th></tr> 4126 <tr> 4127 <td><code><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code></td> 4128 <td width="100%">reference to itself</td> 4129 </tr> 4130 </table> 4131 4132</div> 4133 4134 4135<A NAME="setAsVerticalList()"></A> 4136 4137<div class="api apilevel-"> 4138 <h3 class="api-name">setAsVerticalList</h3> 4139 <div class="api-level"> 4140 <div></div> 4141 4142 4143 4144 </div> 4145<pre class="api-signature no-pretty-print"> 4146<a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a> setAsVerticalList ()</pre> 4147 4148 4149 4150 4151 <p>Set the direction of swipes to be vertical when performing scroll actions.</p> 4152 4153 <table class="responsive"> 4154 <tr><th colspan=2>Returns</th></tr> 4155 <tr> 4156 <td><code><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code></td> 4157 <td width="100%">reference to itself</td> 4158 </tr> 4159 </table> 4160 4161</div> 4162 4163 4164<A NAME="setMaxSearchSwipes(int)"></A> 4165 4166<div class="api apilevel-"> 4167 <h3 class="api-name">setMaxSearchSwipes</h3> 4168 <div class="api-level"> 4169 <div></div> 4170 4171 4172 4173 </div> 4174<pre class="api-signature no-pretty-print"> 4175<a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a> setMaxSearchSwipes (int swipes)</pre> 4176 4177 4178 4179 4180 <p>Sets the maximum number of scrolls allowed when performing a 4181 scroll action in search of a child element. 4182 See <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByDescription(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code> and 4183 <code><a href="/reference/android/support/test/uiautomator/UiScrollable.html#getChildByText(android.support.test.uiautomator.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code>.</p> 4184 4185 <table class="responsive"> 4186 <tr><th colspan=2>Parameters</th></tr> 4187 <tr> 4188 <td><code>swipes</code></td> 4189 <td width="100%"> 4190 <code>int</code>: 4191 the number of search swipes to perform until giving up</td> 4192 </tr> 4193 </table> 4194 <table class="responsive"> 4195 <tr><th colspan=2>Returns</th></tr> 4196 <tr> 4197 <td><code><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code></td> 4198 <td width="100%">reference to itself</td> 4199 </tr> 4200 </table> 4201 4202</div> 4203 4204 4205<A NAME="setSwipeDeadZonePercentage(double)"></A> 4206 4207<div class="api apilevel-"> 4208 <h3 class="api-name">setSwipeDeadZonePercentage</h3> 4209 <div class="api-level"> 4210 <div></div> 4211 4212 4213 4214 </div> 4215<pre class="api-signature no-pretty-print"> 4216<a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a> setSwipeDeadZonePercentage (double swipeDeadZonePercentage)</pre> 4217 4218 4219 4220 4221 <p>Sets the percentage of a widget's size that's considered as no-touch 4222 zone when swiping. 4223 The no-touch zone is set as percentage of a widget's total width or height, 4224 denoting a margin around the swipable area of the widget. Swipes must 4225 always start and end inside this margin. This is important when the 4226 widget being swiped may not respond to the swipe if started at a point 4227 too near to the edge. The default is 10% from either edge.</p> 4228 4229 <table class="responsive"> 4230 <tr><th colspan=2>Parameters</th></tr> 4231 <tr> 4232 <td><code>swipeDeadZonePercentage</code></td> 4233 <td width="100%"> 4234 <code>double</code>: 4235 is a value between 0 and 1</td> 4236 </tr> 4237 </table> 4238 <table class="responsive"> 4239 <tr><th colspan=2>Returns</th></tr> 4240 <tr> 4241 <td><code><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></code></td> 4242 <td width="100%">reference to itself</td> 4243 </tr> 4244 </table> 4245 4246</div> 4247 4248 4249 4250 4251 4252<!-- ========= METHOD DETAIL ======== --> 4253 4254<h2 class="api-section">Protected methods</h2> 4255 4256 4257 4258<A NAME="exists(android.support.test.uiautomator.UiSelector)"></A> 4259 4260<div class="api apilevel-"> 4261 <h3 class="api-name">exists</h3> 4262 <div class="api-level"> 4263 <div></div> 4264 4265 4266 4267 </div> 4268<pre class="api-signature no-pretty-print"> 4269boolean exists (<a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a> selector)</pre> 4270 4271 4272 4273 4274 <p>Used privately when performing swipe searches to decide if an element has become 4275 visible or not.</p> 4276 4277 <table class="responsive"> 4278 <tr><th colspan=2>Returns</th></tr> 4279 <tr> 4280 <td><code>boolean</code></td> 4281 <td width="100%">true if found else false</td> 4282 </tr> 4283 </table> 4284 4285</div> 4286 4287 4288 4289 4290 4291<!-- ========= END OF CLASS DATA ========= --> 4292 4293</div><!-- end jd-content --> 4294 4295 4296 4297<div class="data-reference-resources-wrapper"> 4298 4299 <ul data-reference-resources> 4300 4301 4302 <li><h2>Interfaces</h2> 4303 <ul> 4304 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/IAutomationSupport.html">IAutomationSupport</a></li> 4305 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiWatcher.html">UiWatcher</a></li> 4306 </ul> 4307 </li> 4308 4309 <li><h2>Classes</h2> 4310 <ul> 4311 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/By.html">By</a></li> 4312 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/BySelector.html">BySelector</a></li> 4313 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Configurator.html">Configurator</a></li> 4314 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/EventCondition.html">EventCondition</a></li> 4315 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/SearchCondition.html">SearchCondition</a></li> 4316 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner.html">UiAutomatorInstrumentationTestRunner</a></li> 4317 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiAutomatorTestCase.html">UiAutomatorTestCase</a></li> 4318 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiCollection.html">UiCollection</a></li> 4319 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiDevice.html">UiDevice</a></li> 4320 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject.html">UiObject</a></li> 4321 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject2.html">UiObject2</a></li> 4322 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObject2Condition.html">UiObject2Condition</a></li> 4323 <li class="selected api apilevel-"><a href="/reference/android/support/test/uiautomator/UiScrollable.html">UiScrollable</a></li> 4324 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiSelector.html">UiSelector</a></li> 4325 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Until.html">Until</a></li> 4326 </ul> 4327 </li> 4328 4329 <li><h2>Enums</h2> 4330 <ul> 4331 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/Direction.html">Direction</a></li> 4332 </ul> 4333 </li> 4334 4335 <li><h2>Exceptions</h2> 4336 <ul> 4337 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/StaleObjectException.html">StaleObjectException</a></li> 4338 <li class="api apilevel-"><a href="/reference/android/support/test/uiautomator/UiObjectNotFoundException.html">UiObjectNotFoundException</a></li> 4339 </ul> 4340 </li> 4341 4342 </ul> 4343 4344</div> 4345 4346 4347 4348</body> 4349</html> 4350