@expo/ui 55.0.1 → 55.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/CONTRIBUTING.md +30 -0
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
  5. package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
  6. package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
  7. package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
  8. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +302 -31
  9. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
  10. package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
  11. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
  12. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  13. package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
  14. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  15. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  16. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  17. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  18. package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
  19. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  20. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  21. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  22. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
  23. package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
  24. package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
  25. package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
  26. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  27. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  28. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  29. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  30. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  31. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  32. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  33. package/build/jetpack-compose/Button/index.d.ts +65 -51
  34. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  35. package/build/jetpack-compose/Card/index.d.ts +72 -14
  36. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  37. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  38. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  39. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  40. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  41. package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
  42. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  43. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  44. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  45. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  46. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  47. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  48. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  49. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  50. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  51. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  52. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  53. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  54. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  56. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  57. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  58. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  60. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  61. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  62. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  63. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  64. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/Spacer/index.d.ts +2 -2
  66. package/build/jetpack-compose/Switch/index.d.ts +25 -47
  67. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  68. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  69. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  70. package/build/jetpack-compose/index.d.ts +5 -4
  71. package/build/jetpack-compose/index.d.ts.map +1 -1
  72. package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
  73. package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
  74. package/build/jetpack-compose/modifiers/index.d.ts +68 -4
  75. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  76. package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
  77. package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
  78. package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
  79. package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
  80. package/build/swift-ui/ControlGroup/index.d.ts +29 -0
  81. package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
  82. package/build/swift-ui/Gauge/index.d.ts.map +1 -1
  83. package/build/swift-ui/Image/index.d.ts +7 -1
  84. package/build/swift-ui/Image/index.d.ts.map +1 -1
  85. package/build/swift-ui/Label/index.d.ts.map +1 -1
  86. package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
  87. package/build/swift-ui/Menu/index.d.ts.map +1 -1
  88. package/build/swift-ui/Picker/index.d.ts.map +1 -1
  89. package/build/swift-ui/Popover/index.d.ts.map +1 -1
  90. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  91. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  92. package/build/swift-ui/Section/index.d.ts.map +1 -1
  93. package/build/swift-ui/Slider/index.d.ts.map +1 -1
  94. package/build/swift-ui/SlotView.d.ts +5 -0
  95. package/build/swift-ui/SlotView.d.ts.map +1 -0
  96. package/build/swift-ui/Stepper/index.d.ts +3 -3
  97. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  98. package/build/swift-ui/Text/index.d.ts +33 -1
  99. package/build/swift-ui/Text/index.d.ts.map +1 -1
  100. package/build/swift-ui/index.d.ts +2 -0
  101. package/build/swift-ui/index.d.ts.map +1 -1
  102. package/build/swift-ui/modifiers/index.d.ts +54 -1
  103. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  104. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  105. package/build/swift-ui/types.d.ts +7 -0
  106. package/build/swift-ui/types.d.ts.map +1 -1
  107. package/expo-module.config.json +1 -1
  108. package/ios/AccessoryWidgetBackgroundView.swift +27 -0
  109. package/ios/BottomSheetView.swift +1 -6
  110. package/ios/ClosedRangeDateRecord.swift +10 -0
  111. package/ios/ColorPickerView.swift +9 -8
  112. package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
  113. package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
  114. package/ios/ContextMenu/ContextMenu.swift +27 -22
  115. package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
  116. package/ios/ControlGroupView.swift +33 -0
  117. package/ios/DatePickerView.swift +7 -5
  118. package/ios/DisclosureGroupView.swift +5 -7
  119. package/ios/ExpoUIModule.swift +10 -32
  120. package/ios/GaugeView.swift +4 -26
  121. package/ios/HostView.swift +1 -2
  122. package/ios/ImageView.swift +22 -11
  123. package/ios/Label.swift +2 -17
  124. package/ios/LabeledContentView.swift +3 -27
  125. package/ios/ListView.swift +6 -14
  126. package/ios/Menu/MenuRecords.swift +0 -2
  127. package/ios/Menu/MenuView.swift +2 -5
  128. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  129. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  130. package/ios/Modifiers/ResizableModifier.swift +24 -0
  131. package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
  132. package/ios/Modifiers/View+ModifierArray.swift +29 -0
  133. package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
  134. package/ios/Modifiers/WidgetModifiers.swift +46 -0
  135. package/ios/Picker/PickerView.swift +8 -16
  136. package/ios/Popover/PopoverProps.swift +0 -4
  137. package/ios/Popover/PopoverView.swift +5 -11
  138. package/ios/ProgressView.swift +0 -5
  139. package/ios/RNHostView.swift +91 -10
  140. package/ios/SectionView.swift +9 -17
  141. package/ios/SecureFieldView.swift +0 -1
  142. package/ios/ShareLink/ShareLinkView.swift +1 -1
  143. package/ios/SliderView.swift +16 -31
  144. package/ios/SlotView.swift +38 -0
  145. package/ios/StepperView.swift +12 -16
  146. package/ios/TextFieldView.swift +0 -1
  147. package/ios/TextView.swift +37 -1
  148. package/ios/Toggle/ToggleView.swift +5 -7
  149. package/ios/UIBaseView.swift +34 -3
  150. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
  151. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
  152. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
  153. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
  154. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
  155. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
  156. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
  157. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
  158. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
  159. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
  160. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
  161. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
  162. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
  163. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
  164. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
  165. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
  166. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
  167. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
  168. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
  169. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
  170. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  171. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  172. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  173. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  174. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  175. package/package.json +5 -2
  176. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  177. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  178. package/src/jetpack-compose/Button/index.tsx +69 -92
  179. package/src/jetpack-compose/Card/index.tsx +105 -29
  180. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  181. package/src/jetpack-compose/Chip/index.tsx +391 -51
  182. package/src/jetpack-compose/DatePicker/index.tsx +215 -6
  183. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  184. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  185. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  186. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  187. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  188. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  189. package/src/jetpack-compose/Progress/index.tsx +120 -62
  190. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  191. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  192. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  193. package/src/jetpack-compose/Slider/index.tsx +76 -29
  194. package/src/jetpack-compose/Spacer/index.tsx +2 -2
  195. package/src/jetpack-compose/Switch/index.tsx +32 -84
  196. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  197. package/src/jetpack-compose/index.ts +5 -4
  198. package/src/jetpack-compose/modifiers/animation.ts +37 -0
  199. package/src/jetpack-compose/modifiers/index.ts +86 -6
  200. package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
  201. package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
  202. package/src/swift-ui/ContextMenu/index.tsx +6 -20
  203. package/src/swift-ui/ControlGroup/index.tsx +59 -0
  204. package/src/swift-ui/Gauge/index.tsx +5 -20
  205. package/src/swift-ui/Image/index.tsx +7 -1
  206. package/src/swift-ui/Label/index.tsx +2 -5
  207. package/src/swift-ui/LabeledContent/index.tsx +3 -12
  208. package/src/swift-ui/Menu/index.tsx +2 -6
  209. package/src/swift-ui/Picker/index.tsx +4 -11
  210. package/src/swift-ui/Popover/index.tsx +3 -12
  211. package/src/swift-ui/ProgressView/index.tsx +1 -3
  212. package/src/swift-ui/Section/index.tsx +4 -9
  213. package/src/swift-ui/Slider/index.tsx +4 -12
  214. package/src/swift-ui/SlotView.tsx +8 -0
  215. package/src/swift-ui/Stepper/index.tsx +7 -7
  216. package/src/swift-ui/Text/index.tsx +66 -2
  217. package/src/swift-ui/index.tsx +2 -0
  218. package/src/swift-ui/modifiers/index.ts +87 -1
  219. package/src/swift-ui/types.ts +5 -0
  220. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  221. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  222. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  223. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  224. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  225. package/build/jetpack-compose/Button/types.d.ts +0 -5
  226. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  227. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  228. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  229. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  230. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  231. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  232. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  233. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  234. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  235. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  236. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  237. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  238. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  239. package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
  240. package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
  241. package/ios/Menu/MenuComponents.swift +0 -12
  242. package/ios/Picker/PickerComponents.swift +0 -24
  243. package/ios/Popover/PopoverComponents.swift +0 -18
  244. package/ios/SectionComponents.swift +0 -34
  245. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
  246. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
  247. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
  248. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
  249. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
  250. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
  251. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
  252. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
  253. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
  254. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
  255. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
  256. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
  257. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
  258. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
  259. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
  260. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
  261. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
  262. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
  263. package/src/jetpack-compose/Button/types.ts +0 -57
  264. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  265. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  266. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  267. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  268. package/src/jetpack-compose/Picker/index.tsx +0 -90
  269. package/src/jetpack-compose/TextButton/index.tsx +0 -55
@@ -1,119 +1,219 @@
1
- @file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
1
+ @file:OptIn(ExperimentalMaterial3ExpressiveApi::class, ExperimentalMaterial3Api::class)
2
2
 
3
3
  package expo.modules.ui
4
4
 
5
5
  import android.graphics.Color
6
6
  import androidx.compose.material3.CircularProgressIndicator
7
7
  import androidx.compose.material3.CircularWavyProgressIndicator
8
+ import androidx.compose.material3.ExperimentalMaterial3Api
8
9
  import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
9
10
  import androidx.compose.material3.LinearProgressIndicator
10
11
  import androidx.compose.material3.LinearWavyProgressIndicator
11
12
  import androidx.compose.material3.ProgressIndicatorDefaults
13
+ import androidx.compose.material3.WavyProgressIndicatorDefaults
12
14
  import androidx.compose.runtime.Composable
15
+ import androidx.compose.ui.graphics.StrokeCap
16
+ import androidx.compose.ui.unit.dp
13
17
  import expo.modules.kotlin.records.Field
14
18
  import expo.modules.kotlin.records.Record
15
- import expo.modules.kotlin.types.Enumerable
16
19
  import expo.modules.kotlin.views.ComposeProps
17
20
  import expo.modules.kotlin.views.FunctionalComposableScope
