@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.
- package/CHANGELOG.md +58 -0
- package/CONTRIBUTING.md +30 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
- package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
- package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +302 -31
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
- package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
- package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
- package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
- package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
- package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
- package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
- package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +65 -51
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +72 -14
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +247 -27
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +45 -29
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Progress/index.d.ts +78 -35
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +34 -10
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +2 -2
- package/build/jetpack-compose/Switch/index.d.ts +25 -47
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +5 -4
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
- package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers/index.d.ts +68 -4
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ControlGroup/index.d.ts +29 -0
- package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +7 -1
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/Menu/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +1 -5
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/SlotView.d.ts +5 -0
- package/build/swift-ui/SlotView.d.ts.map +1 -0
- package/build/swift-ui/Stepper/index.d.ts +3 -3
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +33 -1
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +2 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +54 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
- package/build/swift-ui/types.d.ts +7 -0
- package/build/swift-ui/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/AccessoryWidgetBackgroundView.swift +27 -0
- package/ios/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
- package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
- package/ios/ContextMenu/ContextMenu.swift +27 -22
- package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
- package/ios/ControlGroupView.swift +33 -0
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ExpoUIModule.swift +10 -32
- package/ios/GaugeView.swift +4 -26
- package/ios/HostView.swift +1 -2
- package/ios/ImageView.swift +22 -11
- package/ios/Label.swift +2 -17
- package/ios/LabeledContentView.swift +3 -27
- package/ios/ListView.swift +6 -14
- package/ios/Menu/MenuRecords.swift +0 -2
- package/ios/Menu/MenuView.swift +2 -5
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ResizableModifier.swift +24 -0
- package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
- package/ios/Modifiers/View+ModifierArray.swift +29 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
- package/ios/Modifiers/WidgetModifiers.swift +46 -0
- package/ios/Picker/PickerView.swift +8 -16
- package/ios/Popover/PopoverProps.swift +0 -4
- package/ios/Popover/PopoverView.swift +5 -11
- package/ios/ProgressView.swift +0 -5
- package/ios/RNHostView.swift +91 -10
- package/ios/SectionView.swift +9 -17
- package/ios/SecureFieldView.swift +0 -1
- package/ios/ShareLink/ShareLinkView.swift +1 -1
- package/ios/SliderView.swift +16 -31
- package/ios/SlotView.swift +38 -0
- package/ios/StepperView.swift +12 -16
- package/ios/TextFieldView.swift +0 -1
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- package/ios/UIBaseView.swift +34 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
- 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
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
- 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
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +5 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
- package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
- package/src/jetpack-compose/Button/index.tsx +69 -92
- package/src/jetpack-compose/Card/index.tsx +105 -29
- package/src/jetpack-compose/Checkbox/index.tsx +126 -0
- package/src/jetpack-compose/Chip/index.tsx +391 -51
- package/src/jetpack-compose/DatePicker/index.tsx +215 -6
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
- package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
- package/src/jetpack-compose/IconButton/index.tsx +49 -56
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Progress/index.tsx +120 -62
- package/src/jetpack-compose/RadioButton/index.tsx +8 -9
- package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Slider/index.tsx +76 -29
- package/src/jetpack-compose/Spacer/index.tsx +2 -2
- package/src/jetpack-compose/Switch/index.tsx +32 -84
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/animation.ts +37 -0
- package/src/jetpack-compose/modifiers/index.ts +86 -6
- package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
- package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
- package/src/swift-ui/ContextMenu/index.tsx +6 -20
- package/src/swift-ui/ControlGroup/index.tsx +59 -0
- package/src/swift-ui/Gauge/index.tsx +5 -20
- package/src/swift-ui/Image/index.tsx +7 -1
- package/src/swift-ui/Label/index.tsx +2 -5
- package/src/swift-ui/LabeledContent/index.tsx +3 -12
- package/src/swift-ui/Menu/index.tsx +2 -6
- package/src/swift-ui/Picker/index.tsx +4 -11
- package/src/swift-ui/Popover/index.tsx +3 -12
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Section/index.tsx +4 -9
- package/src/swift-ui/Slider/index.tsx +4 -12
- package/src/swift-ui/SlotView.tsx +8 -0
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +87 -1
- package/src/swift-ui/types.ts +5 -0
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
- package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
- package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
- package/build/jetpack-compose/Button/types.d.ts +0 -5
- package/build/jetpack-compose/Button/types.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
- package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
- package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
- package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
- package/build/jetpack-compose/Picker/index.d.ts +0 -62
- package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
- package/build/jetpack-compose/TextButton/index.d.ts +0 -29
- package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
- package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
- package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
- package/ios/Menu/MenuComponents.swift +0 -12
- package/ios/Picker/PickerComponents.swift +0 -24
- package/ios/Popover/PopoverComponents.swift +0 -18
- package/ios/SectionComponents.swift +0 -34
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
- package/src/jetpack-compose/Button/types.ts +0 -57
- package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
- package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
- package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
- package/src/jetpack-compose/FilterChip/index.tsx +0 -89
- package/src/jetpack-compose/Picker/index.tsx +0 -90
- package/src/jetpack-compose/TextButton/index.tsx +0 -55
|
@@ -12,14 +12,22 @@ import expo.modules.kotlin.viewevent.getValue
|
|
|
12
12
|
import expo.modules.ui.button.ButtonContent
|
|
13
13
|
import expo.modules.ui.button.ButtonPressedEvent
|
|
14
14
|
import expo.modules.ui.button.ButtonProps
|
|
15
|
+
import expo.modules.ui.button.ElevatedButtonContent
|
|
16
|
+
import expo.modules.ui.button.FilledTonalButtonContent
|
|
17
|
+
import expo.modules.ui.button.OutlinedButtonContent
|
|
18
|
+
import expo.modules.ui.button.TextButtonContent
|
|
19
|
+
import expo.modules.ui.button.FloatingActionButtonContent
|
|
20
|
+
import expo.modules.ui.button.FloatingActionButtonProps
|
|
15
21
|
import expo.modules.ui.button.IconButtonContent
|
|
16
|
-
import expo.modules.ui.button.
|
|
22
|
+
import expo.modules.ui.button.FilledIconButtonContent
|
|
23
|
+
import expo.modules.ui.button.FilledTonalIconButtonContent
|
|
24
|
+
import expo.modules.ui.button.OutlinedIconButtonContent
|
|
17
25
|
import expo.modules.ui.icon.IconView
|
|
18
|
-
import expo.modules.ui.menu.
|
|
19
|
-
import expo.modules.ui.menu.
|
|
20
|
-
import expo.modules.ui.menu.
|
|
21
|
-
import expo.modules.ui.menu.
|
|
22
|
-
import expo.modules.ui.menu.
|
|
26
|
+
import expo.modules.ui.menu.DropdownMenuContent
|
|
27
|
+
import expo.modules.ui.menu.DropdownMenuProps
|
|
28
|
+
import expo.modules.ui.menu.DropdownMenuItemContent
|
|
29
|
+
import expo.modules.ui.menu.DropdownMenuItemProps
|
|
30
|
+
import expo.modules.ui.menu.ItemPressedEvent
|
|
23
31
|
import okhttp3.OkHttpClient
|
|
24
32
|
|
|
25
33
|
class ExpoUIModule : Module() {
|
|
@@ -91,19 +99,41 @@ class ExpoUIModule : Module() {
|
|
|
91
99
|
ModalBottomSheetContent(props) { onDismissRequest(Unit) }
|
|
92
100
|
}
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
ExpoUIView("SingleChoiceSegmentedButtonRowView") { props: SingleChoiceSegmentedButtonRowProps ->
|
|
103
|
+
SingleChoiceSegmentedButtonRowContent(props)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
ExpoUIView("MultiChoiceSegmentedButtonRowView") { props: MultiChoiceSegmentedButtonRowProps ->
|
|
107
|
+
MultiChoiceSegmentedButtonRowContent(props)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ExpoUIView("SegmentedButtonView", events = {
|
|
111
|
+
Events("onButtonPressed", "onCheckedChange")
|
|
112
|
+
}) { props: SegmentedButtonProps ->
|
|
113
|
+
val onButtonPressed by remember { EventDispatcher<Unit>() }
|
|
114
|
+
val onCheckedChange by remember { EventDispatcher<GenericEventPayload1<Boolean>>() }
|
|
115
|
+
SegmentedButtonContent(props, { onButtonPressed(Unit) }, { onCheckedChange(it) })
|
|
100
116
|
}
|
|
101
117
|
|
|
102
118
|
ExpoUIView("SwitchView", events = {
|
|
103
|
-
Events("
|
|
119
|
+
Events("onCheckedChange")
|
|
104
120
|
}) { props: SwitchProps ->
|
|
105
|
-
val
|
|
106
|
-
SwitchContent(props) {
|
|
121
|
+
val onCheckedChange by remember { EventDispatcher<CheckedChangeEvent>() }
|
|
122
|
+
SwitchContent(props) { value -> onCheckedChange(CheckedChangeEvent(value)) }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
ExpoUIView("CheckboxView", events = {
|
|
126
|
+
Events("onCheckedChange")
|
|
127
|
+
}) { props: CheckboxProps ->
|
|
128
|
+
val onCheckedChange by remember { EventDispatcher<CheckedChangeEvent>() }
|
|
129
|
+
CheckboxContent(props) { value -> onCheckedChange(CheckedChangeEvent(value)) }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
ExpoUIView("TriStateCheckboxView", events = {
|
|
133
|
+
Events("onNativeClick")
|
|
134
|
+
}) { props: TriStateCheckboxProps ->
|
|
135
|
+
val onNativeClick by remember { EventDispatcher<Unit>() }
|
|
136
|
+
TriStateCheckboxContent(props) { onNativeClick(Unit) }
|
|
107
137
|
}
|
|
108
138
|
|
|
109
139
|
ExpoUIView("Button", events = {
|
|
@@ -113,15 +143,64 @@ class ExpoUIModule : Module() {
|
|
|
113
143
|
ButtonContent(props) { onButtonPressed(it) }
|
|
114
144
|
}
|
|
115
145
|
|
|
146
|
+
ExpoUIView("FilledTonalButton", events = {
|
|
147
|
+
Events("onButtonPressed")
|
|
148
|
+
}) { props: ButtonProps ->
|
|
149
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
150
|
+
FilledTonalButtonContent(props) { onButtonPressed(it) }
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
ExpoUIView("OutlinedButton", events = {
|
|
154
|
+
Events("onButtonPressed")
|
|
155
|
+
}) { props: ButtonProps ->
|
|
156
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
157
|
+
OutlinedButtonContent(props) { onButtonPressed(it) }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
ExpoUIView("ElevatedButton", events = {
|
|
161
|
+
Events("onButtonPressed")
|
|
162
|
+
}) { props: ButtonProps ->
|
|
163
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
164
|
+
ElevatedButtonContent(props) { onButtonPressed(it) }
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
ExpoUIView("TextButton", events = {
|
|
168
|
+
Events("onButtonPressed")
|
|
169
|
+
}) { props: ButtonProps ->
|
|
170
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
171
|
+
TextButtonContent(props) { onButtonPressed(it) }
|
|
172
|
+
}
|
|
173
|
+
|
|
116
174
|
ExpoUIView("IconButton", events = {
|
|
117
175
|
Events("onButtonPressed")
|
|
118
|
-
}) { props:
|
|
176
|
+
}) { props: ButtonProps ->
|
|
119
177
|
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
120
178
|
IconButtonContent(props) { onButtonPressed(it) }
|
|
121
179
|
}
|
|
122
180
|
|
|
181
|
+
ExpoUIView("FilledIconButton", events = {
|
|
182
|
+
Events("onButtonPressed")
|
|
183
|
+
}) { props: ButtonProps ->
|
|
184
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
185
|
+
FilledIconButtonContent(props) { onButtonPressed(it) }
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
ExpoUIView("FilledTonalIconButton", events = {
|
|
189
|
+
Events("onButtonPressed")
|
|
190
|
+
}) { props: ButtonProps ->
|
|
191
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
192
|
+
FilledTonalIconButtonContent(props) { onButtonPressed(it) }
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
ExpoUIView("OutlinedIconButton", events = {
|
|
196
|
+
Events("onButtonPressed")
|
|
197
|
+
}) { props: ButtonProps ->
|
|
198
|
+
val onButtonPressed by remember { EventDispatcher<ButtonPressedEvent>() }
|
|
199
|
+
OutlinedIconButtonContent(props) { onButtonPressed(it) }
|
|
200
|
+
}
|
|
201
|
+
|
|
123
202
|
ExpoUIView("SliderView", events = {
|
|
124
|
-
Events("
|
|
203
|
+
Events("onValueChange", "onValueChangeFinished")
|
|
125
204
|
}) { props: SliderProps ->
|
|
126
205
|
SliderContent(props)
|
|
127
206
|
}
|
|
@@ -141,26 +220,50 @@ class ExpoUIModule : Module() {
|
|
|
141
220
|
DateTimePickerContent(props) { onDateSelected(it) }
|
|
142
221
|
}
|
|
143
222
|
|
|
144
|
-
ExpoUIView("
|
|
145
|
-
Events(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)
|
|
150
|
-
}) { props: ContextMenuProps ->
|
|
151
|
-
val onContextMenuButtonPressed by remember { EventDispatcher<ContextMenuButtonPressedEvent>() }
|
|
152
|
-
val onContextMenuSwitchValueChanged by remember { EventDispatcher<ContextMenuSwitchValueChangeEvent>() }
|
|
153
|
-
val onExpandedChanged by remember { EventDispatcher<ExpandedChangedEvent>() }
|
|
154
|
-
ContextMenuContent(
|
|
155
|
-
props,
|
|
156
|
-
{ onContextMenuButtonPressed(it) },
|
|
157
|
-
{ onContextMenuSwitchValueChanged(it) },
|
|
158
|
-
{ onExpandedChanged(it) }
|
|
159
|
-
)
|
|
223
|
+
ExpoUIView("DatePickerDialogView", events = {
|
|
224
|
+
Events("onDateSelected", "onDismissRequest")
|
|
225
|
+
}) { props: DatePickerDialogProps ->
|
|
226
|
+
val onDateSelected by remember { EventDispatcher<DatePickerResult>() }
|
|
227
|
+
val onDismissRequest by remember { EventDispatcher<Unit>() }
|
|
228
|
+
ExpoDatePickerDialogContent(props, { onDateSelected(it) }, { onDismissRequest(Unit) })
|
|
160
229
|
}
|
|
161
230
|
|
|
162
|
-
ExpoUIView("
|
|
163
|
-
|
|
231
|
+
ExpoUIView("TimePickerDialogView", events = {
|
|
232
|
+
Events("onDateSelected", "onDismissRequest")
|
|
233
|
+
}) { props: TimePickerDialogProps ->
|
|
234
|
+
val onDateSelected by remember { EventDispatcher<DatePickerResult>() }
|
|
235
|
+
val onDismissRequest by remember { EventDispatcher<Unit>() }
|
|
236
|
+
ExpoTimePickerDialogContent(props, { onDateSelected(it) }, { onDismissRequest(Unit) })
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
ExpoUIView("DropdownMenuView", events = {
|
|
240
|
+
Events("onDismissRequest")
|
|
241
|
+
}) { props: DropdownMenuProps ->
|
|
242
|
+
val onDismissRequest by remember { EventDispatcher<Unit>() }
|
|
243
|
+
DropdownMenuContent(props) { onDismissRequest(Unit) }
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
ExpoUIView("DropdownMenuItemView", events = {
|
|
247
|
+
Events("onItemPressed")
|
|
248
|
+
}) { props: DropdownMenuItemProps ->
|
|
249
|
+
val onItemPressed by remember { EventDispatcher<ItemPressedEvent>() }
|
|
250
|
+
DropdownMenuItemContent(props) { onItemPressed(it) }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
ExpoUIView("LinearProgressIndicatorView") { props: LinearProgressIndicatorProps ->
|
|
254
|
+
LinearProgressIndicatorContent(props)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
ExpoUIView("CircularProgressIndicatorView") { props: CircularProgressIndicatorProps ->
|
|
258
|
+
CircularProgressIndicatorContent(props)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
ExpoUIView("LinearWavyProgressIndicatorView") { props: LinearWavyProgressIndicatorProps ->
|
|
262
|
+
LinearWavyProgressIndicatorContent(props)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
ExpoUIView("CircularWavyProgressIndicatorView") { props: CircularWavyProgressIndicatorProps ->
|
|
266
|
+
CircularWavyProgressIndicatorContent(props)
|
|
164
267
|
}
|
|
165
268
|
|
|
166
269
|
ExpoUIView("BoxView") { props: LayoutProps ->
|
|
@@ -227,42 +330,74 @@ class ExpoUIModule : Module() {
|
|
|
227
330
|
)
|
|
228
331
|
}
|
|
229
332
|
|
|
230
|
-
ExpoUIView("
|
|
231
|
-
Events(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
333
|
+
ExpoUIView("AssistChipView", events = {
|
|
334
|
+
Events("onNativeClick")
|
|
335
|
+
}) { props: AssistChipProps ->
|
|
336
|
+
val onNativeClick by remember { EventDispatcher<ChipPressedEvent>() }
|
|
337
|
+
AssistChipContent(props) { onNativeClick(it) }
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
ExpoUIView("InputChipView", events = {
|
|
341
|
+
Events("onNativeClick")
|
|
342
|
+
}) { props: InputChipProps ->
|
|
343
|
+
val onNativeClick by remember { EventDispatcher<ChipPressedEvent>() }
|
|
344
|
+
InputChipContent(props) { onNativeClick(it) }
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
ExpoUIView("SuggestionChipView", events = {
|
|
348
|
+
Events("onNativeClick")
|
|
349
|
+
}) { props: SuggestionChipProps ->
|
|
350
|
+
val onNativeClick by remember { EventDispatcher<ChipPressedEvent>() }
|
|
351
|
+
SuggestionChipContent(props) { onNativeClick(it) }
|
|
239
352
|
}
|
|
240
353
|
|
|
241
354
|
ExpoUIView("FilterChipView", events = {
|
|
242
|
-
Events("
|
|
355
|
+
Events("onNativeClick")
|
|
243
356
|
}) { props: FilterChipProps ->
|
|
244
|
-
val
|
|
245
|
-
FilterChipContent(props) {
|
|
357
|
+
val onNativeClick by remember { EventDispatcher<ChipPressedEvent>() }
|
|
358
|
+
FilterChipContent(props) { onNativeClick(it) }
|
|
246
359
|
}
|
|
247
360
|
|
|
248
|
-
ExpoUIView("
|
|
249
|
-
Events("
|
|
250
|
-
}) { props:
|
|
251
|
-
val
|
|
252
|
-
|
|
361
|
+
ExpoUIView("ToggleButton", events = {
|
|
362
|
+
Events("onCheckedChange")
|
|
363
|
+
}) { props: ToggleButtonProps ->
|
|
364
|
+
val onCheckedChange by remember { EventDispatcher<ToggleButtonValueChangeEvent>() }
|
|
365
|
+
ToggleButtonContent(props) { onCheckedChange(it) }
|
|
253
366
|
}
|
|
254
367
|
|
|
255
|
-
ExpoUIView("
|
|
368
|
+
ExpoUIView("IconToggleButton", events = {
|
|
256
369
|
Events("onCheckedChange")
|
|
257
370
|
}) { props: ToggleButtonProps ->
|
|
258
371
|
val onCheckedChange by remember { EventDispatcher<ToggleButtonValueChangeEvent>() }
|
|
259
|
-
|
|
372
|
+
IconToggleButtonContent(props) { onCheckedChange(it) }
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
ExpoUIView("FilledIconToggleButton", events = {
|
|
376
|
+
Events("onCheckedChange")
|
|
377
|
+
}) { props: ToggleButtonProps ->
|
|
378
|
+
val onCheckedChange by remember { EventDispatcher<ToggleButtonValueChangeEvent>() }
|
|
379
|
+
FilledIconToggleButtonContent(props) { onCheckedChange(it) }
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
ExpoUIView("OutlinedIconToggleButton", events = {
|
|
383
|
+
Events("onCheckedChange")
|
|
384
|
+
}) { props: ToggleButtonProps ->
|
|
385
|
+
val onCheckedChange by remember { EventDispatcher<ToggleButtonValueChangeEvent>() }
|
|
386
|
+
OutlinedIconToggleButtonContent(props) { onCheckedChange(it) }
|
|
260
387
|
}
|
|
261
388
|
|
|
262
389
|
ExpoUIView("CardView") { props: CardProps ->
|
|
263
390
|
CardContent(props)
|
|
264
391
|
}
|
|
265
392
|
|
|
393
|
+
ExpoUIView("ElevatedCardView") { props: ElevatedCardProps ->
|
|
394
|
+
ElevatedCardContent(props)
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
ExpoUIView("OutlinedCardView") { props: OutlinedCardProps ->
|
|
398
|
+
OutlinedCardContent(props)
|
|
399
|
+
}
|
|
400
|
+
|
|
266
401
|
ExpoUIView("ListItemView") { props: ListItemProps ->
|
|
267
402
|
ListItemContent(props)
|
|
268
403
|
}
|
|
@@ -282,11 +417,23 @@ class ExpoUIModule : Module() {
|
|
|
282
417
|
SurfaceContent(props)
|
|
283
418
|
}
|
|
284
419
|
|
|
420
|
+
ExpoUIView("AnimatedVisibilityView") { props: AnimatedVisibilityProps ->
|
|
421
|
+
AnimatedVisibilityContent(props)
|
|
422
|
+
}
|
|
423
|
+
|
|
285
424
|
ExpoUIView("RadioButtonView", events = {
|
|
286
|
-
Events("
|
|
425
|
+
Events("onButtonPressed")
|
|
287
426
|
}) { props: RadioButtonProps ->
|
|
288
|
-
val
|
|
289
|
-
|
|
427
|
+
val onButtonPressed by remember { EventDispatcher<Unit>() }
|
|
428
|
+
val clickHandler = if (props.clickable) { { onButtonPressed(Unit) } } else null
|
|
429
|
+
RadioButtonContent(props, clickHandler)
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
ExpoUIView("FloatingActionButtonView", events = {
|
|
433
|
+
Events("onButtonPressed")
|
|
434
|
+
}) { props: FloatingActionButtonProps ->
|
|
435
|
+
val onButtonPressed by remember { EventDispatcher<Unit>() }
|
|
436
|
+
FloatingActionButtonContent(props) { onButtonPressed(Unit) }
|
|
290
437
|
}
|
|
291
438
|
|
|
292
439
|
//endregion Expo UI views
|
|
@@ -51,13 +51,26 @@ fun FunctionalComposableScope.HorizontalFloatingToolbarContent(props: Horizontal
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
val scrollBehavior = composableScope.nestedScrollConnection as? FloatingToolbarScrollBehavior
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
55
|
+
|
|
56
|
+
if (fabSlotView != null) {
|
|
57
|
+
HorizontalFloatingToolbar(
|
|
58
|
+
expanded = true,
|
|
59
|
+
floatingActionButton = floatingActionButton,
|
|
60
|
+
colors = colors,
|
|
61
|
+
scrollBehavior = scrollBehavior,
|
|
62
|
+
modifier = modifier,
|
|
63
|
+
) {
|
|
64
|
+
Children(ComposableScope(), filter = { !isSlotView(it) })
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
HorizontalFloatingToolbar(
|
|
68
|
+
expanded = true,
|
|
69
|
+
colors = colors,
|
|
70
|
+
scrollBehavior = scrollBehavior,
|
|
71
|
+
modifier = modifier,
|
|
72
|
+
) {
|
|
73
|
+
Children(ComposableScope(), filter = { !isSlotView(it) })
|
|
74
|
+
}
|
|
62
75
|
}
|
|
63
76
|
}
|
|
@@ -21,20 +21,29 @@ import androidx.compose.foundation.layout.width
|
|
|
21
21
|
import androidx.compose.foundation.layout.wrapContentHeight
|
|
22
22
|
import androidx.compose.foundation.layout.wrapContentWidth
|
|
23
23
|
import androidx.compose.foundation.selection.selectable
|
|
24
|
+
import androidx.compose.foundation.selection.selectableGroup
|
|
25
|
+
import androidx.compose.foundation.selection.toggleable
|
|
26
|
+
import androidx.compose.ui.semantics.Role
|
|
24
27
|
import androidx.compose.foundation.shape.CircleShape
|
|
25
28
|
import androidx.compose.foundation.shape.CutCornerShape
|
|
26
29
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
27
30
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
28
31
|
import androidx.compose.material3.toShape
|
|
29
32
|
import androidx.compose.runtime.Composable
|
|
33
|
+
import expo.modules.ui.convertibles.resolveAnimatable
|
|
30
34
|
import androidx.compose.ui.Modifier
|
|
31
35
|
import androidx.compose.ui.draw.alpha
|
|
32
36
|
import androidx.compose.ui.draw.blur
|
|
33
37
|
import androidx.compose.ui.draw.clip
|
|
34
38
|
import androidx.compose.ui.draw.rotate
|
|
35
39
|
import androidx.compose.ui.draw.shadow
|
|
40
|
+
import androidx.compose.ui.graphics.CompositingStrategy
|
|
36
41
|
import androidx.compose.ui.graphics.RectangleShape
|
|
42
|
+
import androidx.compose.ui.graphics.Shape
|
|
43
|
+
import androidx.compose.ui.graphics.TransformOrigin
|
|
44
|
+
import androidx.compose.ui.graphics.graphicsLayer
|
|
37
45
|
import androidx.compose.ui.unit.dp
|
|
46
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
38
47
|
import androidx.compose.ui.zIndex
|
|
39
48
|
import expo.modules.kotlin.AppContext
|
|
40
49
|
import expo.modules.kotlin.records.Field
|
|
@@ -43,6 +52,8 @@ import expo.modules.kotlin.records.recordFromMap
|
|
|
43
52
|
import expo.modules.kotlin.types.Enumerable
|
|
44
53
|
import expo.modules.kotlin.views.ComposableScope
|
|
45
54
|
import expo.modules.ui.convertibles.AlignmentType
|
|
55
|
+
import expo.modules.ui.convertibles.CompositingStrategyType
|
|
56
|
+
import expo.modules.ui.convertibles.GraphicsLayerParams
|
|
46
57
|
|
|
47
58
|
typealias ModifierType = Map<String, Any?>
|
|
48
59
|
typealias ModifierList = List<ModifierType>
|
|
@@ -169,7 +180,24 @@ internal data class ClipParams(
|
|
|
169
180
|
) : Record
|
|
170
181
|
|
|
171
182
|
internal data class SelectableParams(
|
|
172
|
-
@Field val selected: Boolean = false
|
|
183
|
+
@Field val selected: Boolean = false,
|
|
184
|
+
@Field val role: String? = null
|
|
185
|
+
) : Record
|
|
186
|
+
|
|
187
|
+
internal data class ClickableParams(
|
|
188
|
+
@Field val indication: Boolean = true
|
|
189
|
+
) : Record
|
|
190
|
+
|
|
191
|
+
internal enum class SemanticRoleType(val value: String) : Enumerable {
|
|
192
|
+
CHECKBOX("checkbox"),
|
|
193
|
+
RADIO_BUTTON("radioButton"),
|
|
194
|
+
SWITCH("switch"),
|
|
195
|
+
TAB("tab")
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
internal data class ToggleableParams(
|
|
199
|
+
@Field val value: Boolean = false,
|
|
200
|
+
@Field val role: SemanticRoleType? = null
|
|
173
201
|
) : Record
|
|
174
202
|
|
|
175
203
|
// endregion
|
|
@@ -191,6 +219,43 @@ object ModifierRegistry {
|
|
|
191
219
|
|
|
192
220
|
private val modifierFactories: MutableMap<String, ModifierFactory> = mutableMapOf()
|
|
193
221
|
|
|
222
|
+
@Composable
|
|
223
|
+
private fun resolveShape(shape: BuiltinShapeRecord): Shape? {
|
|
224
|
+
return when (shape.type) {
|
|
225
|
+
BuiltinShapeType.RECTANGLE -> RectangleShape
|
|
226
|
+
BuiltinShapeType.CIRCLE -> CircleShape
|
|
227
|
+
BuiltinShapeType.ROUNDED_CORNER -> {
|
|
228
|
+
val hasPerCorner = shape.topStart != null || shape.topEnd != null || shape.bottomStart != null || shape.bottomEnd != null
|
|
229
|
+
if (hasPerCorner) {
|
|
230
|
+
RoundedCornerShape(
|
|
231
|
+
topStart = (shape.topStart ?: 0f).dp,
|
|
232
|
+
topEnd = (shape.topEnd ?: 0f).dp,
|
|
233
|
+
bottomStart = (shape.bottomStart ?: 0f).dp,
|
|
234
|
+
bottomEnd = (shape.bottomEnd ?: 0f).dp
|
|
235
|
+
)
|
|
236
|
+
} else {
|
|
237
|
+
RoundedCornerShape((shape.radius ?: 0f).dp)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
BuiltinShapeType.CUT_CORNER -> {
|
|
241
|
+
val hasPerCorner = shape.topStart != null || shape.topEnd != null || shape.bottomStart != null || shape.bottomEnd != null
|
|
242
|
+
if (hasPerCorner) {
|
|
243
|
+
CutCornerShape(
|
|
244
|
+
topStart = (shape.topStart ?: 0f).dp,
|
|
245
|
+
topEnd = (shape.topEnd ?: 0f).dp,
|
|
246
|
+
bottomStart = (shape.bottomStart ?: 0f).dp,
|
|
247
|
+
bottomEnd = (shape.bottomEnd ?: 0f).dp
|
|
248
|
+
)
|
|
249
|
+
} else {
|
|
250
|
+
CutCornerShape((shape.radius ?: 0f).dp)
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
BuiltinShapeType.MATERIAL -> {
|
|
254
|
+
shape.name?.toRoundedPolygon()?.toShape()
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
194
259
|
init {
|
|
195
260
|
registerBuiltInModifiers()
|
|
196
261
|
}
|
|
@@ -342,6 +407,48 @@ object ModifierRegistry {
|
|
|
342
407
|
Modifier.rotate(params.degrees)
|
|
343
408
|
}
|
|
344
409
|
|
|
410
|
+
register("graphicsLayer") { map, _, _, _ ->
|
|
411
|
+
val rotationX = resolveAnimatable(map, "rotationX", 0f)
|
|
412
|
+
val rotationY = resolveAnimatable(map, "rotationY", 0f)
|
|
413
|
+
val rotationZ = resolveAnimatable(map, "rotationZ", 0f)
|
|
414
|
+
val scaleX = resolveAnimatable(map, "scaleX", 1f)
|
|
415
|
+
val scaleY = resolveAnimatable(map, "scaleY", 1f)
|
|
416
|
+
val alphaVal = resolveAnimatable(map, "alpha", 1f)
|
|
417
|
+
val translationX = resolveAnimatable(map, "translationX", 0f)
|
|
418
|
+
val translationY = resolveAnimatable(map, "translationY", 0f)
|
|
419
|
+
val shadowElevation = resolveAnimatable(map, "shadowElevation", 0f)
|
|
420
|
+
|
|
421
|
+
// Non-animatable params parsed via Record
|
|
422
|
+
val params = recordFromMap<GraphicsLayerParams>(map)
|
|
423
|
+
val composeShape = params.shape?.let { resolveShape(it) } ?: RectangleShape
|
|
424
|
+
val compositingStrategy = when (params.compositingStrategy) {
|
|
425
|
+
CompositingStrategyType.OFFSCREEN -> CompositingStrategy.Offscreen
|
|
426
|
+
CompositingStrategyType.MODULATE -> CompositingStrategy.ModulateAlpha
|
|
427
|
+
else -> CompositingStrategy.Auto
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
val density = LocalDensity.current.density
|
|
431
|
+
|
|
432
|
+
Modifier.graphicsLayer {
|
|
433
|
+
this.rotationX = rotationX
|
|
434
|
+
this.rotationY = rotationY
|
|
435
|
+
this.rotationZ = rotationZ
|
|
436
|
+
this.scaleX = scaleX
|
|
437
|
+
this.scaleY = scaleY
|
|
438
|
+
this.alpha = alphaVal
|
|
439
|
+
this.translationX = translationX * density
|
|
440
|
+
this.translationY = translationY * density
|
|
441
|
+
this.cameraDistance = params.cameraDistance * density
|
|
442
|
+
this.shadowElevation = shadowElevation * density
|
|
443
|
+
this.transformOrigin = TransformOrigin(params.transformOriginX, params.transformOriginY)
|
|
444
|
+
this.clip = params.clip
|
|
445
|
+
this.shape = composeShape
|
|
446
|
+
this.compositingStrategy = compositingStrategy
|
|
447
|
+
params.ambientShadowColor?.let { this.ambientShadowColor = it.compose }
|
|
448
|
+
params.spotShadowColor?.let { this.spotShadowColor = it.compose }
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
345
452
|
register("zIndex") { map, _, _, _ ->
|
|
346
453
|
val params = recordFromMap<ZIndexParams>(map)
|
|
347
454
|
Modifier.zIndex(params.index)
|
|
@@ -393,48 +500,23 @@ object ModifierRegistry {
|
|
|
393
500
|
register("clip") { map, _, _, _ ->
|
|
394
501
|
val params = recordFromMap<ClipParams>(map)
|
|
395
502
|
params.shape?.let { shape ->
|
|
396
|
-
|
|
397
|
-
BuiltinShapeType.RECTANGLE -> RectangleShape
|
|
398
|
-
BuiltinShapeType.CIRCLE -> CircleShape
|
|
399
|
-
BuiltinShapeType.ROUNDED_CORNER -> {
|
|
400
|
-
val hasPerCorner = shape.topStart != null || shape.topEnd != null || shape.bottomStart != null || shape.bottomEnd != null
|
|
401
|
-
if (hasPerCorner) {
|
|
402
|
-
RoundedCornerShape(
|
|
403
|
-
topStart = (shape.topStart ?: 0f).dp,
|
|
404
|
-
topEnd = (shape.topEnd ?: 0f).dp,
|
|
405
|
-
bottomStart = (shape.bottomStart ?: 0f).dp,
|
|
406
|
-
bottomEnd = (shape.bottomEnd ?: 0f).dp
|
|
407
|
-
)
|
|
408
|
-
} else {
|
|
409
|
-
RoundedCornerShape((shape.radius ?: 0f).dp)
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
BuiltinShapeType.CUT_CORNER -> {
|
|
413
|
-
val hasPerCorner = shape.topStart != null || shape.topEnd != null || shape.bottomStart != null || shape.bottomEnd != null
|
|
414
|
-
if (hasPerCorner) {
|
|
415
|
-
CutCornerShape(
|
|
416
|
-
topStart = (shape.topStart ?: 0f).dp,
|
|
417
|
-
topEnd = (shape.topEnd ?: 0f).dp,
|
|
418
|
-
bottomStart = (shape.bottomStart ?: 0f).dp,
|
|
419
|
-
bottomEnd = (shape.bottomEnd ?: 0f).dp
|
|
420
|
-
)
|
|
421
|
-
} else {
|
|
422
|
-
CutCornerShape((shape.radius ?: 0f).dp)
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
BuiltinShapeType.MATERIAL -> {
|
|
426
|
-
shape.name?.toRoundedPolygon()?.toShape()
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
composeShape?.let {
|
|
430
|
-
Modifier.clip(it)
|
|
431
|
-
}
|
|
503
|
+
resolveShape(shape)?.let { Modifier.clip(it) }
|
|
432
504
|
} ?: Modifier
|
|
433
505
|
}
|
|
434
506
|
|
|
435
|
-
register("clickable") {
|
|
436
|
-
|
|
437
|
-
|
|
507
|
+
register("clickable") { map, _, _, eventDispatcher ->
|
|
508
|
+
val params = recordFromMap<ClickableParams>(map)
|
|
509
|
+
if (params.indication) {
|
|
510
|
+
Modifier.clickable {
|
|
511
|
+
eventDispatcher("clickable", emptyMap())
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
Modifier.clickable(
|
|
515
|
+
interactionSource = null,
|
|
516
|
+
indication = null
|
|
517
|
+
) {
|
|
518
|
+
eventDispatcher("clickable", emptyMap())
|
|
519
|
+
}
|
|
438
520
|
}
|
|
439
521
|
}
|
|
440
522
|
|
|
@@ -442,8 +524,35 @@ object ModifierRegistry {
|
|
|
442
524
|
val params = recordFromMap<SelectableParams>(map)
|
|
443
525
|
Modifier.selectable(
|
|
444
526
|
selected = params.selected,
|
|
527
|
+
role = when (params.role) {
|
|
528
|
+
"radioButton" -> androidx.compose.ui.semantics.Role.RadioButton
|
|
529
|
+
"checkbox" -> androidx.compose.ui.semantics.Role.Checkbox
|
|
530
|
+
"switch" -> androidx.compose.ui.semantics.Role.Switch
|
|
531
|
+
"tab" -> androidx.compose.ui.semantics.Role.Tab
|
|
532
|
+
else -> null
|
|
533
|
+
},
|
|
445
534
|
onClick = { eventDispatcher("selectable", emptyMap()) }
|
|
446
535
|
)
|
|
447
536
|
}
|
|
537
|
+
|
|
538
|
+
register("selectableGroup") { _, _, _, _ ->
|
|
539
|
+
Modifier.selectableGroup()
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
register("toggleable") { map, _, _, eventDispatcher ->
|
|
543
|
+
val params = recordFromMap<ToggleableParams>(map)
|
|
544
|
+
val role = when (params.role) {
|
|
545
|
+
SemanticRoleType.CHECKBOX -> Role.Checkbox
|
|
546
|
+
SemanticRoleType.RADIO_BUTTON -> Role.RadioButton
|
|
547
|
+
SemanticRoleType.SWITCH -> Role.Switch
|
|
548
|
+
SemanticRoleType.TAB -> Role.Tab
|
|
549
|
+
null -> null
|
|
550
|
+
}
|
|
551
|
+
Modifier.toggleable(
|
|
552
|
+
value = params.value,
|
|
553
|
+
role = role,
|
|
554
|
+
onValueChange = { eventDispatcher("toggleable", emptyMap()) }
|
|
555
|
+
)
|
|
556
|
+
}
|
|
448
557
|
}
|
|
449
558
|
}
|