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 2a0ddc0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 509 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ class ViewGroupPositionMatcher(private val position: Int) : BoundedMatcher<View,
description.appendText("Can't match view on $position position")
}
}

Loading

0 comments on commit 2a0ddc0

Please sign in to comment.