18
21
 
19
- enum class ProgressVariant(val value: String) : Enumerable {
20
- CIRCULAR("circular"),
21
- LINEAR("linear"),
22
- CIRCULAR_WAVY("circularWavy"),
23
- LINEAR_WAVY("linearWavy")
24
- }
22
+ // region LinearProgressIndicator
25
23
 
26
- class ProgressColors : Record {
27
- @Field
28
- val trackColor: Color? = null
24
+ class DrawStopIndicatorConfig : Record {
25
+ @Field val color: Color? = null
26
+ @Field val strokeCap: String? = null
27
+ @Field val stopSize: Float? = null
29
28
  }
30
29
 
31
- data class ProgressProps(
32
- val variant: ProgressVariant = ProgressVariant.CIRCULAR,
30
+ data class LinearProgressIndicatorProps(
33
31
  val progress: Float? = null,
34
32
  val color: Color? = null,
35
- val elementColors: ProgressColors = ProgressColors(),
33
+ val trackColor: Color? = null,
34
+ val strokeCap: String? = null,
35
+ val gapSize: Float? = null,
36
+ val drawStopIndicator: DrawStopIndicatorConfig? = null,
36
37
  val modifiers: ModifierList = emptyList()
37
38
  ) : ComposeProps
38
39
 
39
40
  @Composable
40
- fun FunctionalComposableScope.ProgressContent(props: ProgressProps) {
41
- val progress = props.progress
42
- val color = props.color
43
- val colors = props.elementColors
41
+ fun FunctionalComposableScope.LinearProgressIndicatorContent(props: LinearProgressIndicatorProps) {
44
42
  val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
43
+ val color = props.color.composeOrNull ?: ProgressIndicatorDefaults.linearColor
44
+ val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.linearTrackColor
45
+ val strokeCap = props.strokeCap.toStrokeCap() ?: ProgressIndicatorDefaults.LinearStrokeCap
46
+ val gapSize = props.gapSize?.dp ?: ProgressIndicatorDefaults.LinearIndicatorTrackGapSize
45
47
 
46
- when (props.variant) {
47
- ProgressVariant.LINEAR -> {
48
- val composeColor = color.composeOrNull ?: ProgressIndicatorDefaults.linearColor
49
- val trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.linearTrackColor
50
- if (progress != null) {
51
- LinearProgressIndicator(
52
- progress = { progress },
53
- color = composeColor,
54
- trackColor = trackColor,
55
- drawStopIndicator = {},
56
- modifier = modifier
57
- )
58
- } else {
59
- LinearProgressIndicator(
60
- color = composeColor,
61
- trackColor = trackColor,
62
- modifier = modifier
63
- )
64
- }
65
- }
66
- ProgressVariant.CIRCULAR -> {
67
- val composeColor = color.composeOrNull ?: ProgressIndicatorDefaults.circularColor
68
- if (progress != null) {
69
- CircularProgressIndicator(
70
- progress = { progress },
71
- color = composeColor,
72
- trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor,
73
- modifier = modifier
74
- )
75
- } else {
76
- CircularProgressIndicator(
77
- color = composeColor,
78
- trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularIndeterminateTrackColor,
79
- modifier = modifier
80
- )
81
- }
82
- }
83
- ProgressVariant.LINEAR_WAVY -> {
84
- val composeColor = color.composeOrNull ?: ProgressIndicatorDefaults.linearColor
85
- val trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.linearTrackColor
86
- if (progress != null) {
87
- LinearWavyProgressIndicator(
88
- progress = { progress },
89
- color = composeColor,
90
- trackColor = trackColor,
91
- modifier = modifier
92
- )
93
- } else {
94
- LinearWavyProgressIndicator(
95
- color = composeColor,
96
- trackColor = trackColor,
97
- modifier = modifier
98
- )
99
- }
100
- }
101
- ProgressVariant.CIRCULAR_WAVY -> {
102
- val composeColor = color.composeOrNull ?: ProgressIndicatorDefaults.circularColor
103
- if (progress != null) {
104
- CircularWavyProgressIndicator(
105
- progress = { progress },
106
- color = composeColor,
107
- trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor,
108
- modifier = modifier
109
- )
110
- } else {
111
- CircularWavyProgressIndicator(
112
- color = composeColor,
113
- trackColor = colors.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor,
114
- modifier = modifier
115
- )
116
- }
48
+ if (props.progress != null) {
49
+ val stopIndicatorConfig = props.drawStopIndicator
50
+ if (stopIndicatorConfig != null) {
51
+ LinearProgressIndicator(
52
+ progress = { props.progress },
53
+ color = color,
54
+ trackColor = trackColor,
55
+ strokeCap = strokeCap,
56
+ gapSize = gapSize,
57
+ drawStopIndicator = {
58
+ ProgressIndicatorDefaults.drawStopIndicator(
59
+ drawScope = this,
60
+ stopSize = stopIndicatorConfig.stopSize?.dp ?: ProgressIndicatorDefaults.LinearTrackStopIndicatorSize,
61
+ color = stopIndicatorConfig.color.composeOrNull ?: color,
62
+ strokeCap = stopIndicatorConfig.strokeCap.toStrokeCap() ?: strokeCap
63
+ )
64
+ },
65
+ modifier = modifier
66
+ )
67
+ } else {
68
+ LinearProgressIndicator(
69
+ progress = { props.progress },
70
+ color = color,
71
+ trackColor = trackColor,
72
+ strokeCap = strokeCap,
73
+ gapSize = gapSize,
74
+ modifier = modifier
75
+ )
117
76
  }
77
+ } else {
78
+ LinearProgressIndicator(
79
+ color = color,
80
+ trackColor = trackColor,
81
+ strokeCap = strokeCap,
82
+ gapSize = gapSize,
83
+ modifier = modifier
84
+ )
85
+ }
86
+ }
87
+
88
+ // endregion
89
+
90
+ // region CircularProgressIndicator
91
+
92
+ data class CircularProgressIndicatorProps(
93
+ val progress: Float? = null,
94
+ val color: Color? = null,
95
+ val trackColor: Color? = null,
96
+ val strokeWidth: Float? = null,
97
+ val strokeCap: String? = null,
98
+ val gapSize: Float? = null,
99
+ val modifiers: ModifierList = emptyList()
100
+ ) : ComposeProps
101
+
102
+ @Composable
103
+ fun FunctionalComposableScope.CircularProgressIndicatorContent(props: CircularProgressIndicatorProps) {
104
+ val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
105
+ val color = props.color.composeOrNull ?: ProgressIndicatorDefaults.circularColor
106
+ val strokeWidth = props.strokeWidth?.dp ?: ProgressIndicatorDefaults.CircularStrokeWidth
107
+
108
+ if (props.progress != null) {
109
+ val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor
110
+ val strokeCap = props.strokeCap.toStrokeCap() ?: ProgressIndicatorDefaults.CircularDeterminateStrokeCap
111
+ val gapSize = props.gapSize?.dp ?: ProgressIndicatorDefaults.CircularIndicatorTrackGapSize
112
+
113
+ CircularProgressIndicator(
114
+ progress = { props.progress },
115
+ color = color,
116
+ trackColor = trackColor,
117
+ strokeWidth = strokeWidth,
118
+ strokeCap = strokeCap,
119
+ gapSize = gapSize,
120
+ modifier = modifier
121
+ )
122
+ } else {
123
+ val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularIndeterminateTrackColor
124
+ val strokeCap = props.strokeCap.toStrokeCap() ?: ProgressIndicatorDefaults.CircularIndeterminateStrokeCap
125
+
126
+ CircularProgressIndicator(
127
+ color = color,
128
+ trackColor = trackColor,
129
+ strokeWidth = strokeWidth,
130
+ strokeCap = strokeCap,
131
+ modifier = modifier
132
+ )
133
+ }
134
+ }
135
+
136
+ // endregion
137
+
138
+ // region LinearWavyProgressIndicator
139
+
140
+ data class LinearWavyProgressIndicatorProps(
141
+ val progress: Float? = null,
142
+ val color: Color? = null,
143
+ val trackColor: Color? = null,
144
+ val stopSize: Float? = null,
145
+ val modifiers: ModifierList = emptyList()
146
+ ) : ComposeProps
147
+
148
+ @Composable
149
+ fun FunctionalComposableScope.LinearWavyProgressIndicatorContent(props: LinearWavyProgressIndicatorProps) {
150
+ val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
151
+ val color = props.color.composeOrNull ?: WavyProgressIndicatorDefaults.indicatorColor
152
+ val trackColor = props.trackColor.composeOrNull ?: WavyProgressIndicatorDefaults.trackColor
153
+ val stopSize = props.stopSize?.dp ?: WavyProgressIndicatorDefaults.LinearTrackStopIndicatorSize
154
+
155
+ if (props.progress != null) {
156
+ LinearWavyProgressIndicator(
157
+ progress = { props.progress },
158
+ color = color,
159
+ trackColor = trackColor,
160
+ stopSize = stopSize,
161
+ modifier = modifier
162
+ )
163
+ } else {
164
+ LinearWavyProgressIndicator(
165
+ color = color,
166
+ trackColor = trackColor,
167
+ modifier = modifier
168
+ )
169
+ }
170
+ }
171
+
172
+ // endregion
173
+
174
+ // region CircularWavyProgressIndicator
175
+
176
+ data class CircularWavyProgressIndicatorProps(
177
+ val progress: Float? = null,
178
+ val color: Color? = null,
179
+ val trackColor: Color? = null,
180
+ val modifiers: ModifierList = emptyList()
181
+ ) : ComposeProps
182
+
183
+ @Composable
184
+ fun FunctionalComposableScope.CircularWavyProgressIndicatorContent(props: CircularWavyProgressIndicatorProps) {
185
+ val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
186
+ val color = props.color.composeOrNull ?: ProgressIndicatorDefaults.circularColor
187
+
188
+ if (props.progress != null) {
189
+ val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularDeterminateTrackColor
190
+
191
+ CircularWavyProgressIndicator(
192
+ progress = { props.progress },
193
+ color = color,
194
+ trackColor = trackColor,
195
+ modifier = modifier
196
+ )
197
+ } else {
198
+ val trackColor = props.trackColor.composeOrNull ?: ProgressIndicatorDefaults.circularIndeterminateTrackColor
199
+
200
+ CircularWavyProgressIndicator(
201
+ color = color,
202
+ trackColor = trackColor,
203
+ modifier = modifier
204
+ )
205
+ }
206
+ }
207
+
208
+ // endregion
209
+
210
+ // Utility
211
+
212
+ private fun String?.toStrokeCap(): StrokeCap? {
213
+ return when (this?.lowercase()) {
214
+ "round" -> StrokeCap.Round
215
+ "butt" -> StrokeCap.Butt
216
+ "square" -> StrokeCap.Square
217
+ else -> null
118
218
  }
119
219
  }
@@ -2,86 +2,240 @@ package expo.modules.ui
2
2
 
3
3
  import android.annotation.SuppressLint
4
4
  import android.content.Context
5
+ import android.util.Log
6
+ import android.view.MotionEvent
5
7
  import android.view.View
6
8
  import android.view.ViewGroup
7
- import androidx.compose.foundation.rememberScrollState
8
- import androidx.compose.foundation.verticalScroll
9
+ import android.widget.FrameLayout
10
+ import androidx.compose.foundation.layout.fillMaxSize
11
+ import androidx.compose.foundation.layout.requiredSize
9
12
  import androidx.compose.runtime.Composable
13
+ import androidx.compose.runtime.DisposableEffect
10
14
  import androidx.compose.runtime.MutableState
11
15
  import androidx.compose.runtime.mutableStateOf
16
+ import androidx.compose.runtime.remember
12
17
  import androidx.compose.ui.Modifier
18
+ import androidx.compose.ui.layout.onSizeChanged
19
+ import androidx.compose.ui.platform.LocalDensity
20
+ import androidx.compose.ui.unit.IntSize
13
21
  import androidx.compose.ui.viewinterop.AndroidView
14
- import com.facebook.react.ReactRootView
22
+ import com.facebook.react.bridge.ReactContext
23
+ import com.facebook.react.common.annotations.UnstableReactNativeAPI
24
+ import com.facebook.react.config.ReactFeatureFlags
25
+ import com.facebook.react.uimanager.JSPointerDispatcher
26
+ import com.facebook.react.uimanager.JSTouchDispatcher
27
+ import com.facebook.react.uimanager.RootView
28
+ import com.facebook.react.uimanager.ThemedReactContext
29
+ import com.facebook.react.uimanager.UIManagerHelper
30
+ import com.facebook.react.uimanager.events.EventDispatcher
15
31
  import expo.modules.kotlin.AppContext
16
32
  import expo.modules.kotlin.views.ComposableScope
17
33
  import expo.modules.kotlin.views.ComposeProps
18
34
  import expo.modules.kotlin.views.ExpoComposeView
19
35
  import expo.modules.kotlin.views.RNHostViewInterface
20
- import expo.modules.kotlin.views.ShadowNodeProxy
21
- import java.lang.ref.WeakReference
22
36
 
23
- internal data class RNHostProps(
24
- val matchContents: MutableState<Boolean?> = mutableStateOf(null),
25
- val verticalScrollEnabled: MutableState<Boolean?> = mutableStateOf(null),
26
- val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList())
37
+ internal data class RNHostViewProps(
38
+ val matchContents: MutableState<Boolean?> = mutableStateOf(null)
27
39
  ) : ComposeProps
28
40
 
29
41
  @SuppressLint("ViewConstructor")
30
42
  internal class RNHostView(context: Context, appContext: AppContext) :
31
- ExpoComposeView<RNHostProps>(context, appContext), RNHostViewInterface {
32
- override val props = RNHostProps()
33
- override var matchContents: Boolean = false
34
- get() = props.matchContents.value ?: false
43
+ ExpoComposeView<RNHostViewProps>(context, appContext) {
44
+ companion object {
45
+ private const val TAG = "RNHostView"
46
+ }
47
+
48
+ override val props = RNHostViewProps()
49
+
50
+ private val childViewState = mutableStateOf<View?>(null)
51
+ private val wrapperState = mutableStateOf<TouchDispatchingRootViewGroup?>(null)
52
+
53
+ override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams) {
54
+ childViewState.value = child
55
+ val wrapper = TouchDispatchingRootViewGroup(child.context).apply {
56
+ val reactContext = child.context as? ReactContext
57
+ if (reactContext != null) {
58
+ eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, child.id)
59
+ } else {
60
+ Log.e(TAG, "RNHostView: child context is not a ReactContext, touch events will not be dispatched to JS")
61
+ }
62
+ addView(child, FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT))
63
+ }
64
+ wrapperState.value = wrapper
65
+ }
35
66
 
36
- private val container = RNHostContainerView(context, WeakReference(shadowNodeProxy))
67
+ override fun removeView(view: View) {
68
+ if (view == childViewState.value) {
69
+ wrapperState.value?.removeView(view)
70
+ childViewState.value = null
71
+ wrapperState.value = null
72
+ } else {
73
+ super.removeView(view)
74
+ }
75
+ }
76
+
77
+ override fun removeViewAt(index: Int) {
78
+ childViewState.value?.let { child ->
79
+ wrapperState.value?.removeView(child)
80
+ }
81
+ childViewState.value = null
82
+ wrapperState.value = null
83
+ }
37
84
 
38
85
  @Composable
39
86
  override fun ComposableScope.Content() {
40
- val (verticalScrollEnabled) = props.verticalScrollEnabled
41
- val (modifiers) = props.modifiers
42
-
43
- AndroidView(
44
- factory = {
45
- container
46
- },
47
- modifier = ModifierRegistry.applyModifiers(modifiers, appContext, this@Content, globalEventDispatcher)
48
- .then(if (verticalScrollEnabled == true) Modifier.verticalScroll(rememberScrollState()) else Modifier)
49
- )
87
+ val matchContents = props.matchContents.value ?: false
88
+
89
+ wrapperState.value?.let { wrapper ->
90
+ val childView = childViewState.value ?: return@let
91
+ if (matchContents) {
92
+ AndroidView(
93
+ factory = { wrapper },
94
+ modifier = applySizeFromYogaNodeModifier(childView)
95
+ )
96
+ } else {
97
+ AndroidView(
98
+ factory = { wrapper },
99
+ modifier = Modifier
100
+ .fillMaxSize()
101
+ .then(reportSizeToYogaNodeModifier())
102
+ )
103
+ }
104
+ }
50
105
  }
51
106
 
52
- override fun addView(child: View, index: Int, params: ViewGroup.LayoutParams) {
53
- container.addView(child, index, params)
107
+ // Sets Compose view size from Yoga node size
108
+ // Listens yoga node size changes and updates the Compose view size
109
+ @Composable
110
+ private fun applySizeFromYogaNodeModifier(childView: View): Modifier {
111
+ val density = LocalDensity.current
112
+
113
+ val childSize = remember {
114
+ mutableStateOf(
115
+ if (childView.width > 0 && childView.height > 0) IntSize(childView.width, childView.height)
116
+ else IntSize.Zero
117
+ )
118
+ }
119
+
120
+ DisposableEffect(childView) {
121
+ val listener = View.OnLayoutChangeListener { _, l, t, r, b, _, _, _, _ ->
122
+ childSize.value = IntSize(r - l, b - t)
123
+ }
124
+ childView.addOnLayoutChangeListener(listener)
125
+ onDispose { childView.removeOnLayoutChangeListener(listener) }
126
+ }
127
+
128
+ return with(density) {
129
+ if (childSize.value.width > 0 && childSize.value.height > 0) {
130
+ Modifier.requiredSize(
131
+ childSize.value.width.toDp(),
132
+ childSize.value.height.toDp()
133
+ )
134
+ } else {
135
+ Modifier
136
+ }
137
+ }
54
138
  }
55
139
 
56
- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
57
- super.onMeasure(widthMeasureSpec, heightMeasureSpec)
58
- container.measure(widthMeasureSpec, heightMeasureSpec)
59
- }
60
-
61
- override fun onLayout(
62
- changed: Boolean,
63
- left: Int,
64
- top: Int,
65
- right: Int,
66
- bottom: Int
67
- ) {
68
- super.onLayout(changed, left, top, right, bottom)
69
- val offsetX = paddingLeft
70
- val offsetY = paddingRight
71
- container.layout(offsetX, offsetY, offsetX + width, offsetY + height)
140
+ // Sets Yoga node size from Compose view size
141
+ // Listens Compose view size changes and updates the Yoga node size
142
+ @Composable
143
+ private fun reportSizeToYogaNodeModifier(): Modifier {
144
+ val density = LocalDensity.current
145
+ return Modifier.onSizeChanged { size ->
146
+ with(density) {
147
+ shadowNodeProxy.setViewSize(
148
+ size.width.toDp().value.toDouble(),
149
+ size.height.toDp().value.toDouble()
150
+ )
151
+ }
152
+ }
72
153
  }
73
154
  }
74
155
 
75
- internal class RNHostContainerView(context: Context, private val shadowNodeProxy: WeakReference<ShadowNodeProxy>) : ReactRootView(context) {
76
- var matchContents = false
156
+ /**
157
+ * A thin FrameLayout that intercepts touch events and dispatches them to JS via
158
+ * JSTouchDispatcher/JSPointerDispatcher, replicating the pattern from React Native's
159
+ * DialogRootViewGroup in ReactModalHostView.
160
+ */
161
+ private class TouchDispatchingRootViewGroup(
162
+ context: Context
163
+ ) : FrameLayout(context), RootView {
164
+ private val jsTouchDispatcher = JSTouchDispatcher(this)
165
+ private var jsPointerDispatcher: JSPointerDispatcher? = null
166
+
167
+ var eventDispatcher: EventDispatcher? = null
168
+
169
+ private val reactContext: ThemedReactContext
170
+ get() = context as ThemedReactContext
171
+
172
+ init {
173
+ if (ReactFeatureFlags.dispatchPointerEvents) {
174
+ jsPointerDispatcher = JSPointerDispatcher(this)
175
+ }
176
+ }
177
+
178
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
179
+ // Always gets called with EXACTLY mode
180
+ // because parent has either fillMaxSize (matchContents = false) or requiredSize (matchContents = true) modifiers
181
+ setMeasuredDimension(
182
+ MeasureSpec.getSize(widthMeasureSpec),
183
+ MeasureSpec.getSize(heightMeasureSpec)
184
+ )
185
+ }
77
186
 
78
187
  override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
79
- super.onLayout(changed, left, top, right, bottom)
80
- if (matchContents && childCount > 1) {
81
- val subview = getChildAt(0)
82
- shadowNodeProxy.get()?.setViewSize(subview.width.toDouble(), subview.height.toDouble())
83
- } else {
84
- shadowNodeProxy.get()?.setViewSize(width.toDouble(), height.toDouble())
188
+ // No-op: don't re-layout children. Yoga calls child.layout() directly
189
+ // and we must not override those values.
190
+ }
191
+
192
+ override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
193
+ eventDispatcher?.let { dispatcher ->
194
+ jsTouchDispatcher.handleTouchEvent(event, dispatcher, reactContext)
195
+ jsPointerDispatcher?.handleMotionEvent(event, dispatcher, true)
196
+ }
197
+ return super.onInterceptTouchEvent(event)
198
+ }
199
+
200
+ @SuppressLint("ClickableViewAccessibility")
201
+ override fun onTouchEvent(event: MotionEvent): Boolean {
202
+ eventDispatcher?.let { dispatcher ->
203
+ jsTouchDispatcher.handleTouchEvent(event, dispatcher, reactContext)
204
+ jsPointerDispatcher?.handleMotionEvent(event, dispatcher, false)
85
205
  }
206
+ super.onTouchEvent(event)
207
+ return true
208
+ }
209
+
210
+ override fun onInterceptHoverEvent(event: MotionEvent): Boolean {
211
+ eventDispatcher?.let { jsPointerDispatcher?.handleMotionEvent(event, it, true) }
212
+ return super.onInterceptHoverEvent(event)
213
+ }
214
+
215
+ override fun onHoverEvent(event: MotionEvent): Boolean {
216
+ eventDispatcher?.let { jsPointerDispatcher?.handleMotionEvent(event, it, false) }
217
+ return super.onHoverEvent(event)
218
+ }
219
+
220
+ @OptIn(UnstableReactNativeAPI::class)
221
+ override fun onChildStartedNativeGesture(childView: View?, ev: MotionEvent) {
222
+ eventDispatcher?.let { dispatcher ->
223
+ jsTouchDispatcher.onChildStartedNativeGesture(ev, dispatcher, reactContext)
224
+ jsPointerDispatcher?.onChildStartedNativeGesture(childView, ev, dispatcher)
225
+ }
226
+ }
227
+
228
+ override fun onChildEndedNativeGesture(childView: View, ev: MotionEvent) {
229
+ eventDispatcher?.let { jsTouchDispatcher.onChildEndedNativeGesture(ev, it) }
230
+ jsPointerDispatcher?.onChildEndedNativeGesture()
231
+ }
232
+
233
+ override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {
234
+ // No-op - override to still receive events in onInterceptTouchEvent
235
+ // even when a child view disallows interception
236
+ }
237
+
238
+ override fun handleException(t: Throwable) {
239
+ reactContext.reactApplicationContext.handleException(RuntimeException(t))
86
240
  }
87
241
  }
@@ -7,22 +7,18 @@ import expo.modules.kotlin.views.FunctionalComposableScope
7
7
 
8
8
  data class RadioButtonProps(
9
9
  val selected: Boolean = false,
10
- val nativeClickable: Boolean = true,
10
+ val clickable: Boolean = true,
11
11
  val modifiers: ModifierList = emptyList()
12
12
  ) : ComposeProps
13
13
 
14
14
  @Composable
15
15
  fun FunctionalComposableScope.RadioButtonContent(
16
16
  props: RadioButtonProps,
17
- onNativeClick: () -> Unit
17
+ onClick: (() -> Unit)?
18
18
  ) {
19
19
  RadioButton(
20
20
  selected = props.selected,
21
- onClick = if (props.nativeClickable) {
22
- { onNativeClick() }
23
- } else {
24
- null
25
- },
21
+ onClick = onClick,
26
22
  modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
27
23
  )
28
24
  }