Skip to content

Commit

Permalink
Fix cast warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elihart committed Nov 1, 2023
1 parent bd33a63 commit a94ab3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion radiography/src/test/java/radiography/RadiographyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a94ab3e

Please sign in to comment.