affa0cf810
Now that both platforms observe content height natively (iOS via KVO,
Android via OnLayoutChangeListener), the JS-callable updateLayout()
is unused. Remove:
- updateLayout() and prevLayoutDetentIdentifier from iOS SheetView
- AsyncFunction("updateLayout") from both platform module definitions
- updateLayout method from the JS BottomSheetNativeComponent
Android's updateLayout() is kept as a private implementation detail
since the keyboard insets listener and native layout observer both
call it internally.
https://claude.ai/code/session_01Rp7ef1h3fKh6fhStcjqLJ5
48 lines
1.1 KiB
Swift
48 lines
1.1 KiB
Swift
import ExpoModulesCore
|
|
|
|
public class BottomSheetModule: Module {
|
|
public func definition() -> ModuleDefinition {
|
|
Name("BottomSheet")
|
|
|
|
AsyncFunction("dismissAll") {
|
|
SheetManager.shared.dismissAll()
|
|
}
|
|
|
|
View(SheetView.self) {
|
|
Events([
|
|
"onAttemptDismiss",
|
|
"onSnapPointChange",
|
|
"onStateChange"
|
|
])
|
|
|
|
AsyncFunction("dismiss") { (view: SheetView) in
|
|
view.dismiss()
|
|
}
|
|
|
|
Prop("cornerRadius") { (view: SheetView, prop: Float) in
|
|
view.cornerRadius = CGFloat(prop)
|
|
}
|
|
|
|
Prop("minHeight") { (view: SheetView, prop: Double) in
|
|
view.minHeight = prop
|
|
}
|
|
|
|
Prop("maxHeight") { (view: SheetView, prop: Double) in
|
|
view.maxHeight = prop
|
|
}
|
|
|
|
Prop("preventDismiss") { (view: SheetView, prop: Bool) in
|
|
view.preventDismiss = prop
|
|
}
|
|
|
|
Prop("preventExpansion") { (view: SheetView, prop: Bool) in
|
|
view.preventExpansion = prop
|
|
}
|
|
|
|
Prop("sourceViewTag") { (view: SheetView, prop: Int?) in
|
|
view.sourceViewTag = prop
|
|
}
|
|
}
|
|
}
|
|
}
|