Last active
May 24, 2021 23:33
-
-
Save cmathew/63ecd94924b7e4968f9fbb75b6c1bf34 to your computer and use it in GitHub Desktop.
IdlingResource which waits for a BottomSheet to enter a particular state.
This file contains hidden or 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 BottomSheetStateResource( | |
bottomSheetBehavior: BottomSheetBehavior<View>, | |
@BottomSheetBehavior.State private val desiredState: Int | |
) : BottomSheetResource(bottomSheetBehavior) { | |
override fun getName(): String { | |
return "BottomSheet awaiting state: $desiredState" | |
} | |
override fun isDesiredState(@BottomSheetBehavior.State state: Int): Boolean { | |
return state == desiredState | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment