Skip to content

Commit

Permalink
feat(TextSwitcher): add support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vacxe committed Jun 9, 2023
2 parents 4a2505e + f4ff8c0 commit 6839d80
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 508 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@file:Suppress("unused")

package io.github.kakaocup.kakao.common.matchers

import android.view.View
import android.widget.ViewSwitcher
import androidx.test.espresso.matcher.BoundedMatcher
import org.hamcrest.Description

/**
* Matches current view in View Switcher
*/
class SwitcherCurrentViewMatcher : BoundedMatcher<View, View>(View::class.java) {
override fun matchesSafely(view: View?) = view?.let {
(it.parent as ViewSwitcher).currentView.equals(it)
} ?: false

override fun describeTo(description: Description) {
description.appendText("Can't match current view for Switcher")
}
}

Loading

0 comments on commit 6839d80

Please sign in to comment.