Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created October 22, 2019 02:23
Show Gist options
  • Select an option

  • Save cdmunoz/bfd9261090d7c3ae95640eef1a9ebe8a to your computer and use it in GitHub Desktop.

Select an option

Save cdmunoz/bfd9261090d7c3ae95640eef1a9ebe8a to your computer and use it in GitHub Desktop.
fun hasImageSet(): BoundedMatcher<View, ImageView> {
return object : BoundedMatcher<View, ImageView>(ImageView::class.java) {
override fun describeTo(description: Description) {
description.appendText("has image set.")
}
override fun matchesSafely(imageView: ImageView): Boolean {
return imageView.background != null
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment