diff --git a/radiography/src/test/java/radiography/RadiographyTest.kt b/radiography/src/test/java/radiography/RadiographyTest.kt index 612f71e..e492b91 100644 --- a/radiography/src/test/java/radiography/RadiographyTest.kt +++ b/radiography/src/test/java/radiography/RadiographyTest.kt @@ -141,7 +141,9 @@ internal class RadiographyTest { }) layout.addView(EditText(context)) - val filter = skipIdsViewFilter(42) and ViewFilter { it !is EditText } + val filter = skipIdsViewFilter(42) and ViewFilter { + (it as? AndroidView)?.view !is EditText + } layout.scan(viewFilter = filter) .also { assertThat(it).contains("CheckBox") diff --git a/sample-compose/src/main/java/com/squareup/radiography/sample/compose/ComposeSampleApp.kt b/sample-compose/src/main/java/com/squareup/radiography/sample/compose/ComposeSampleApp.kt index 96b938a..7af5332 100644 --- a/sample-compose/src/main/java/com/squareup/radiography/sample/compose/ComposeSampleApp.kt +++ b/sample-compose/src/main/java/com/squareup/radiography/sample/compose/ComposeSampleApp.kt @@ -43,6 +43,7 @@ import androidx.compose.ui.viewinterop.AndroidView import radiography.ExperimentalRadiographyComposeApi import radiography.Radiography import radiography.ScanScopes.FocusedWindowScope +import radiography.ScannableView import radiography.ViewFilters.skipComposeTestTagsFilter import radiography.ViewStateRenderers.CheckableRenderer import radiography.ViewStateRenderers.DefaultsIncludingPii @@ -157,7 +158,8 @@ private fun showSelectionDialog(context: Context) { "Focused window and custom filter" to { Radiography.scan( scanScope = FocusedWindowScope, - viewFilter = { view -> view !is LinearLayout } + viewFilter = { view -> + (view as? ScannableView.AndroidView)?.view !is LinearLayout } ) }, "Include PII" to {