# TreeIterables.ViewAndDistance

Summary:[Methods](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#)  

# TreeIterables.ViewAndDistance

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static


class
TreeIterables.ViewAndDistance
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.util.TreeIterables.ViewAndDistance |

<br />

*** ** * ** ***

Represents the distance a given view is from the root view.

## Summary

|                                                                                                            ### Public methods                                                                                                            ||
|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                    | ` `[getDistanceFromRoot](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#getDistanceFromRoot())`() ` |
| ` `[View](https://developer.android.com/reference/android/view/View.html) | ` `[getView](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#getView())`() `                         |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### getDistanceFromRoot

```
int getDistanceFromRoot ()
```

<br />

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getView

```
View getView ()
```

<br />

<br />

|                                    Returns                                     ||
|------------------------------------------------------------------------|--------|
| [View](https://developer.android.com/reference/android/view/View.html) | <br /> |

-

  ## Classes

  - [ActivityLifecycles](https://developer.android.com/reference/android/support/test/espresso/util/ActivityLifecycles)
  - [EspressoOptional](https://developer.android.com/reference/android/support/test/espresso/util/EspressoOptional)
  - [HumanReadables](https://developer.android.com/reference/android/support/test/espresso/util/HumanReadables)
  - [TreeIterables](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables)
  - [TreeIterables.ViewAndDistance](https://developer.android.com/reference/android/support/test/espresso/util/TreeIterables.ViewAndDistance)