Lines Matching refs:index

42      * Returns an action that clicks on text at an index on the TextView.<br>
49 * @param index The index of the TextView's text to click on.
51 public static ViewAction clickOnTextAtIndex(int index) {
53 new ViewClickAction(Tap.SINGLE, new TextCoordinates(index), Press.FINGER));
57 * Returns an action that clicks by mouse on text at an index on the TextView.<br>
64 * @param index The index of the TextView's text to click on.
66 public static ViewAction mouseClickOnTextAtIndex(int index) {
67 return mouseClickOnTextAtIndex(index, MotionEvent.BUTTON_PRIMARY);
71 * Returns an action that clicks by mouse on text at an index on the TextView.<br>
78 * @param index The index of the TextView's text to click on.
81 public static ViewAction mouseClickOnTextAtIndex(int index,
84 new MouseClickAction(Tap.SINGLE, new TextCoordinates(index), button));
88 * Returns an action that double-clicks on text at an index on the TextView.<br>
95 * @param index The index of the TextView's text to double-click on.
97 public static ViewAction doubleClickOnTextAtIndex(int index) {
99 new ViewClickAction(Tap.DOUBLE, new TextCoordinates(index), Press.FINGER));
103 * Returns an action that double-clicks by mouse on text at an index on the TextView.<br>
110 * @param index The index of the TextView's text to double-click on.
112 public static ViewAction mouseDoubleClickOnTextAtIndex(int index) {
114 new MouseClickAction(Tap.DOUBLE, new TextCoordinates(index)));
118 * Returns an action that long presses on text at an index on the TextView.<br>
125 * @param index The index of the TextView's text to long press on.
127 public static ViewAction longPressOnTextAtIndex(int index) {
129 new ViewClickAction(Tap.LONG, new TextCoordinates(index), Press.FINGER));
133 * Returns an action that long click by mouse on text at an index on the TextView.<br>
140 * @param index The index of the TextView's text to long click on.
142 public static ViewAction mouseLongClickOnTextAtIndex(int index) {
144 new MouseClickAction(Tap.LONG, new TextCoordinates(index)));
148 * Returns an action that triple-clicks by mouse on text at an index on the TextView.<br>
155 * @param index The index of the TextView's text to triple-click on.
157 public static ViewAction mouseTripleClickOnTextAtIndex(int index) {
159 new MouseClickAction(MouseClickAction.CLICK.TRIPLE, new TextCoordinates(index)));
171 * @param startIndex The index of the TextView's text to start a drag from
172 * @param endIndex The index of the TextView's text to end the drag at
193 * @param startIndex The index of the TextView's text to start a drag from
194 * @param endIndex The index of the TextView's text to end the drag at
215 * @param startIndex The index of the TextView's text to start a drag from
216 * @param endIndex The index of the TextView's text to end the drag at
237 * @param startIndex The index of the TextView's text to start a drag from
238 * @param endIndex The index of the TextView's text to end the drag at
259 * @param startIndex The index of the TextView's text to start a drag from
260 * @param endIndex The index of the TextView's text to end the drag at
281 * @param startIndex The index of the TextView's text to start a drag from
282 * @param endIndex The index of the TextView's text to end the drag at
311 * @param endIndex The index of the TextView's text to end the drag at
328 * @param endIndex The index of the TextView's text to end the drag at
329 * @param primary whether to use primary direction to get coordinate form index when endIndex is
395 * A provider of the x, y coordinates of the handle that points the specified text index in a
407 public HandleCoordinates(TextView textView, Handle handleType, int index, boolean primary) {
410 mIndex = index;
413 + " handle that points text index: " + index
482 * A provider of the x, y coordinates of the text at the specified index in a text view.
490 public TextCoordinates(int index) {
491 this(index, true);
494 public TextCoordinates(int index, boolean primary) {
495 mIndex = index;
497 mActionDescription = "Could not locate text at index: " + mIndex
523 private float[] locateTextAtIndex(TextView textView, int index, boolean primary) {
524 if (index < 0 || index > textView.getText().length()) {
525 throw new StringIndexOutOfBoundsException(index);
528 final int line = layout.getLineForOffset(index);
530 (primary ? layout.getPrimaryHorizontal(index)
531 : layout.getSecondaryHorizontal(index)),