react-native-ui-lib 8.1.1 → 8.1.5
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/lib/android/build.gradle +32 -0
- package/lib/android/src/main/AndroidManifest.xml +4 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java +139 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java +33 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.java +50 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java +167 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +131 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/UiUtils.java +50 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java +52 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java +213 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java +39 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.java +29 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.java +29 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java +34 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java +49 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java +16 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java +83 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.java +163 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.java +5 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +33 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.java +65 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/utils/LogForwarder.java +45 -0
- package/lib/android/src/main/res/layout/wheel_picker.xml +9 -0
- package/lib/android/src/main/res/values/colors.xml +9 -0
- package/lib/android/src/main/res/values/styles.xml +9 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/keyboardRegistry.api.json +50 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/keyboardAccessoryView.api.json +58 -0
- package/lib/components/Keyboard/KeyboardAwareInsetsView/keyboardAwareInsetsView.api.json +14 -0
- package/lib/components/Keyboard/KeyboardTrackingView/keyboardTrackingView.api.json +86 -0
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.h +9 -0
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.m +115 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.h +19 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.m +216 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.h +6 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.m +28 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.h +39 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.m +160 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h +36 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m +121 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.h +48 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.m +27 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolation.h +16 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.h +19 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.mm +155 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h +16 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +450 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +18 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +99 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.h +14 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +827 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.h +44 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +171 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.h +6 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.m +17 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.h +6 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.m +105 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.h +5 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.m +20 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.h +7 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.m +76 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.h +9 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.m +14 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.h +5 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.m +26 -0
- package/lib/specs/HighlighterViewNativeComponent.ts +78 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.ts +74 -0
- package/package.json +2 -25
- package/src/assets/Assets.d.ts +5 -0
- package/src/assets/emojis/index.d.ts +1343 -0
- package/src/assets/index.d.ts +3 -0
- package/src/assets/internal/index.d.ts +4 -0
- package/src/commons/Config.d.ts +24 -0
- package/src/commons/Constants.d.ts +54 -0
- package/src/commons/UIComponent.d.ts +4 -0
- package/src/commons/asBaseComponent.d.ts +15 -0
- package/src/commons/baseComponent.d.ts +2 -0
- package/src/commons/forwardRef.d.ts +8 -0
- package/src/commons/modifiers.d.ts +118 -0
- package/src/commons/new.d.ts +8 -0
- package/src/commons/withScrollEnabler.d.ts +13 -0
- package/src/commons/withScrollReached.d.ts +35 -0
- package/src/components/WheelPicker/Item.d.ts +28 -0
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +18 -0
- package/src/components/WheelPicker/WheelPickerItem.driver.d.ts +8 -0
- package/src/components/WheelPicker/helpers/useListMiddleIndex.d.ts +6 -0
- package/src/components/WheelPicker/index.d.ts +88 -0
- package/src/components/WheelPicker/types.d.ts +6 -0
- package/src/components/WheelPicker/usePresenter.d.ts +21 -0
- package/src/components/actionBar/index.d.ts +35 -0
- package/src/components/actionSheet/index.d.ts +80 -0
- package/src/components/animatedImage/index.d.ts +28 -0
- package/src/components/avatar/index.d.ts +382 -0
- package/src/components/badge/index.d.ts +879 -0
- package/src/components/baseInput/Validators.d.ts +8 -0
- package/src/components/baseInput/index.d.ts +29 -0
- package/src/components/button/Button.driver.new.d.ts +34 -0
- package/src/components/button/ButtonConstants.d.ts +26 -0
- package/src/components/button/index.d.ts +573 -0
- package/src/components/button/types.d.ts +157 -0
- package/src/components/card/CardContext.d.ts +3 -0
- package/src/components/card/CardImage.d.ts +20 -0
- package/src/components/card/CardPresenter.d.ts +12 -0
- package/src/components/card/CardSection.d.ts +79 -0
- package/src/components/card/asCardChild.d.ts +6 -0
- package/src/components/card/index.d.ts +120 -0
- package/src/components/carousel/Carousel.driver.new.d.ts +9 -0
- package/src/components/carousel/CarouselPresenter.d.ts +9 -0
- package/src/components/carousel/index.d.ts +73 -0
- package/src/components/carousel/types.d.ts +107 -0
- package/src/components/checkbox/Checkbox.driver.d.ts +15 -0
- package/src/components/checkbox/index.d.ts +129 -0
- package/src/components/chip/chip.driver.d.ts +33 -0
- package/src/components/chip/index.d.ts +209 -0
- package/src/components/chipsInput/index.d.ts +55 -0
- package/src/components/colorPalette/index.d.ts +116 -0
- package/src/components/colorPicker/ColorPickerDialog.d.ts +39 -0
- package/src/components/colorPicker/ColorPickerDialogHeader.d.ts +9 -0
- package/src/components/colorPicker/ColorPickerDialogSliders.d.ts +10 -0
- package/src/components/colorPicker/ColorPickerPresenter.d.ts +16 -0
- package/src/components/colorPicker/ColorPickerPreview.d.ts +12 -0
- package/src/components/colorPicker/index.d.ts +45 -0
- package/src/components/colorSwatch/index.d.ts +50 -0
- package/src/components/connectionStatusBar/index.d.ts +33 -0
- package/src/components/connectionStatusBar/types.d.ts +28 -0
- package/src/components/dash/index.d.ts +19 -0
- package/src/components/dateTimePicker/DateTimePicker.driver.d.ts +7 -0
- package/src/components/dateTimePicker/index.d.ts +288 -0
- package/src/components/dateTimePicker/useOldApi.d.ts +27 -0
- package/src/components/dialog/Dialog.driver.new.d.ts +6 -0
- package/src/components/dialog/DialogHeader.d.ts +4 -0
- package/src/components/dialog/index.d.ts +15 -0
- package/src/components/dialog/types.d.ts +138 -0
- package/src/components/dialog/useDialogContent.d.ts +13 -0
- package/src/components/drawer/Swipeable.d.ts +94 -0
- package/src/components/drawer/index.d.ts +161 -0
- package/src/components/expandableSection/index.d.ts +40 -0
- package/src/components/fadedScrollView/index.d.ts +59 -0
- package/src/components/fader/index.d.ts +37 -0
- package/src/components/featureHighlight/index.d.ts +147 -0
- package/src/components/floatingButton/index.d.ts +89 -0
- package/src/components/gradient/index.d.ts +19 -0
- package/src/components/gridList/index.d.ts +5 -0
- package/src/components/gridList/types.d.ts +29 -0
- package/src/components/gridList/useGridLayout.d.ts +15 -0
- package/src/components/gridListItem/index.d.ts +132 -0
- package/src/components/gridView/index.d.ts +80 -0
- package/src/components/hint/Hint.driver.d.ts +6 -0
- package/src/components/hint/Hint.driver.new.d.ts +19 -0
- package/src/components/hint/HintAnchor.d.ts +13 -0
- package/src/components/hint/HintBubble.d.ts +12 -0
- package/src/components/hint/HintMockChildren.d.ts +8 -0
- package/src/components/hint/HintOld.d.ts +196 -0
- package/src/components/hint/hooks/useHintAccessibility.d.ts +10 -0
- package/src/components/hint/hooks/useHintLayout.d.ts +13 -0
- package/src/components/hint/hooks/useHintPosition.d.ts +29 -0
- package/src/components/hint/hooks/useHintVisibility.d.ts +6 -0
- package/src/components/hint/index.d.ts +14 -0
- package/src/components/hint/types.d.ts +106 -0
- package/src/components/icon/index.d.ts +97 -0
- package/src/components/image/Image.driver.d.ts +4 -0
- package/src/components/image/Image.driver.new.d.ts +2 -0
- package/src/components/image/index.d.ts +192 -0
- package/src/components/listItem/ListItemPart.d.ts +15 -0
- package/src/components/listItem/index.d.ts +52 -0
- package/src/components/listItem/types.d.ts +60 -0
- package/src/components/loaderScreen/index.d.ts +13 -0
- package/src/components/loaderScreen/types.d.ts +32 -0
- package/src/components/marquee/index.d.ts +5 -0
- package/src/components/marquee/types.d.ts +35 -0
- package/src/components/maskedInput/index.d.ts +5 -0
- package/src/components/maskedInput/new.d.ts +22 -0
- package/src/components/modal/Modal.driver.new.d.ts +8 -0
- package/src/components/modal/TopBar.d.ts +89 -0
- package/src/components/modal/index.d.ts +64 -0
- package/src/components/numberInput/NumberInput.driver.d.ts +6 -0
- package/src/components/numberInput/Presenter.d.ts +21 -0
- package/src/components/numberInput/index.d.ts +57 -0
- package/src/components/overlay/index.d.ts +68 -0
- package/src/components/pageControl/index.d.ts +56 -0
- package/src/components/panView/index.d.ts +21 -0
- package/src/components/panView/panningUtil.d.ts +38 -0
- package/src/components/panView/usePanGesture.d.ts +49 -0
- package/src/components/picker/Picker.driver.new.d.ts +44 -0
- package/src/components/picker/PickerContext.d.ts +4 -0
- package/src/components/picker/PickerItem.d.ts +11 -0
- package/src/components/picker/PickerItemsList.d.ts +4 -0
- package/src/components/picker/PickerPresenter.d.ts +7 -0
- package/src/components/picker/PickerSelectionStatusBar.d.ts +3 -0
- package/src/components/picker/helpers/useFieldType.d.ts +373 -0
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +5 -0
- package/src/components/picker/helpers/useNewPickerProps.d.ts +3 -0
- package/src/components/picker/helpers/usePickerLabel.d.ts +17 -0
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +4 -0
- package/src/components/picker/helpers/usePickerSearch.d.ts +9 -0
- package/src/components/picker/helpers/usePickerSelection.d.ts +16 -0
- package/src/components/picker/index.d.ts +15 -0
- package/src/components/picker/types.d.ts +321 -0
- package/src/components/pieChart/PieSegment.d.ts +34 -0
- package/src/components/pieChart/index.d.ts +15 -0
- package/src/components/progressBar/index.d.ts +65 -0
- package/src/components/progressiveImage/index.d.ts +23 -0
- package/src/components/radioButton/RadioButton.driver.d.ts +9 -0
- package/src/components/radioButton/index.d.ts +121 -0
- package/src/components/radioGroup/RadioGroup.driver.d.ts +13 -0
- package/src/components/radioGroup/RadioGroupContext.d.ts +14 -0
- package/src/components/radioGroup/asRadioGroupChild.d.ts +2 -0
- package/src/components/radioGroup/index.d.ts +47 -0
- package/src/components/scrollBar/index.d.ts +88 -0
- package/src/components/searchInput/index.d.ts +37 -0
- package/src/components/searchInput/types.d.ts +66 -0
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +25 -0
- package/src/components/sectionsWheelPicker/index.d.ts +43 -0
- package/src/components/segmentedControl/index.d.ts +90 -0
- package/src/components/segmentedControl/segment.d.ts +111 -0
- package/src/components/segmentedControl/useSegmentedControlPreset.d.ts +10 -0
- package/src/components/skeletonView/index.d.ts +163 -0
- package/src/components/slider/ColorSliderGroup.d.ts +13 -0
- package/src/components/slider/GradientSlider.d.ts +20 -0
- package/src/components/slider/SliderContext.d.ts +8 -0
- package/src/components/slider/Thumb.d.ts +32 -0
- package/src/components/slider/index.d.ts +31 -0
- package/src/components/slider/slider.driver.d.ts +5 -0
- package/src/components/slider/types.d.ts +197 -0
- package/src/components/sortableGridList/SortableItem.d.ts +6 -0
- package/src/components/sortableGridList/index.d.ts +5 -0
- package/src/components/sortableGridList/types.d.ts +34 -0
- package/src/components/sortableGridList/usePresenter.d.ts +21 -0
- package/src/components/sortableList/SortableList.driver.new.d.ts +2 -0
- package/src/components/sortableList/SortableListContext.d.ts +19 -0
- package/src/components/sortableList/SortableListItem.d.ts +8 -0
- package/src/components/sortableList/SortableListItem.driver.new.d.ts +11 -0
- package/src/components/sortableList/index.d.ts +5 -0
- package/src/components/sortableList/types.d.ts +48 -0
- package/src/components/sortableList/usePresenter.d.ts +12 -0
- package/src/components/stackAggregator/index.d.ts +89 -0
- package/src/components/stateScreen/index.d.ts +5 -0
- package/src/components/stateScreen/types.d.ts +30 -0
- package/src/components/stepper/index.d.ts +47 -0
- package/src/components/svgImage/index.d.ts +14 -0
- package/src/components/svgImage/index.web.d.ts +18 -0
- package/src/components/switch/index.d.ts +102 -0
- package/src/components/switch/switch.driver.d.ts +18 -0
- package/src/components/tabController/PageCarousel.d.ts +9 -0
- package/src/components/tabController/TabBar.d.ts +97 -0
- package/src/components/tabController/TabBarContext.d.ts +18 -0
- package/src/components/tabController/TabBarItem.d.ts +105 -0
- package/src/components/tabController/TabPage.d.ts +33 -0
- package/src/components/tabController/index.d.ts +48 -0
- package/src/components/tabController/useImperativeTabControllerHandle.d.ts +6 -0
- package/src/components/tabController/useScrollToItem.d.ts +79 -0
- package/src/components/text/Text.driver.d.ts +7 -0
- package/src/components/text/Text.driver.new.d.ts +17 -0
- package/src/components/text/index.d.ts +195 -0
- package/src/components/textField/CharCounter.d.ts +7 -0
- package/src/components/textField/ClearButton.d.ts +4 -0
- package/src/components/textField/FieldContext.d.ts +4 -0
- package/src/components/textField/FloatingPlaceholder.d.ts +7 -0
- package/src/components/textField/Input.d.ts +8 -0
- package/src/components/textField/Label.d.ts +7 -0
- package/src/components/textField/Presenter.d.ts +7 -0
- package/src/components/textField/TextField.driver.new.d.ts +129 -0
- package/src/components/textField/ValidationMessage.d.ts +7 -0
- package/src/components/textField/index.d.ts +114 -0
- package/src/components/textField/presets/outline.d.ts +737 -0
- package/src/components/textField/presets/underline.d.ts +735 -0
- package/src/components/textField/textInput/index.d.ts +1 -0
- package/src/components/textField/textInput/index.web.d.ts +3 -0
- package/src/components/textField/types.d.ts +287 -0
- package/src/components/textField/useFieldState.d.ts +16 -0
- package/src/components/textField/useImperativeInputHandle.d.ts +4 -0
- package/src/components/textField/usePreset.d.ts +1696 -0
- package/src/components/textField/validators.d.ts +9 -0
- package/src/components/textFieldOld/index.d.ts +71 -0
- package/src/components/timeline/Line.d.ts +10 -0
- package/src/components/timeline/Point.d.ts +9 -0
- package/src/components/timeline/index.d.ts +11 -0
- package/src/components/timeline/line.driver.d.ts +10 -0
- package/src/components/timeline/point.driver.d.ts +8 -0
- package/src/components/timeline/timeline.driver.d.ts +25 -0
- package/src/components/timeline/types.d.ts +50 -0
- package/src/components/touchableOpacity/index.d.ts +50 -0
- package/src/components/view/View.driver.new.d.ts +7 -0
- package/src/components/view/index.d.ts +46 -0
- package/src/components/wizard/WizardStates.d.ts +2 -0
- package/src/components/wizard/WizardStep.d.ts +4 -0
- package/src/components/wizard/index.d.ts +31 -0
- package/src/components/wizard/types.d.ts +90 -0
- package/src/helpers/AvatarHelper.d.ts +9 -0
- package/src/helpers/FormattingPresenter.d.ts +6 -0
- package/src/helpers/Profiler.d.ts +22 -0
- package/src/helpers/index.d.ts +3 -0
- package/src/hooks/index.d.ts +14 -0
- package/src/hooks/useCombinedRefs/index.d.ts +3 -0
- package/src/hooks/useDebounce/index.d.ts +5 -0
- package/src/hooks/useDidUpdate/index.d.ts +6 -0
- package/src/hooks/useHiddenLocation/index.d.ts +13 -0
- package/src/hooks/useHiddenLocation/index.web.d.ts +13 -0
- package/src/hooks/useKeyboardHeight/index.d.ts +5 -0
- package/src/hooks/useMeasure/index.d.ts +15 -0
- package/src/hooks/useModifiers/index.d.ts +3 -0
- package/src/hooks/useOrientation/index.d.ts +7 -0
- package/src/hooks/useScrollEnabler/index.d.ts +23 -0
- package/src/hooks/useScrollReached/index.d.ts +28 -0
- package/src/hooks/useScrollTo/index.d.ts +37 -0
- package/src/hooks/useScrollToItem/index.d.ts +65 -0
- package/src/hooks/useThemeProps/index.d.ts +2 -0
- package/src/hooks/useToggleValue/index.d.ts +2 -0
- package/src/incubator/TouchableOpacity.d.ts +52 -0
- package/src/incubator/calendar/Agenda.d.ts +4 -0
- package/src/incubator/calendar/CalendarContext.d.ts +4 -0
- package/src/incubator/calendar/CalendarItem.d.ts +5 -0
- package/src/incubator/calendar/Day.d.ts +4 -0
- package/src/incubator/calendar/Day_OLD.d.ts +4 -0
- package/src/incubator/calendar/Header.d.ts +4 -0
- package/src/incubator/calendar/Month.d.ts +4 -0
- package/src/incubator/calendar/TodayButton.d.ts +4 -0
- package/src/incubator/calendar/Week.d.ts +4 -0
- package/src/incubator/calendar/WeekDaysNames.d.ts +4 -0
- package/src/incubator/calendar/helpers/CalendarProcessor.d.ts +2 -0
- package/src/incubator/calendar/helpers/DataProcessor.d.ts +2 -0
- package/src/incubator/calendar/helpers/DateUtils.d.ts +23 -0
- package/src/incubator/calendar/index.d.ts +7 -0
- package/src/incubator/calendar/types.d.ts +118 -0
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.d.ts +7 -0
- package/src/incubator/expandableOverlay/index.d.ts +83 -0
- package/src/incubator/gradient/BorderGradient.d.ts +4 -0
- package/src/incubator/gradient/CircleGradient.d.ts +4 -0
- package/src/incubator/gradient/RectangleGradient.d.ts +4 -0
- package/src/incubator/gradient/index.d.ts +5 -0
- package/src/incubator/gradient/types.d.ts +26 -0
- package/src/incubator/gradient/useAngleTransform.d.ts +27 -0
- package/src/incubator/index.d.ts +9 -0
- package/src/incubator/slider/Slider.driver.d.ts +5 -0
- package/src/incubator/slider/SliderPresenter.d.ts +6 -0
- package/src/incubator/slider/Thumb.d.ts +24 -0
- package/src/incubator/slider/Track.d.ts +13 -0
- package/src/incubator/slider/index.d.ts +139 -0
- package/src/incubator/toast/Toast.driver.new.d.ts +54 -0
- package/src/incubator/toast/helpers/useToastAnimation.d.ts +22 -0
- package/src/incubator/toast/helpers/useToastPresets.d.ts +8 -0
- package/src/incubator/toast/helpers/useToastTimer.d.ts +6 -0
- package/src/incubator/toast/index.d.ts +9 -0
- package/src/incubator/toast/index.js +4 -1
- package/src/incubator/toast/types.d.ts +111 -0
- package/src/index.d.ts +92 -0
- package/src/optionalDependencies/BlurViewPackage.d.ts +2 -0
- package/src/optionalDependencies/BlurViewPackage.web.d.ts +2 -0
- package/src/optionalDependencies/DateTimePickerPackage.d.ts +2 -0
- package/src/optionalDependencies/FlashListPackage.d.ts +2 -0
- package/src/optionalDependencies/HapticFeedbackPackage.d.ts +2 -0
- package/src/optionalDependencies/LinearGradientPackage.d.ts +2 -0
- package/src/optionalDependencies/MomentPackage.d.ts +2 -0
- package/src/optionalDependencies/NetInfoPackage.d.ts +2 -0
- package/src/optionalDependencies/PostCssPackage.d.ts +5 -0
- package/src/optionalDependencies/ShimmerPackage.d.ts +2 -0
- package/src/optionalDependencies/SvgPackage.d.ts +3 -0
- package/src/optionalDependencies/index.d.ts +9 -0
- package/src/optionalDependencies/index.web.d.ts +7 -0
- package/src/services/HapticService.d.ts +15 -0
- package/src/services/LogService.d.ts +35 -0
- package/src/services/index.d.ts +2 -0
- package/src/style/borderRadiuses.d.ts +30 -0
- package/src/style/colorName.d.ts +8 -0
- package/src/style/colorNameMap.d.ts +2 -0
- package/src/style/colors.d.ts +274 -0
- package/src/style/colorsPalette.d.ts +101 -0
- package/src/style/components.d.ts +15 -0
- package/src/style/componentsColors.d.ts +5 -0
- package/src/style/designTokens.d.ts +69 -0
- package/src/style/designTokensDM.d.ts +69 -0
- package/src/style/dividers.d.ts +11 -0
- package/src/style/index.d.ts +13 -0
- package/src/style/scheme.d.ts +57 -0
- package/src/style/shadows.d.ts +223 -0
- package/src/style/spacings.d.ts +32 -0
- package/src/style/themeManager.d.ts +22 -0
- package/src/style/typography.d.ts +26 -0
- package/src/style/typographyPresets.d.ts +7 -0
- package/src/testkit/Component.driver.d.ts +30 -0
- package/src/testkit/DriverException.d.ts +12 -0
- package/src/testkit/UniDriver.d.ts +29 -0
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +26 -0
- package/src/testkit/index.d.ts +25 -0
- package/src/testkit/new/Component.driver.d.ts +16 -0
- package/src/testkit/new/useDraggable.driver.d.ts +15 -0
- package/src/testkit/new/usePressable.driver.d.ts +14 -0
- package/src/testkit/new/useScrollable.driver.d.ts +13 -0
- package/src/typings/assets.d.ts +52 -0
- package/src/typings/common.d.ts +12 -0
- package/src/typings/module.d.ts +13 -0
- package/src/typings/recorderTypes.d.ts +13 -0
- package/src/uilib-test-renderer/helper.d.ts +8 -0
- package/src/uilib-test-renderer/index.d.ts +4 -0
- package/src/uilib-test-renderer/scrollViewHelper.d.ts +9 -0
- package/src/utils/dateUtils.d.ts +2 -0
- package/src/utils/imageUtils.d.ts +5 -0
- package/src/utils/index.d.ts +4 -0
- package/src/utils/styleUtils.d.ts +7 -0
- package/src/utils/textUtils.d.ts +8 -0
- package/jestSetup/jest-setup.js +0 -154
- package/lib/components/DynamicFonts/FontDownloader.d.js +0 -1
- package/lib/components/DynamicFonts/FontLoader.d.js +0 -1
- package/lib/components/DynamicFonts/NoPermissionsAcquirer.d.js +0 -1
- package/lib/components/DynamicFonts/PermissionsAcquirer.android.d.js +0 -1
- package/lib/components/DynamicFonts/PermissionsAcquirer.ios.d.js +0 -2
- package/lib/components/DynamicFonts/PermissionsAcquirer.web.d.js +0 -2
- package/lib/components/DynamicFonts/RNFSPackage.d.js +0 -1
- package/lib/components/DynamicFonts/index.d.js +0 -3
- package/lib/components/HighlighterOverlayView/index.d.js +0 -1
- package/lib/components/HighlighterOverlayView/index.web.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.ios.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.web.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.d.js +0 -5
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.android.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.js +0 -7
- package/lib/components/Keyboard/KeyboardAwareInsetsView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.android.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.d.js +0 -10
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/index.web.d.js +0 -1
- package/lib/components/Keyboard/index.d.js +0 -4
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.js +0 -1
- package/lib/components/SafeArea/SafeAreaSpacerView.d.js +0 -1
- package/lib/components/SafeArea/SafeAreaSpacerView.web.d.js +0 -1
- package/lib/components/SafeArea/index.d.js +0 -1
- package/lib/components/index.d.js +0 -6
- package/lib/scripts/releaseNative.js +0 -72
- package/lib/specs/HighlighterViewNativeComponent.d.js +0 -1
- package/lib/specs/HighlighterViewNativeComponent.js +0 -8
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.js +0 -1
- package/lib/specs/KeyboardTrackingViewNativeComponent.js +0 -8
- package/scripts/build/.babelrc.exports.js +0 -6
- package/scripts/build/build.js +0 -35
- package/scripts/build/buildPackages/buildComponentsPackages.js +0 -18
- package/scripts/build/buildPackages/buildCustomPackages.js +0 -106
- package/scripts/build/buildPackages/index.js +0 -6
- package/scripts/createCalendarMockData.js +0 -37
- package/scripts/docs/buildDocs.js +0 -1
- package/scripts/prepush.js +0 -71
- package/scripts/release/prReleaseNotes.js +0 -6
- package/scripts/release/release.js +0 -99
- package/scripts/updateWebAssets.js +0 -88
- package/scripts/utils.js +0 -21
- package/src/assets/__tests__/Assets.spec.js +0 -110
- package/src/commons/__tests__/baseComponent.spec.js +0 -36
- package/src/commons/__tests__/constants.spec.js +0 -202
- package/src/commons/__tests__/modifiers.spec.js +0 -453
- package/src/components/WheelPicker/__tests__/index.spec.js +0 -121
- package/src/components/WheelPicker/__tests__/useListMiddleIndex.spec.js +0 -40
- package/src/components/WheelPicker/__tests__/usePresenter.spec.js +0 -87
- package/src/components/avatar/__tests__/index.spec.js +0 -25
- package/src/components/badge/__tests__/index.spec.js +0 -84
- package/src/components/button/__tests__/index.driver.spec.js +0 -209
- package/src/components/button/__tests__/index.spec.js +0 -287
- package/src/components/card/__tests__/CardPresenter.spec.js +0 -35
- package/src/components/carousel/__tests__/CarouselPresenter.spec.js +0 -52
- package/src/components/carousel/__tests__/index.spec.js +0 -89
- package/src/components/checkbox/__tests__/index.spec.js +0 -357
- package/src/components/chip/__tests__/index.spec.js +0 -63
- package/src/components/connectionStatusBar/__tests__/index.spec.js +0 -41
- package/src/components/dateTimePicker/__tests__/index.spec.js +0 -44
- package/src/components/dialog/__tests__/index.new.spec.js +0 -118
- package/src/components/featureHighlight/__tests__/index.spec.js +0 -76
- package/src/components/floatingButton/__tests__/index.spec.js +0 -229
- package/src/components/hint/__tests__/index.spec.js +0 -108
- package/src/components/image/__tests__/index.spec.js +0 -56
- package/src/components/maskedInput/__tests__/maskedInput.new.spec.js +0 -19
- package/src/components/maskedInput/__tests__/maskedInput.old.spec.js +0 -20
- package/src/components/modal/__tests__/index.spec.js +0 -58
- package/src/components/numberInput/__tests__/Presenter.spec.js +0 -374
- package/src/components/numberInput/__tests__/index.spec.js +0 -38
- package/src/components/panView/__tests__/panningUtil.spec.js +0 -693
- package/src/components/picker/__tests__/PickerPresenter.spec.js +0 -15
- package/src/components/picker/__tests__/index.spec.js +0 -364
- package/src/components/picker/helpers/__tests__/usePickerLabel.spec.js +0 -96
- package/src/components/radioButton/__tests__/index.spec.js +0 -43
- package/src/components/radioGroup/__tests__/index.spec.js +0 -96
- package/src/components/sectionsWheelPicker/__tests__/index.spec.js +0 -35
- package/src/components/sectionsWheelPicker/__tests__/mockSections.js +0 -28
- package/src/components/segmentedControl/__tests__/index.spec.js +0 -25
- package/src/components/slider/__tests__/index.spec.js +0 -35
- package/src/components/sortableGridList/__tests__/index.spec.js +0 -51
- package/src/components/sortableGridList/__tests__/usePresenter.spec.js +0 -231
- package/src/components/sortableList/__tests__/index.spec.js +0 -105
- package/src/components/switch/__tests__/index.spec.js +0 -96
- package/src/components/text/__tests__/index.driver.spec.js +0 -124
- package/src/components/text/__tests__/index.spec.js +0 -245
- package/src/components/textField/__tests__/Presenter.spec.js +0 -240
- package/src/components/textField/__tests__/index.driver.spec.js +0 -639
- package/src/components/timeline/__tests__/driver.index.spec.js +0 -133
- package/src/helpers/__tests__/AvatarHelper.spec.js +0 -170
- package/src/hooks/useDidUpdate/__tests__/useDidUpdate.spec.js +0 -80
- package/src/hooks/useOrientation/__tests__/useOrientation.spec.js +0 -70
- package/src/hooks/useToggleValue/__tests__/useToggleValue.spec.js +0 -89
- package/src/incubator/calendar/__tests__/DateUtils.spec.js +0 -367
- package/src/incubator/expandableOverlay/__tests__/index.spec.js +0 -114
- package/src/incubator/gradient/__tests__/useAngleTransform.spec.js +0 -126
- package/src/incubator/slider/__tests__/SliderPresenter.spec.js +0 -43
- package/src/incubator/slider/__tests__/index.spec.js +0 -34
- package/src/incubator/toast/__tests__/index.spec.js +0 -64
- package/src/style/__tests__/colors.spec.js +0 -313
- package/src/style/__tests__/scheme.spec.js +0 -119
- package/src/utils/__tests__/Playground.perf.js +0 -14
- package/src/utils/__tests__/imageUtils.spec.js +0 -54
- package/src/utils/__tests__/textUtils.spec.js +0 -446
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
+
|
|
3
|
+
import android.content.res.Resources;
|
|
4
|
+
import android.graphics.Point;
|
|
5
|
+
import android.graphics.Rect;
|
|
6
|
+
import android.view.Display;
|
|
7
|
+
import android.view.View;
|
|
8
|
+
import android.view.Window;
|
|
9
|
+
|
|
10
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
11
|
+
|
|
12
|
+
import java.lang.reflect.Method;
|
|
13
|
+
|
|
14
|
+
public class UiUtils {
|
|
15
|
+
public static float pxToDp(Resources resources, double pixels) {
|
|
16
|
+
return (float) (resources.getDisplayMetrics().density * pixels);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public static int getStatusBarHeight(View view, Window window) {
|
|
20
|
+
int height = 0;
|
|
21
|
+
if (UiUtils.hasOnScreenSystemBar(window)) {
|
|
22
|
+
Resources resources = view.getResources();
|
|
23
|
+
int resourceId = resources.getIdentifier("status_bar_height", "dimen", "android");
|
|
24
|
+
if (resourceId > 0) {
|
|
25
|
+
height = resources.getDimensionPixelSize(resourceId);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return height;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static Rect getVisibleRect(View view) {
|
|
32
|
+
Rect myViewRect = new Rect();
|
|
33
|
+
view.getGlobalVisibleRect(myViewRect);
|
|
34
|
+
return myViewRect;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private static boolean hasOnScreenSystemBar(Window window) {
|
|
38
|
+
Display display = window.getWindowManager().getDefaultDisplay();
|
|
39
|
+
int rawDisplayHeight = 0;
|
|
40
|
+
try {
|
|
41
|
+
Method getRawHeight = Display.class.getMethod("getRawHeight");
|
|
42
|
+
rawDisplayHeight = (Integer) getRawHeight.invoke(display);
|
|
43
|
+
} catch (Exception ex) {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Point point = new Point();
|
|
47
|
+
display.getSize(point);
|
|
48
|
+
return (rawDisplayHeight - point.y) <= 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.app.Application;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
|
|
7
|
+
public class AppContextHolder {
|
|
8
|
+
|
|
9
|
+
private static Activity sCurrentActivity;
|
|
10
|
+
|
|
11
|
+
public static void setApplication(Application application) {
|
|
12
|
+
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
|
|
13
|
+
@Override
|
|
14
|
+
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
|
15
|
+
sCurrentActivity = activity;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
public void onActivityStarted(Activity activity) {
|
|
20
|
+
sCurrentActivity = activity;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
public void onActivityResumed(Activity activity) {
|
|
25
|
+
sCurrentActivity = activity;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@Override
|
|
29
|
+
public void onActivityPaused(Activity activity) {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
public void onActivityStopped(Activity activity) {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Override
|
|
37
|
+
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void onActivityDestroyed(Activity activity) {
|
|
42
|
+
if (sCurrentActivity == activity) {
|
|
43
|
+
sCurrentActivity = null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public static Activity getCurrentActivity() {
|
|
50
|
+
return sCurrentActivity;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import android.view.View;
|
|
6
|
+
import android.view.Window;
|
|
7
|
+
import android.view.WindowManager;
|
|
8
|
+
import android.view.inputmethod.InputMethodManager;
|
|
9
|
+
import android.widget.EditText;
|
|
10
|
+
|
|
11
|
+
import com.facebook.react.ReactRootView;
|
|
12
|
+
import com.facebook.react.bridge.Promise;
|
|
13
|
+
import com.facebook.react.bridge.ReactContext;
|
|
14
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
15
|
+
|
|
16
|
+
import java.lang.ref.WeakReference;
|
|
17
|
+
|
|
18
|
+
import static com.wix.reactnativeuilib.keyboardinput.AppContextHolder.getCurrentActivity;
|
|
19
|
+
import static com.wix.reactnativeuilib.keyboardinput.utils.RuntimeUtils.dispatchUIUpdates;
|
|
20
|
+
import static com.wix.reactnativeuilib.keyboardinput.utils.RuntimeUtils.runOnUIThread;
|
|
21
|
+
import static com.wix.reactnativeuilib.keyboardinput.utils.ViewUtils.getWindow;
|
|
22
|
+
|
|
23
|
+
public class CustomKeyboardLayout implements ReactSoftKeyboardMonitor.Listener, ReactScreenMonitor.Listener {
|
|
24
|
+
private boolean mFirstKeyboardShow = true;
|
|
25
|
+
private final InputMethodManager mInputMethodManager;
|
|
26
|
+
private final ReactSoftKeyboardMonitor mKeyboardMonitor;
|
|
27
|
+
private WeakReference<CustomKeyboardRootViewShadow> mShadowNode = new WeakReference<>(null);
|
|
28
|
+
private int mSoftInputMode;
|
|
29
|
+
private boolean mIsShown = false;
|
|
30
|
+
|
|
31
|
+
public CustomKeyboardLayout(ReactContext reactContext, ReactSoftKeyboardMonitor keyboardMonitor, ReactScreenMonitor screenMonitor) {
|
|
32
|
+
mKeyboardMonitor = keyboardMonitor;
|
|
33
|
+
mInputMethodManager = (InputMethodManager) reactContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
34
|
+
|
|
35
|
+
mKeyboardMonitor.setListener(this);
|
|
36
|
+
screenMonitor.addListener(this);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public void setShown(boolean isShown) {
|
|
40
|
+
mIsShown = isShown;
|
|
41
|
+
Window window = getWindow();
|
|
42
|
+
if (window != null) {
|
|
43
|
+
if (mIsShown) {
|
|
44
|
+
mSoftInputMode = window.getAttributes().softInputMode;
|
|
45
|
+
} else {
|
|
46
|
+
window.setSoftInputMode(mSoftInputMode);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@Override
|
|
52
|
+
public void onSoftKeyboardVisible(boolean distinct) {
|
|
53
|
+
if (distinct) {
|
|
54
|
+
clearKeyboardOverlayMode();
|
|
55
|
+
}
|
|
56
|
+
hideCustomKeyboardContent();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@Override
|
|
60
|
+
public void onSoftKeyboardHidden() {
|
|
61
|
+
if (getShadowNodeHeight() == 0) {
|
|
62
|
+
mFirstKeyboardShow = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Override
|
|
67
|
+
public void onNewReactScreen(ReactRootView reactRootView) {
|
|
68
|
+
clearKeyboardOverlayMode();
|
|
69
|
+
if (reactRootView != null) {
|
|
70
|
+
sendCustomKeyboardResignedEvent();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public void setShadowNode(CustomKeyboardRootViewShadow node) {
|
|
75
|
+
mShadowNode = new WeakReference<>(node);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public void onKeyboardHasCustomContent() {
|
|
79
|
+
runOnUIThread(new Runnable() {
|
|
80
|
+
@Override
|
|
81
|
+
public void run() {
|
|
82
|
+
showCustomKeyboardContent();
|
|
83
|
+
setKeyboardOverlayMode();
|
|
84
|
+
hideSoftKeyboardIfNeeded();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public void forceReset(final Promise promise) {
|
|
90
|
+
runOnUIThread(new Runnable() {
|
|
91
|
+
@Override
|
|
92
|
+
public void run() {
|
|
93
|
+
Activity currentActivity = getCurrentActivity();
|
|
94
|
+
if (currentActivity != null) {
|
|
95
|
+
final View focusedView = currentActivity.getCurrentFocus();
|
|
96
|
+
if (focusedView instanceof EditText) {
|
|
97
|
+
showSoftKeyboard();
|
|
98
|
+
} else {
|
|
99
|
+
hideCustomKeyboardContent();
|
|
100
|
+
clearKeyboardOverlayMode();
|
|
101
|
+
}
|
|
102
|
+
promise.resolve(null);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public void clearFocusedView() {
|
|
109
|
+
runOnUIThread(new Runnable() {
|
|
110
|
+
@Override
|
|
111
|
+
public void run() {
|
|
112
|
+
Activity currentActivity = getCurrentActivity();
|
|
113
|
+
if (currentActivity != null) {
|
|
114
|
+
final View focusedView = currentActivity.getCurrentFocus();
|
|
115
|
+
if (focusedView != null) {
|
|
116
|
+
focusedView.clearFocus();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private void showCustomKeyboardContent() {
|
|
124
|
+
setCustomKeyboardHeight(getHeightForCustomContent());
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
private void hideCustomKeyboardContent() {
|
|
128
|
+
setCustomKeyboardHeight(0);
|
|
129
|
+
runOnUIThread(new Runnable() {
|
|
130
|
+
@Override
|
|
131
|
+
public void run() {
|
|
132
|
+
sendCustomKeyboardResignedEvent();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private void syncCustomKeyboardHeightAfterUIUpdate(final int height) {
|
|
138
|
+
dispatchUIUpdates(new Runnable() {
|
|
139
|
+
@Override
|
|
140
|
+
public void run() {
|
|
141
|
+
setShadowNodeHeight(height);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private void setCustomKeyboardHeight(int height) {
|
|
147
|
+
try {
|
|
148
|
+
if (mFirstKeyboardShow) {
|
|
149
|
+
mFirstKeyboardShow = false;
|
|
150
|
+
syncCustomKeyboardHeightAfterUIUpdate(height);
|
|
151
|
+
} else {
|
|
152
|
+
setShadowNodeHeight(height);
|
|
153
|
+
}
|
|
154
|
+
} catch (Exception e) {
|
|
155
|
+
e.printStackTrace();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
private void setShadowNodeHeight(int height) {
|
|
160
|
+
final CustomKeyboardRootViewShadow shadowNode = mShadowNode.get();
|
|
161
|
+
if (shadowNode != null) {
|
|
162
|
+
shadowNode.setHeight(height);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private float getShadowNodeHeight() {
|
|
167
|
+
float height = 0;
|
|
168
|
+
final CustomKeyboardRootViewShadow shadowNode = mShadowNode.get();
|
|
169
|
+
if (shadowNode != null) {
|
|
170
|
+
height = shadowNode.getHeight();
|
|
171
|
+
}
|
|
172
|
+
return height;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private void showSoftKeyboard() {
|
|
176
|
+
mInputMethodManager.showSoftInput(getCurrentActivity().getCurrentFocus(), 0);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
private void hideSoftKeyboardIfNeeded() {
|
|
180
|
+
final View focusedView = getCurrentActivity().getCurrentFocus();
|
|
181
|
+
if (focusedView != null) {
|
|
182
|
+
mInputMethodManager.hideSoftInputFromWindow(focusedView.getWindowToken(), 0);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
private int getHeightForCustomContent() {
|
|
187
|
+
return mKeyboardMonitor.getKeyboardHeight();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private void setKeyboardOverlayMode() {
|
|
191
|
+
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private void clearKeyboardOverlayMode() {
|
|
195
|
+
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private void setSoftInputMode(int softInputMode) {
|
|
199
|
+
if (mIsShown) {
|
|
200
|
+
Window window = getWindow();
|
|
201
|
+
if (window != null) {
|
|
202
|
+
window.setSoftInputMode(softInputMode);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
private void sendCustomKeyboardResignedEvent() {
|
|
208
|
+
if (ReactContextHolder.getContext().hasActiveCatalystInstance()) {
|
|
209
|
+
ReactContextHolder.getContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("kbdResigned", null);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.view.View;
|
|
5
|
+
import android.widget.FrameLayout;
|
|
6
|
+
|
|
7
|
+
import androidx.annotation.NonNull;
|
|
8
|
+
|
|
9
|
+
public class CustomKeyboardRootView extends FrameLayout {
|
|
10
|
+
|
|
11
|
+
private final CustomKeyboardLayout mLayout;
|
|
12
|
+
|
|
13
|
+
public CustomKeyboardRootView(@NonNull Context context, CustomKeyboardLayout layout) {
|
|
14
|
+
super(context);
|
|
15
|
+
mLayout = layout;
|
|
16
|
+
|
|
17
|
+
setWillNotDraw(false);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public void onViewAdded(View child) {
|
|
22
|
+
if (getChildCount() == 1) {
|
|
23
|
+
mLayout.onKeyboardHasCustomContent();
|
|
24
|
+
}
|
|
25
|
+
super.onViewAdded(child);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@Override
|
|
29
|
+
protected void onAttachedToWindow() {
|
|
30
|
+
super.onAttachedToWindow();
|
|
31
|
+
mLayout.setShown(true);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
protected void onDetachedFromWindow() {
|
|
36
|
+
mLayout.setShown(false);
|
|
37
|
+
super.onDetachedFromWindow();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
+
import com.facebook.react.uimanager.ViewGroupManager;
|
|
6
|
+
|
|
7
|
+
public class CustomKeyboardRootViewManager extends ViewGroupManager<CustomKeyboardRootView> {
|
|
8
|
+
|
|
9
|
+
private final CustomKeyboardLayout mLayout;
|
|
10
|
+
|
|
11
|
+
public CustomKeyboardRootViewManager(CustomKeyboardLayout layout) {
|
|
12
|
+
mLayout = layout;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public String getName() {
|
|
17
|
+
return "CustomKeyboardViewNativeTemp";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public CustomKeyboardRootView createViewInstance(ThemedReactContext reactContext) {
|
|
22
|
+
return new CustomKeyboardRootView(reactContext, mLayout);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
public LayoutShadowNode createShadowNodeInstance() {
|
|
27
|
+
return new CustomKeyboardRootViewShadow(mLayout);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
4
|
+
import com.facebook.react.uimanager.NativeViewHierarchyOptimizer;
|
|
5
|
+
|
|
6
|
+
public class CustomKeyboardRootViewShadow extends LayoutShadowNode {
|
|
7
|
+
|
|
8
|
+
private final CustomKeyboardLayout mLayout;
|
|
9
|
+
|
|
10
|
+
CustomKeyboardRootViewShadow(CustomKeyboardLayout layout) {
|
|
11
|
+
setStyleHeight(0);
|
|
12
|
+
|
|
13
|
+
mLayout = layout;
|
|
14
|
+
mLayout.setShadowNode(this);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Override
|
|
18
|
+
public void onBeforeLayout(NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) {
|
|
19
|
+
mLayout.setShadowNode(this);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public void setHeight(int heightPx) {
|
|
23
|
+
setStyleHeight(heightPx);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public float getHeight() {
|
|
27
|
+
return getStyleHeight().value;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise;
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
5
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
6
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
7
|
+
|
|
8
|
+
public class KeyboardInputModule extends ReactContextBaseJavaModule {
|
|
9
|
+
|
|
10
|
+
private static final String REACT_CLASS = "CustomKeyboardInputTemp";
|
|
11
|
+
|
|
12
|
+
private final CustomKeyboardLayout mLayout;
|
|
13
|
+
|
|
14
|
+
public KeyboardInputModule(ReactApplicationContext reactContext, CustomKeyboardLayout layout) {
|
|
15
|
+
super(reactContext);
|
|
16
|
+
|
|
17
|
+
mLayout = layout;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public String getName() {
|
|
22
|
+
return REACT_CLASS;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ReactMethod
|
|
26
|
+
public void reset(Promise promise) {
|
|
27
|
+
mLayout.forceReset(promise);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@ReactMethod
|
|
31
|
+
public void clearFocusedView() {
|
|
32
|
+
mLayout.clearFocusedView();
|
|
33
|
+
}
|
|
34
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.ReactPackage;
|
|
6
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
7
|
+
import com.facebook.react.bridge.NativeModule;
|
|
8
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
10
|
+
|
|
11
|
+
import java.util.Arrays;
|
|
12
|
+
import java.util.Collections;
|
|
13
|
+
import java.util.List;
|
|
14
|
+
|
|
15
|
+
public class KeyboardInputPackage implements ReactPackage {
|
|
16
|
+
|
|
17
|
+
private CustomKeyboardLayout mLayout;
|
|
18
|
+
|
|
19
|
+
public KeyboardInputPackage(Application application) {
|
|
20
|
+
AppContextHolder.setApplication(application);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
25
|
+
init(reactContext);
|
|
26
|
+
return Arrays.<NativeModule>asList(new KeyboardInputModule(reactContext, mLayout));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
31
|
+
init(reactContext);
|
|
32
|
+
return Arrays.<ViewManager>asList(new CustomKeyboardRootViewManager(mLayout));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Deprecated in RN 0.47
|
|
36
|
+
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
37
|
+
return Collections.emptyList();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private synchronized void init(ReactApplicationContext reactContext) {
|
|
41
|
+
if (ReactContextHolder.getContext() != reactContext) {
|
|
42
|
+
ReactContextHolder.setContext(reactContext);
|
|
43
|
+
|
|
44
|
+
final ReactScreenMonitor screenMonitor = new ReactScreenMonitor(reactContext);
|
|
45
|
+
final ReactSoftKeyboardMonitor keyboardMonitor = new ReactSoftKeyboardMonitor(screenMonitor);
|
|
46
|
+
mLayout = new CustomKeyboardLayout(reactContext, keyboardMonitor, screenMonitor);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
|
|
5
|
+
public class ReactContextHolder {
|
|
6
|
+
|
|
7
|
+
private static ReactApplicationContext sContext;
|
|
8
|
+
|
|
9
|
+
public static void setContext(ReactApplicationContext context) {
|
|
10
|
+
sContext = context;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static ReactApplicationContext getContext() {
|
|
14
|
+
return sContext;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
package com.wix.reactnativeuilib.keyboardinput;
|
|
2
|
+
|
|
3
|
+
import android.view.ViewTreeObserver;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.ReactRootView;
|
|
6
|
+
import com.facebook.react.bridge.LifecycleEventListener;
|
|
7
|
+
import com.facebook.react.bridge.ReactContext;
|
|
8
|
+
import com.wix.reactnativeuilib.keyboardinput.utils.ViewUtils;
|
|
9
|
+
|
|
10
|
+
import java.util.HashSet;
|
|
11
|
+
import java.util.Set;
|
|
12
|
+
|
|
13
|
+
import static com.wix.reactnativeuilib.keyboardinput.utils.ViewUtils.getWindow;
|
|
14
|
+
|
|
15
|
+
public class ReactScreenMonitor implements LifecycleEventListener {
|
|
16
|
+
|
|
17
|
+
public interface Listener {
|
|
18
|
+
void onNewReactScreen(ReactRootView reactRootView);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private final ViewTreeObserver.OnGlobalLayoutListener mWindowLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
|
|
22
|
+
@Override
|
|
23
|
+
public void onGlobalLayout() {
|
|
24
|
+
final ReactRootView reactRootView = ViewUtils.getReactRootView();
|
|
25
|
+
if (mLastReactRootView != reactRootView) {
|
|
26
|
+
mLastReactRootView = reactRootView;
|
|
27
|
+
notifyNewScreen();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
private ReactRootView mLastReactRootView;
|
|
33
|
+
private Set<Listener> mExternalListeners = new HashSet<>();
|
|
34
|
+
|
|
35
|
+
private boolean mHasWindowLayoutListener;
|
|
36
|
+
|
|
37
|
+
public ReactScreenMonitor(ReactContext reactContext) {
|
|
38
|
+
reactContext.addLifecycleEventListener(this);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public void addListener(Listener listener) {
|
|
42
|
+
mExternalListeners.add(listener);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
public void onHostResume() {
|
|
47
|
+
if (mHasWindowLayoutListener) {
|
|
48
|
+
removeWindowLayoutListener();
|
|
49
|
+
}
|
|
50
|
+
mHasWindowLayoutListener = true;
|
|
51
|
+
registerWindowLayoutListener();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@Override
|
|
55
|
+
public void onHostDestroy() {
|
|
56
|
+
removeWindowLayoutListener();
|
|
57
|
+
mHasWindowLayoutListener = false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Override
|
|
61
|
+
public void onHostPause() {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private void registerWindowLayoutListener() {
|
|
65
|
+
if (getWindow() != null) {
|
|
66
|
+
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(mWindowLayoutListener);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private void removeWindowLayoutListener() {
|
|
71
|
+
if (getWindow() == null) {
|
|
72
|
+
// No window => no activity => nothing to clear.
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
getWindow().getDecorView().getViewTreeObserver().removeOnGlobalLayoutListener(mWindowLayoutListener);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private void notifyNewScreen() {
|
|
79
|
+
for (Listener listener : mExternalListeners) {
|
|
80
|
+
listener.onNewReactScreen(mLastReactRootView);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|