Skip to content

Instantly share code, notes, and snippets.

Last active May 5, 2021 00:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
BottomSheet ViewAction for Espresso
class BottomSheetSetStateAction(
@BottomSheetBehavior.State private val desiredState: Int
) : ViewAction {
override fun getConstraints(): Matcher<View> {
return Matchers.any(
override fun perform(uiController: UiController, view: View) {
val bottomSheetBehavior = BottomSheetBehavior.from(view)
bottomSheetBehavior.state = desiredState
override fun getDescription(): String = "Set BottomSheet to state: $desiredState"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment