[android-components](../index.md) / [mozilla.components.support.android.test.espresso.matcher](index.md) / [hasFocus](./has-focus.md)

# hasFocus

`fun hasFocus(hasFocus: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): Matcher<`[`View`](https://developer.android.com/reference/android/view/View.html)`>` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/android-test/src/main/java/mozilla/components/support/android/test/espresso/matcher/ViewMatchers.kt#L23)

The existing [espressoHasFocus](#) function but uses a boolean to invert rather than requiring the [not](#) matcher.

