Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kotlin = "2.2.0"
compose-multiplatform = "1.10.0-alpha01"
compose-multiplatform = "1.10.0"
dokka = "2.0.0"

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.infiniteretry.snizzors"
version = "1.0.0-cmp1.10-alpha01"
version = "1.0.0-cmp1.10"

kotlin {
listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import androidx.compose.ui.viewinterop.InteropContainer
import androidx.compose.ui.viewinterop.InteropView
import androidx.compose.ui.viewinterop.InteropViewGroup
import androidx.compose.ui.viewinterop.InteropWrappingView
import androidx.compose.ui.viewinterop.TypedInteropViewHolder
import androidx.compose.ui.viewinterop.UIKitInteropElementHolder
import androidx.compose.ui.viewinterop.UIKitInteropProperties
import androidx.compose.ui.viewinterop.nativeAccessibility
import androidx.compose.ui.viewinterop.pointerInteropFilter
Expand All @@ -52,19 +52,12 @@ internal abstract class SnizzorsInteropElementHolder<T : InteropView>(
private val interopWrappingView: InteropWrappingView,
properties: UIKitInteropProperties,
compositeKeyHashCode : CompositeKeyHashCode,
) : TypedInteropViewHolder<T>(
) : UIKitInteropElementHolder<T>(
factory,
interopContainer,
interopWrappingView,
properties,
compositeKeyHashCode,
MeasurePolicy { _, constraints ->
layout(constraints.minWidth, constraints.minHeight) {
// No-op, no children are expected
// TODO: attempt to calculate the size of the wrapped view using constraints
// and autolayout system if possible
// https://youtrack.jetbrains.com/issue/CMP-5873/iOS-investigate-intrinsic-sizing-of-interop-elements
}
}
) {
constructor(
factory: () -> T,
Expand All @@ -81,24 +74,25 @@ internal abstract class SnizzorsInteropElementHolder<T : InteropView>(
compositeKeyHashCode = compositeKeyHashCode
)

override val measurePolicy: MeasurePolicy = MeasurePolicy { _, constraints ->
layout(constraints.minWidth, constraints.minHeight) {
// No-op, no children are expected
// TODO: attempt to calculate the size of the wrapped view using constraints
// and autolayout system if possible
// https://youtrack.jetbrains.com/issue/CMP-5873/iOS-investigate-intrinsic-sizing-of-interop-elements
}
}

// TODO: no more clipping. rename/refactor?
private var currentUnclippedRect: IntRect? = null
private var currentClippedRect: IntRect? = null
private var currentUserComponentRect: IntRect? = null

var properties = properties
set(value) {
if (field != value) {
field = value
onPropertiesChanged()
}
}

/**
* Immediate frame of underlying user component. Can be different from
* [currentUserComponentRect] due to scheduling.
*/
protected abstract var userComponentCGRect: CValue<CGRect>
abstract override var userComponentCGRect: CValue<CGRect>

init {
onPropertiesChanged()
Expand Down