diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-10-11 14:41:33 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-10-12 14:01:28 +0200 |
| commit | b3e63bb0cc97d7486d88ddf2d927cd5ae116c075 (patch) | |
| tree | b450ee577d35cf479fe3f953ff989f6b5d6e0211 /android/app/src/androidTest/kotlin | |
| parent | 30b81b081df1694229c9fd1995030ce1fab851b9 (diff) | |
| download | mullvadvpn-b3e63bb0cc97d7486d88ddf2d927cd5ae116c075.tar.xz mullvadvpn-b3e63bb0cc97d7486d88ddf2d927cd5ae116c075.zip | |
Remove unused classes and resources
Diffstat (limited to 'android/app/src/androidTest/kotlin')
| -rw-r--r-- | android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/RecyclerViewMatcher.kt | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/RecyclerViewMatcher.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/RecyclerViewMatcher.kt deleted file mode 100644 index c5093f3ceb..0000000000 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/RecyclerViewMatcher.kt +++ /dev/null @@ -1,52 +0,0 @@ -package net.mullvad.mullvadvpn - -import android.content.res.Resources -import android.content.res.Resources.NotFoundException -import android.view.View -import androidx.recyclerview.widget.RecyclerView -import org.hamcrest.Description -import org.hamcrest.Matcher -import org.hamcrest.TypeSafeMatcher - -class RecyclerViewMatcher(private val recyclerViewId: Int) { - fun atPosition(position: Int): Matcher<View> { - return atPositionOnView(position) - } - - fun atPositionOnView(position: Int, targetViewId: Int? = null): Matcher<View> = - object : TypeSafeMatcher<View>() { - var resources: Resources? = null - var childView: View? = null - - override fun describeTo(description: Description) { - val idDescription = - resources?.let { - try { - it.getResourceName(recyclerViewId) - } catch (var4: NotFoundException) { - "$recyclerViewId (resource name not found)" - } - } - ?: recyclerViewId.toString() - description.appendText("with id: $idDescription") - } - - override fun matchesSafely(view: View): Boolean { - resources = view.resources - val recyclerView = view.rootView.findViewById<View>(recyclerViewId) as RecyclerView? - if (recyclerView == null || recyclerView.id != recyclerViewId) { - return false - } - childView = recyclerView.findViewHolderForAdapterPosition(position)?.itemView - val targetView = - targetViewId?.let { id -> childView?.findViewById<View>(id) } ?: childView - return view == targetView - } - } - - companion object { - fun withRecyclerView(recyclerViewId: Int): RecyclerViewMatcher { - return RecyclerViewMatcher(recyclerViewId) - } - } -} |
