Last active
May 5, 2021 00:22
-
-
Save cmathew/d8be2e07d28dbf9fd9258a08dad2a2ca to your computer and use it in GitHub Desktop.
BottomSheet ViewAction for Espresso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BottomSheetSetStateAction( | |
@BottomSheetBehavior.State private val desiredState: Int | |
) : ViewAction { | |
override fun getConstraints(): Matcher<View> { | |
return Matchers.any(View::class.java) | |
} | |
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