File tree Expand file tree Collapse file tree
balloon-compose/src/main/kotlin/com/skydoves/balloon/compose Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ import androidx.compose.ui.semantics.semantics
4040import androidx.compose.ui.unit.Constraints
4141import androidx.compose.ui.unit.IntSize
4242import androidx.compose.ui.unit.dp
43- import androidx.core.view.updateLayoutParams
4443import androidx.lifecycle.compose.LocalLifecycleOwner
4544import androidx.lifecycle.setViewTreeLifecycleOwner
4645import androidx.lifecycle.setViewTreeViewModelStoreOwner
@@ -293,12 +292,12 @@ public fun Modifier.balloon(
293292 val position = coordinates.positionInWindow()
294293 val size = coordinates.size
295294
296- // Update the anchor view's position and size in the parent view
297- anchorView.updateLayoutParams< FrameLayout . LayoutParams > {
298- width = size.width
299- height = size.height
300- leftMargin = position.x .toInt()
301- topMargin = position.y.toInt()
295+ (anchorView.layoutParams as ? ViewGroup . MarginLayoutParams )?. let { params ->
296+ params.width = size.width
297+ params.height = size.height
298+ params.leftMargin = position.x.toInt()
299+ params.topMargin = position.y .toInt()
300+ anchorView.layoutParams = params
302301 }
303302 }
304303}
You can’t perform that action at this time.
0 commit comments