setToastMarginReference

fun TtToastContainer.setToastMarginReference(referenceView: View?, @Px offset: Float? = null)

Sets the toast margins of a TtToastContainer to match the bounds of the descendant referenceView. This is useful when a toast container has to show toasts of various independent descendant views relative to a specific view. offset can be used to apply a margin within the bounds of the reference view.

Calling this with a null referenceView will stop the updating of the margins, but will not reset them to what they were before.