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>RecyclerViewActions.PositionableRecyclerViewAction</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<div class="sum-details-links"> 177 178Summary: 179 180 181 182 183 184 185 186 187 188 189 190 <a href="#pubmethods">Methods</a> 191 192 193 194 195 | <a href="#inhmethods">Inherited Methods</a> 196 197| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 198 199</div><!-- end sum-details-links --> 200</div><!-- end api-info-block --> 201 202<div class="api apilevel-" id="jd-content"> 203 204<!-- ======== START OF CLASS DATA ======== --> 205 206<h1 class="api-title">RecyclerViewActions.PositionableRecyclerViewAction</h1> 207<p> 208<code class="api-signature"> 209 public 210 static 211 212 213 interface 214 RecyclerViewActions.PositionableRecyclerViewAction 215</code> 216<br> 217 218 219<code class="api-signature"> 220 221 222 implements 223 224 <a href="/reference/android/support/test/espresso/ViewAction.html">ViewAction</a> 225 226 227 228</code> 229 230</p><table class="jd-inheritance-table"> 231 232 233 <tr> 234 235 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.espresso.contrib.RecyclerViewActions.PositionableRecyclerViewAction 236 </td> 237 </tr> 238 239 240</table> 241 242 243 244 245<br><hr> 246 247 248 <p>Most RecyclerViewActions are given a matcher to select a particular view / viewholder within 249 the RecyclerView. In this case the default behaviour is to expect that the matcher matches 1 250 and only one item within the RecyclerView. 251 252 <p>This interface gives users the ability to override that type of behaviour and explicitly 253 select an item in the RecyclerView at a given position. This is similar to on the 254 onData(...).atPosition() api for AdapterViews. 255</p> 256 257 258 259 260 261 262 263<h2 class="api-section">Summary</h2> 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291<!-- ========== METHOD SUMMARY =========== --> 292<table id="pubmethods" class="responsive methods"> 293<tr><th colspan="2"><h3>Public methods</h3></th></tr> 294 295 296 297 298 <tr class="api apilevel-" > 299 300 301 <td><code> 302 abstract 303 304 305 306 307 <a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html">RecyclerViewActions.PositionableRecyclerViewAction</a></code> 308 </td> 309 310 <td width="100%"> 311 <code> 312 <a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html#atPosition(int)">atPosition</a>(int position) 313 </code> 314 315 <p>Returns a new ViewAction which will cause the ViewAction to operate upon the position-th 316 element which the matcher has selected. 317 318 319</p> 320 321 </td> 322 </tr> 323 324 325 326</table> 327 328 329 330 331 332 333 334<!-- ========== METHOD SUMMARY =========== --> 335<table id="inhmethods" class="methods inhtable"> 336<tr><th><h3>Inherited methods</h3></th></tr> 337 338 339<tr class="api apilevel-" > 340<td colspan="2"> 341 342 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.espresso.ViewAction" class="jd-expando-trigger closed" 343 ><img height="34" id="inherited-methods-android.support.test.espresso.ViewAction-trigger" 344 src="/assets/images/styles/disclosure_down.png" 345 class="jd-expando-trigger-img" /></a>From 346interface 347<code> 348 349 <a href="/reference/android/support/test/espresso/ViewAction.html">android.support.test.espresso.ViewAction</a> 350 351</code> 352<div id="inherited-methods-android.support.test.espresso.ViewAction"> 353 <div id="inherited-methods-android.support.test.espresso.ViewAction-list" 354 class="jd-inheritedlinks"> 355 </div> 356 <div id="inherited-methods-android.support.test.espresso.ViewAction-summary" style="display: none;"> 357 <table class="jd-sumtable-expando responsive"> 358 359 360 361 362 <tr class="api apilevel-" > 363 364 365 <td><code> 366 abstract 367 368 369 370 371 Matcher<View></code> 372 </td> 373 374 <td width="100%"> 375 <code> 376 <a href="/reference/android/support/test/espresso/ViewAction.html#getConstraints()">getConstraints</a>() 377 </code> 378 379 <p>A mechanism for ViewActions to specify what type of views they can operate on. 380 381 382</p> 383 384 </td> 385 </tr> 386 387 388 389 <tr class="api apilevel-" > 390 391 392 <td><code> 393 abstract 394 395 396 397 398 String</code> 399 </td> 400 401 <td width="100%"> 402 <code> 403 <a href="/reference/android/support/test/espresso/ViewAction.html#getDescription()">getDescription</a>() 404 </code> 405 406 <p>Returns a description of the view action. 407 408 409</p> 410 411 </td> 412 </tr> 413 414 415 416 <tr class="api apilevel-" > 417 418 419 <td><code> 420 abstract 421 422 423 424 425 void</code> 426 </td> 427 428 <td width="100%"> 429 <code> 430 <a href="/reference/android/support/test/espresso/ViewAction.html#perform(android.support.test.espresso.UiController, android.view.View)">perform</a>(<a href="/reference/android/support/test/espresso/UiController.html">UiController</a> uiController, View view) 431 </code> 432 433 <p>Performs this action on the given view. 434 435 436</p> 437 438 </td> 439 </tr> 440 441 442 443 </table> 444 </div> 445</div> 446</td></tr> 447 448 449</table> 450 451 452 453<!-- XML Attributes --> 454 455 456<!-- Enum Values --> 457 458 459<!-- Constants --> 460 461 462<!-- Fields --> 463 464 465<!-- Public ctors --> 466 467 468 469<!-- ========= CONSTRUCTOR DETAIL ======== --> 470<!-- Protected ctors --> 471 472 473 474<!-- ========= METHOD DETAIL ======== --> 475<!-- Public methdos --> 476 477<h2 class="api-section">Public methods</h2> 478 479 480 481<A NAME="atPosition(int)"></A> 482 483<div class="api apilevel-"> 484 <h3 class="api-name">atPosition</h3> 485 <div class="api-level"> 486 <div></div> 487 488 489 490 </div> 491<pre class="api-signature no-pretty-print"> 492<a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html">RecyclerViewActions.PositionableRecyclerViewAction</a> atPosition (int position)</pre> 493 494 495 496 497 <p>Returns a new ViewAction which will cause the ViewAction to operate upon the position-th 498 element which the matcher has selected.</p> 499 <table class="responsive"> 500 <tr><th colspan=2>Parameters</th></tr> 501 <tr> 502 <td><code>position</code></td> 503 <td width="100%"> 504 <code>int</code>: 505 a 0-based index into the list of matching elements within the RecyclerView.</td> 506 </tr> 507 </table> 508 <table class="responsive"> 509 <tr><th colspan=2>Returns</th></tr> 510 <tr> 511 <td><code><a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html">RecyclerViewActions.PositionableRecyclerViewAction</a></code></td> 512 <td width="100%">PositionableRecyclerViewAction a new ViewAction focused on a particular position.</td> 513 </tr> 514 </table> 515 <table class="responsive"> 516 <tr><th colspan=2>Throws</th></tr> 517 <tr> 518 <td><code>IllegalArgumentException</code></td> 519 <td width="100%">if position < 0. 520</td> 521 </tr> 522 </table> 523 524 525</div> 526 527 528 529 530 531<!-- ========= METHOD DETAIL ======== --> 532 533 534 535<!-- ========= END OF CLASS DATA ========= --> 536 537</div><!-- end jd-content --> 538 539 540 541<div class="data-reference-resources-wrapper"> 542 543 <ul data-reference-resources> 544 545 546 <li><h2>Interfaces</h2> 547 <ul> 548 <li class="selected api apilevel-"><a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction.html">RecyclerViewActions.PositionableRecyclerViewAction</a></li> 549 </ul> 550 </li> 551 552 <li><h2>Classes</h2> 553 <ul> 554 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/AccessibilityChecks.html">AccessibilityChecks</a></li> 555 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/CountingIdlingResource.html">CountingIdlingResource</a></li> 556 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/DrawerActions.html">DrawerActions</a></li> 557 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/DrawerMatchers.html">DrawerMatchers</a></li> 558 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/NavigationViewActions.html">NavigationViewActions</a></li> 559 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/PickerActions.html">PickerActions</a></li> 560 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/contrib/RecyclerViewActions.html">RecyclerViewActions</a></li> 561 </ul> 562 </li> 563 564 565 566 </ul> 567 568</div> 569 570 571 572</body> 573</html> 574