Skip to content

Commit

Permalink
Add a way to get all compose views
Browse files Browse the repository at this point in the history
  • Loading branch information
planarvoid committed Dec 16, 2024
1 parent d63591e commit eb751c9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,10 @@ class ComposePlaceholderManager(
}
return source
}

fun getViewInPosition(x: Float, y: Float): ComposeView? {
return composeViewState.value.values.firstOrNull {
(it.topMargin < y && (it.topMargin + it.height) > y) && (it.leftMargin < x && (it.leftMargin + it.width) > x)
}
}
}

0 comments on commit eb751c9

Please sign in to comment.