react-native-ui-lib 8.0.1 → 8.1.0
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/jestSetup/jest-setup.js +154 -0
- package/lib/components/DynamicFonts/FontDownloader.d.js +1 -0
- package/lib/components/DynamicFonts/FontLoader.d.js +1 -0
- package/lib/components/DynamicFonts/NoPermissionsAcquirer.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.android.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.ios.d.js +2 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.web.d.js +2 -0
- package/lib/components/DynamicFonts/RNFSPackage.d.js +1 -0
- package/lib/components/DynamicFonts/index.d.js +3 -0
- package/lib/components/HighlighterOverlayView/index.d.js +1 -0
- package/lib/components/HighlighterOverlayView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.ios.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.d.js +5 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.js +7 -0
- package/lib/components/Keyboard/KeyboardAwareInsetsView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.d.js +10 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.web.d.js +1 -0
- package/lib/components/Keyboard/index.d.js +4 -0
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.web.d.js +1 -0
- package/lib/components/SafeArea/index.d.js +1 -0
- package/lib/components/index.d.js +6 -0
- package/lib/scripts/releaseNative.js +72 -0
- package/lib/specs/HighlighterViewNativeComponent.d.js +1 -0
- package/lib/specs/HighlighterViewNativeComponent.d.ts +61 -0
- package/lib/specs/HighlighterViewNativeComponent.js +8 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.js +1 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.ts +58 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.js +8 -0
- package/package.json +7 -31
- package/scripts/build/build.js +35 -0
- package/scripts/build/buildPackages/buildComponentsPackages.js +18 -0
- package/scripts/build/buildPackages/buildCustomPackages.js +106 -0
- package/scripts/build/buildPackages/index.js +6 -0
- package/scripts/createCalendarMockData.js +37 -0
- package/scripts/docs/buildDocs.js +1 -0
- package/scripts/prepush.js +71 -0
- package/scripts/release/prReleaseNotes.js +6 -0
- package/scripts/release/release.js +99 -0
- package/scripts/updateWebAssets.js +88 -0
- package/scripts/utils.js +21 -0
- package/src/assets/__tests__/Assets.spec.js +110 -0
- package/src/commons/__tests__/baseComponent.spec.js +36 -0
- package/src/commons/__tests__/constants.spec.js +202 -0
- package/src/commons/__tests__/modifiers.spec.js +453 -0
- package/src/components/WheelPicker/__tests__/index.spec.js +121 -0
- package/src/components/WheelPicker/__tests__/useListMiddleIndex.spec.js +40 -0
- package/src/components/WheelPicker/__tests__/usePresenter.spec.js +87 -0
- package/src/components/avatar/__tests__/index.spec.js +25 -0
- package/src/components/badge/__tests__/index.spec.js +84 -0
- package/src/components/button/__tests__/index.driver.spec.js +209 -0
- package/src/components/button/__tests__/index.spec.js +287 -0
- package/src/components/button/index.js +30 -8
- package/src/components/card/__tests__/CardPresenter.spec.js +35 -0
- package/src/components/carousel/__tests__/CarouselPresenter.spec.js +52 -0
- package/src/components/carousel/__tests__/index.spec.js +89 -0
- package/src/components/carousel/index.js +2 -1
- package/src/components/checkbox/__tests__/index.spec.js +357 -0
- package/src/components/chip/__tests__/index.spec.js +63 -0
- package/src/components/colorSwatch/index.js +1 -1
- package/src/components/connectionStatusBar/__tests__/index.spec.js +41 -0
- package/src/components/dateTimePicker/__tests__/index.spec.js +44 -0
- package/src/components/dialog/__tests__/index.new.spec.js +118 -0
- package/src/components/featureHighlight/__tests__/index.spec.js +76 -0
- package/src/components/floatingButton/__tests__/index.spec.js +229 -0
- package/src/components/floatingButton/index.js +66 -35
- package/src/components/hint/__tests__/index.spec.js +108 -0
- package/src/components/image/__tests__/index.spec.js +56 -0
- package/src/components/image/image.api.json +193 -1
- package/src/components/maskedInput/__tests__/maskedInput.new.spec.js +19 -0
- package/src/components/maskedInput/__tests__/maskedInput.old.spec.js +20 -0
- package/src/components/modal/__tests__/index.spec.js +58 -0
- package/src/components/numberInput/__tests__/Presenter.spec.js +374 -0
- package/src/components/numberInput/__tests__/index.spec.js +38 -0
- package/src/components/numberInput/numberInput.api.json +131 -6
- package/src/components/overlay/index.js +2 -1
- package/src/components/pageControl/pageControl.api.json +175 -1
- package/src/components/panView/__tests__/panningUtil.spec.js +693 -0
- package/src/components/picker/__tests__/PickerPresenter.spec.js +15 -0
- package/src/components/picker/__tests__/index.spec.js +364 -0
- package/src/components/picker/helpers/__tests__/usePickerLabel.spec.js +96 -0
- package/src/components/radioButton/__tests__/index.spec.js +43 -0
- package/src/components/radioGroup/__tests__/index.spec.js +96 -0
- package/src/components/sectionsWheelPicker/__tests__/index.spec.js +35 -0
- package/src/components/sectionsWheelPicker/__tests__/mockSections.js +28 -0
- package/src/components/segmentedControl/__tests__/index.spec.js +25 -0
- package/src/components/slider/__tests__/index.spec.js +35 -0
- package/src/components/slider/index.js +12 -1
- package/src/components/slider/slider.api.json +11 -0
- package/src/components/sortableGridList/__tests__/index.spec.js +51 -0
- package/src/components/sortableGridList/__tests__/usePresenter.spec.js +231 -0
- package/src/components/sortableGridList/sortableGridList.api.json +44 -1
- package/src/components/sortableList/SortableList.api.json +51 -3
- package/src/components/sortableList/__tests__/index.spec.js +105 -0
- package/src/components/stackAggregator/assets/arrow-down.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@2x.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@3x.png +0 -0
- package/src/components/switch/__tests__/index.spec.js +96 -0
- package/src/components/text/__tests__/index.driver.spec.js +124 -0
- package/src/components/text/__tests__/index.spec.js +245 -0
- package/src/components/textField/__tests__/Presenter.spec.js +240 -0
- package/src/components/textField/__tests__/index.driver.spec.js +639 -0
- package/src/components/timeline/__tests__/driver.index.spec.js +133 -0
- package/src/helpers/__tests__/AvatarHelper.spec.js +170 -0
- package/src/hooks/useDidUpdate/__tests__/useDidUpdate.spec.js +80 -0
- package/src/hooks/useOrientation/__tests__/useOrientation.spec.js +70 -0
- package/src/hooks/useToggleValue/__tests__/useToggleValue.spec.js +89 -0
- package/src/incubator/calendar/__tests__/DateUtils.spec.js +367 -0
- package/src/incubator/expandableOverlay/__tests__/index.spec.js +114 -0
- package/src/incubator/gradient/__tests__/useAngleTransform.spec.js +126 -0
- package/src/incubator/slider/__tests__/SliderPresenter.spec.js +43 -0
- package/src/incubator/slider/__tests__/index.spec.js +34 -0
- package/src/incubator/slider/slider.api.json +11 -0
- package/src/incubator/toast/__tests__/index.spec.js +64 -0
- package/src/style/__tests__/colors.spec.js +313 -0
- package/src/style/__tests__/scheme.spec.js +119 -0
- package/src/style/typographyPresets.js +26 -23
- package/src/utils/__tests__/Playground.perf.js +14 -0
- package/src/utils/__tests__/imageUtils.spec.js +54 -0
- package/src/utils/__tests__/textUtils.spec.js +446 -0
- package/.eslintrc.js +0 -56
- package/babel.config.js +0 -35
- package/index.js +0 -10
- package/lib/android/build.gradle +0 -32
- package/lib/android/src/main/AndroidManifest.xml +0 -4
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java +0 -139
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java +0 -167
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +0 -131
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/UiUtils.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java +0 -52
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java +0 -213
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java +0 -39
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java +0 -34
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java +0 -49
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java +0 -16
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java +0 -83
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.java +0 -163
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.java +0 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.java +0 -65
- package/lib/android/src/main/java/com/wix/reactnativeuilib/utils/LogForwarder.java +0 -45
- package/lib/android/src/main/res/layout/wheel_picker.xml +0 -9
- package/lib/android/src/main/res/values/colors.xml +0 -9
- package/lib/android/src/main/res/values/styles.xml +0 -9
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/keyboardRegistry.api.json +0 -50
- package/lib/components/Keyboard/KeyboardAccessoryView/keyboardAccessoryView.api.json +0 -58
- package/lib/components/Keyboard/KeyboardAwareInsetsView/keyboardAwareInsetsView.api.json +0 -14
- package/lib/components/Keyboard/KeyboardTrackingView/keyboardTrackingView.api.json +0 -86
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.h +0 -9
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.m +0 -115
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.h +0 -19
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.m +0 -216
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.h +0 -6
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.m +0 -28
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.h +0 -39
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.m +0 -160
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h +0 -36
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m +0 -121
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.h +0 -48
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.m +0 -27
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolation.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.h +0 -19
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.mm +0 -155
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +0 -450
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +0 -18
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +0 -99
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.h +0 -14
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +0 -827
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.h +0 -44
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +0 -171
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.h +0 -6
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.m +0 -17
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.h +0 -6
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.m +0 -105
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.m +0 -20
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.h +0 -7
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.m +0 -76
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.h +0 -9
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.m +0 -14
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.m +0 -26
- package/lib/ios/reactnativeuilib.xcodeproj/project.pbxproj +0 -435
- package/metro.config.js +0 -23
- package/src/.babelrc.json +0 -23
- package/src/assets/Assets.d.ts +0 -5
- package/src/assets/emojis/index.d.ts +0 -1343
- package/src/assets/index.d.ts +0 -3
- package/src/assets/internal/index.d.ts +0 -4
- package/src/commons/Config.d.ts +0 -24
- package/src/commons/Constants.d.ts +0 -54
- package/src/commons/UIComponent.d.ts +0 -4
- package/src/commons/asBaseComponent.d.ts +0 -15
- package/src/commons/baseComponent.d.ts +0 -2
- package/src/commons/forwardRef.d.ts +0 -8
- package/src/commons/modifiers.d.ts +0 -118
- package/src/commons/new.d.ts +0 -8
- package/src/commons/withScrollEnabler.d.ts +0 -13
- package/src/commons/withScrollReached.d.ts +0 -35
- package/src/components/WheelPicker/Item.d.ts +0 -28
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +0 -18
- package/src/components/WheelPicker/WheelPickerItem.driver.d.ts +0 -8
- package/src/components/WheelPicker/helpers/useListMiddleIndex.d.ts +0 -6
- package/src/components/WheelPicker/index.d.ts +0 -88
- package/src/components/WheelPicker/types.d.ts +0 -6
- package/src/components/WheelPicker/usePresenter.d.ts +0 -21
- package/src/components/actionBar/index.d.ts +0 -35
- package/src/components/actionSheet/index.d.ts +0 -80
- package/src/components/animatedImage/index.d.ts +0 -28
- package/src/components/avatar/index.d.ts +0 -382
- package/src/components/badge/index.d.ts +0 -879
- package/src/components/baseInput/Validators.d.ts +0 -8
- package/src/components/baseInput/index.d.ts +0 -29
- package/src/components/button/Button.driver.new.d.ts +0 -34
- package/src/components/button/ButtonConstants.d.ts +0 -26
- package/src/components/button/index.d.ts +0 -572
- package/src/components/button/types.d.ts +0 -153
- package/src/components/card/CardContext.d.ts +0 -3
- package/src/components/card/CardImage.d.ts +0 -20
- package/src/components/card/CardPresenter.d.ts +0 -12
- package/src/components/card/CardSection.d.ts +0 -79
- package/src/components/card/asCardChild.d.ts +0 -6
- package/src/components/card/index.d.ts +0 -120
- package/src/components/carousel/Carousel.driver.new.d.ts +0 -9
- package/src/components/carousel/CarouselPresenter.d.ts +0 -9
- package/src/components/carousel/index.d.ts +0 -73
- package/src/components/carousel/types.d.ts +0 -107
- package/src/components/checkbox/Checkbox.driver.d.ts +0 -15
- package/src/components/checkbox/index.d.ts +0 -129
- package/src/components/chip/chip.driver.d.ts +0 -33
- package/src/components/chip/index.d.ts +0 -209
- package/src/components/chipsInput/index.d.ts +0 -55
- package/src/components/colorPalette/index.d.ts +0 -116
- package/src/components/colorPicker/ColorPickerDialog.d.ts +0 -39
- package/src/components/colorPicker/ColorPickerDialogHeader.d.ts +0 -9
- package/src/components/colorPicker/ColorPickerDialogSliders.d.ts +0 -10
- package/src/components/colorPicker/ColorPickerPresenter.d.ts +0 -16
- package/src/components/colorPicker/ColorPickerPreview.d.ts +0 -12
- package/src/components/colorPicker/index.d.ts +0 -45
- package/src/components/colorSwatch/index.d.ts +0 -50
- package/src/components/connectionStatusBar/index.d.ts +0 -33
- package/src/components/connectionStatusBar/types.d.ts +0 -28
- package/src/components/dash/index.d.ts +0 -19
- package/src/components/dateTimePicker/DateTimePicker.driver.d.ts +0 -7
- package/src/components/dateTimePicker/index.d.ts +0 -288
- package/src/components/dateTimePicker/useOldApi.d.ts +0 -27
- package/src/components/dialog/Dialog.driver.new.d.ts +0 -6
- package/src/components/dialog/DialogHeader.d.ts +0 -4
- package/src/components/dialog/index.d.ts +0 -15
- package/src/components/dialog/types.d.ts +0 -138
- package/src/components/dialog/useDialogContent.d.ts +0 -13
- package/src/components/drawer/Swipeable.d.ts +0 -94
- package/src/components/drawer/index.d.ts +0 -161
- package/src/components/expandableSection/index.d.ts +0 -40
- package/src/components/fadedScrollView/index.d.ts +0 -59
- package/src/components/fader/index.d.ts +0 -37
- package/src/components/featureHighlight/index.d.ts +0 -147
- package/src/components/floatingButton/index.d.ts +0 -85
- package/src/components/gradient/index.d.ts +0 -19
- package/src/components/gridList/index.d.ts +0 -5
- package/src/components/gridList/types.d.ts +0 -29
- package/src/components/gridList/useGridLayout.d.ts +0 -15
- package/src/components/gridListItem/index.d.ts +0 -132
- package/src/components/gridView/index.d.ts +0 -80
- package/src/components/hint/Hint.driver.d.ts +0 -6
- package/src/components/hint/Hint.driver.new.d.ts +0 -19
- package/src/components/hint/HintAnchor.d.ts +0 -13
- package/src/components/hint/HintBubble.d.ts +0 -12
- package/src/components/hint/HintMockChildren.d.ts +0 -8
- package/src/components/hint/HintOld.d.ts +0 -196
- package/src/components/hint/hooks/useHintAccessibility.d.ts +0 -10
- package/src/components/hint/hooks/useHintLayout.d.ts +0 -13
- package/src/components/hint/hooks/useHintPosition.d.ts +0 -29
- package/src/components/hint/hooks/useHintVisibility.d.ts +0 -6
- package/src/components/hint/index.d.ts +0 -14
- package/src/components/hint/types.d.ts +0 -106
- package/src/components/icon/index.d.ts +0 -97
- package/src/components/image/Image.driver.d.ts +0 -4
- package/src/components/image/Image.driver.new.d.ts +0 -2
- package/src/components/image/index.d.ts +0 -192
- package/src/components/listItem/ListItemPart.d.ts +0 -15
- package/src/components/listItem/index.d.ts +0 -52
- package/src/components/listItem/types.d.ts +0 -60
- package/src/components/loaderScreen/index.d.ts +0 -13
- package/src/components/loaderScreen/types.d.ts +0 -32
- package/src/components/marquee/index.d.ts +0 -5
- package/src/components/marquee/types.d.ts +0 -35
- package/src/components/maskedInput/index.d.ts +0 -5
- package/src/components/maskedInput/new.d.ts +0 -22
- package/src/components/modal/Modal.driver.new.d.ts +0 -8
- package/src/components/modal/TopBar.d.ts +0 -89
- package/src/components/modal/index.d.ts +0 -64
- package/src/components/numberInput/NumberInput.driver.d.ts +0 -6
- package/src/components/numberInput/Presenter.d.ts +0 -21
- package/src/components/numberInput/index.d.ts +0 -57
- package/src/components/overlay/index.d.ts +0 -68
- package/src/components/pageControl/index.d.ts +0 -56
- package/src/components/panView/index.d.ts +0 -21
- package/src/components/panView/panningUtil.d.ts +0 -38
- package/src/components/panView/usePanGesture.d.ts +0 -49
- package/src/components/picker/Picker.driver.new.d.ts +0 -44
- package/src/components/picker/PickerContext.d.ts +0 -4
- package/src/components/picker/PickerItem.d.ts +0 -11
- package/src/components/picker/PickerItemsList.d.ts +0 -4
- package/src/components/picker/PickerPresenter.d.ts +0 -7
- package/src/components/picker/PickerSelectionStatusBar.d.ts +0 -3
- package/src/components/picker/helpers/useFieldType.d.ts +0 -373
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +0 -5
- package/src/components/picker/helpers/useNewPickerProps.d.ts +0 -3
- package/src/components/picker/helpers/usePickerLabel.d.ts +0 -17
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +0 -4
- package/src/components/picker/helpers/usePickerSearch.d.ts +0 -9
- package/src/components/picker/helpers/usePickerSelection.d.ts +0 -16
- package/src/components/picker/index.d.ts +0 -15
- package/src/components/picker/types.d.ts +0 -321
- package/src/components/pieChart/PieSegment.d.ts +0 -34
- package/src/components/pieChart/index.d.ts +0 -15
- package/src/components/progressBar/index.d.ts +0 -65
- package/src/components/progressiveImage/index.d.ts +0 -23
- package/src/components/radioButton/RadioButton.driver.d.ts +0 -9
- package/src/components/radioButton/index.d.ts +0 -121
- package/src/components/radioGroup/RadioGroup.driver.d.ts +0 -13
- package/src/components/radioGroup/RadioGroupContext.d.ts +0 -14
- package/src/components/radioGroup/asRadioGroupChild.d.ts +0 -2
- package/src/components/radioGroup/index.d.ts +0 -47
- package/src/components/scrollBar/index.d.ts +0 -88
- package/src/components/searchInput/index.d.ts +0 -37
- package/src/components/searchInput/types.d.ts +0 -66
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +0 -25
- package/src/components/sectionsWheelPicker/index.d.ts +0 -43
- package/src/components/segmentedControl/index.d.ts +0 -90
- package/src/components/segmentedControl/segment.d.ts +0 -111
- package/src/components/segmentedControl/useSegmentedControlPreset.d.ts +0 -10
- package/src/components/skeletonView/index.d.ts +0 -163
- package/src/components/slider/ColorSliderGroup.d.ts +0 -13
- package/src/components/slider/GradientSlider.d.ts +0 -20
- package/src/components/slider/SliderContext.d.ts +0 -8
- package/src/components/slider/Thumb.d.ts +0 -32
- package/src/components/slider/index.d.ts +0 -31
- package/src/components/slider/slider.driver.d.ts +0 -5
- package/src/components/slider/types.d.ts +0 -197
- package/src/components/sortableGridList/SortableItem.d.ts +0 -6
- package/src/components/sortableGridList/index.d.ts +0 -5
- package/src/components/sortableGridList/types.d.ts +0 -34
- package/src/components/sortableGridList/usePresenter.d.ts +0 -21
- package/src/components/sortableList/SortableList.driver.new.d.ts +0 -2
- package/src/components/sortableList/SortableListContext.d.ts +0 -19
- package/src/components/sortableList/SortableListItem.d.ts +0 -8
- package/src/components/sortableList/SortableListItem.driver.new.d.ts +0 -11
- package/src/components/sortableList/index.d.ts +0 -5
- package/src/components/sortableList/types.d.ts +0 -48
- package/src/components/sortableList/usePresenter.d.ts +0 -12
- package/src/components/stackAggregator/index.d.ts +0 -89
- package/src/components/stateScreen/index.d.ts +0 -5
- package/src/components/stateScreen/types.d.ts +0 -30
- package/src/components/stepper/index.d.ts +0 -47
- package/src/components/svgImage/index.d.ts +0 -14
- package/src/components/svgImage/index.web.d.ts +0 -18
- package/src/components/switch/index.d.ts +0 -102
- package/src/components/switch/switch.driver.d.ts +0 -18
- package/src/components/tabController/PageCarousel.d.ts +0 -9
- package/src/components/tabController/TabBar.d.ts +0 -97
- package/src/components/tabController/TabBarContext.d.ts +0 -18
- package/src/components/tabController/TabBarItem.d.ts +0 -105
- package/src/components/tabController/TabPage.d.ts +0 -33
- package/src/components/tabController/index.d.ts +0 -48
- package/src/components/tabController/useImperativeTabControllerHandle.d.ts +0 -6
- package/src/components/tabController/useScrollToItem.d.ts +0 -79
- package/src/components/text/Text.driver.d.ts +0 -7
- package/src/components/text/Text.driver.new.d.ts +0 -17
- package/src/components/text/index.d.ts +0 -195
- package/src/components/textField/CharCounter.d.ts +0 -7
- package/src/components/textField/ClearButton.d.ts +0 -4
- package/src/components/textField/FieldContext.d.ts +0 -4
- package/src/components/textField/FloatingPlaceholder.d.ts +0 -7
- package/src/components/textField/Input.d.ts +0 -8
- package/src/components/textField/Label.d.ts +0 -7
- package/src/components/textField/Presenter.d.ts +0 -7
- package/src/components/textField/TextField.driver.new.d.ts +0 -129
- package/src/components/textField/ValidationMessage.d.ts +0 -7
- package/src/components/textField/index.d.ts +0 -114
- package/src/components/textField/presets/outline.d.ts +0 -737
- package/src/components/textField/presets/underline.d.ts +0 -735
- package/src/components/textField/textInput/index.d.ts +0 -1
- package/src/components/textField/textInput/index.web.d.ts +0 -3
- package/src/components/textField/types.d.ts +0 -287
- package/src/components/textField/useFieldState.d.ts +0 -16
- package/src/components/textField/useImperativeInputHandle.d.ts +0 -4
- package/src/components/textField/usePreset.d.ts +0 -1696
- package/src/components/textField/validators.d.ts +0 -9
- package/src/components/textFieldOld/index.d.ts +0 -71
- package/src/components/timeline/Line.d.ts +0 -10
- package/src/components/timeline/Point.d.ts +0 -9
- package/src/components/timeline/index.d.ts +0 -11
- package/src/components/timeline/line.driver.d.ts +0 -10
- package/src/components/timeline/point.driver.d.ts +0 -8
- package/src/components/timeline/timeline.driver.d.ts +0 -25
- package/src/components/timeline/types.d.ts +0 -50
- package/src/components/touchableOpacity/index.d.ts +0 -50
- package/src/components/view/View.driver.new.d.ts +0 -7
- package/src/components/view/index.d.ts +0 -46
- package/src/components/wizard/WizardStates.d.ts +0 -2
- package/src/components/wizard/WizardStep.d.ts +0 -4
- package/src/components/wizard/index.d.ts +0 -31
- package/src/components/wizard/types.d.ts +0 -90
- package/src/helpers/AvatarHelper.d.ts +0 -9
- package/src/helpers/FormattingPresenter.d.ts +0 -6
- package/src/helpers/Profiler.d.ts +0 -22
- package/src/helpers/index.d.ts +0 -3
- package/src/hooks/index.d.ts +0 -14
- package/src/hooks/useCombinedRefs/index.d.ts +0 -3
- package/src/hooks/useDebounce/index.d.ts +0 -5
- package/src/hooks/useDidUpdate/index.d.ts +0 -6
- package/src/hooks/useHiddenLocation/index.d.ts +0 -13
- package/src/hooks/useHiddenLocation/index.web.d.ts +0 -13
- package/src/hooks/useKeyboardHeight/index.d.ts +0 -5
- package/src/hooks/useMeasure/index.d.ts +0 -15
- package/src/hooks/useModifiers/index.d.ts +0 -3
- package/src/hooks/useOrientation/index.d.ts +0 -7
- package/src/hooks/useScrollEnabler/index.d.ts +0 -23
- package/src/hooks/useScrollReached/index.d.ts +0 -28
- package/src/hooks/useScrollTo/index.d.ts +0 -37
- package/src/hooks/useScrollToItem/index.d.ts +0 -65
- package/src/hooks/useThemeProps/index.d.ts +0 -2
- package/src/hooks/useToggleValue/index.d.ts +0 -2
- package/src/incubator/TouchableOpacity.d.ts +0 -52
- package/src/incubator/calendar/Agenda.d.ts +0 -4
- package/src/incubator/calendar/CalendarContext.d.ts +0 -4
- package/src/incubator/calendar/CalendarItem.d.ts +0 -5
- package/src/incubator/calendar/Day.d.ts +0 -4
- package/src/incubator/calendar/Day_OLD.d.ts +0 -4
- package/src/incubator/calendar/Header.d.ts +0 -4
- package/src/incubator/calendar/Month.d.ts +0 -4
- package/src/incubator/calendar/TodayButton.d.ts +0 -4
- package/src/incubator/calendar/Week.d.ts +0 -4
- package/src/incubator/calendar/WeekDaysNames.d.ts +0 -4
- package/src/incubator/calendar/helpers/CalendarProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DataProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DateUtils.d.ts +0 -23
- package/src/incubator/calendar/index.d.ts +0 -7
- package/src/incubator/calendar/types.d.ts +0 -118
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.d.ts +0 -7
- package/src/incubator/expandableOverlay/index.d.ts +0 -83
- package/src/incubator/gradient/BorderGradient.d.ts +0 -4
- package/src/incubator/gradient/CircleGradient.d.ts +0 -4
- package/src/incubator/gradient/RectangleGradient.d.ts +0 -4
- package/src/incubator/gradient/index.d.ts +0 -5
- package/src/incubator/gradient/types.d.ts +0 -26
- package/src/incubator/gradient/useAngleTransform.d.ts +0 -27
- package/src/incubator/index.d.ts +0 -9
- package/src/incubator/slider/Slider.driver.d.ts +0 -5
- package/src/incubator/slider/SliderPresenter.d.ts +0 -6
- package/src/incubator/slider/Thumb.d.ts +0 -24
- package/src/incubator/slider/Track.d.ts +0 -13
- package/src/incubator/slider/index.d.ts +0 -139
- package/src/incubator/toast/Toast.driver.new.d.ts +0 -54
- package/src/incubator/toast/helpers/useToastAnimation.d.ts +0 -22
- package/src/incubator/toast/helpers/useToastPresets.d.ts +0 -8
- package/src/incubator/toast/helpers/useToastTimer.d.ts +0 -6
- package/src/incubator/toast/index.d.ts +0 -9
- package/src/incubator/toast/types.d.ts +0 -111
- package/src/index.d.ts +0 -92
- package/src/optionalDependencies/BlurViewPackage.d.ts +0 -2
- package/src/optionalDependencies/BlurViewPackage.web.d.ts +0 -2
- package/src/optionalDependencies/DateTimePickerPackage.d.ts +0 -2
- package/src/optionalDependencies/FlashListPackage.d.ts +0 -2
- package/src/optionalDependencies/HapticFeedbackPackage.d.ts +0 -2
- package/src/optionalDependencies/LinearGradientPackage.d.ts +0 -2
- package/src/optionalDependencies/MomentPackage.d.ts +0 -2
- package/src/optionalDependencies/NetInfoPackage.d.ts +0 -2
- package/src/optionalDependencies/PostCssPackage.d.ts +0 -5
- package/src/optionalDependencies/ShimmerPackage.d.ts +0 -2
- package/src/optionalDependencies/SvgPackage.d.ts +0 -3
- package/src/optionalDependencies/index.d.ts +0 -9
- package/src/optionalDependencies/index.web.d.ts +0 -7
- package/src/services/HapticService.d.ts +0 -15
- package/src/services/LogService.d.ts +0 -35
- package/src/services/index.d.ts +0 -2
- package/src/style/borderRadiuses.d.ts +0 -30
- package/src/style/colorName.d.ts +0 -8
- package/src/style/colorNameMap.d.ts +0 -2
- package/src/style/colors.d.ts +0 -274
- package/src/style/colorsPalette.d.ts +0 -101
- package/src/style/components.d.ts +0 -15
- package/src/style/componentsColors.d.ts +0 -5
- package/src/style/designTokens.d.ts +0 -69
- package/src/style/designTokensDM.d.ts +0 -69
- package/src/style/dividers.d.ts +0 -11
- package/src/style/index.d.ts +0 -13
- package/src/style/scheme.d.ts +0 -57
- package/src/style/shadows.d.ts +0 -223
- package/src/style/spacings.d.ts +0 -32
- package/src/style/themeManager.d.ts +0 -22
- package/src/style/typography.d.ts +0 -26
- package/src/style/typographyPresets.d.ts +0 -7
- package/src/testkit/Component.driver.d.ts +0 -30
- package/src/testkit/DriverException.d.ts +0 -12
- package/src/testkit/UniDriver.d.ts +0 -29
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +0 -26
- package/src/testkit/index.d.ts +0 -25
- package/src/testkit/new/Component.driver.d.ts +0 -16
- package/src/testkit/new/useDraggable.driver.d.ts +0 -15
- package/src/testkit/new/usePressable.driver.d.ts +0 -14
- package/src/testkit/new/useScrollable.driver.d.ts +0 -13
- package/src/typings/assets.d.ts +0 -52
- package/src/typings/common.d.ts +0 -12
- package/src/typings/module.d.ts +0 -13
- package/src/typings/recorderTypes.d.ts +0 -13
- package/src/uilib-test-renderer/helper.d.ts +0 -8
- package/src/uilib-test-renderer/index.d.ts +0 -4
- package/src/uilib-test-renderer/scrollViewHelper.d.ts +0 -9
- package/src/utils/dateUtils.d.ts +0 -2
- package/src/utils/imageUtils.d.ts +0 -5
- package/src/utils/index.d.ts +0 -4
- package/src/utils/styleUtils.d.ts +0 -7
- package/src/utils/textUtils.d.ts +0 -8
- /package/{src → scripts/build}/.babelrc.exports.js +0 -0
package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.dynamicfont;
|
|
2
|
-
|
|
3
|
-
import android.app.Activity;
|
|
4
|
-
import android.graphics.Typeface;
|
|
5
|
-
import android.util.Base64;
|
|
6
|
-
|
|
7
|
-
import com.facebook.react.bridge.Callback;
|
|
8
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
10
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
11
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
12
|
-
import com.facebook.react.views.text.ReactFontManager;
|
|
13
|
-
|
|
14
|
-
import java.io.File;
|
|
15
|
-
import java.io.FileOutputStream;
|
|
16
|
-
|
|
17
|
-
public class DynamicFontModule extends ReactContextBaseJavaModule {
|
|
18
|
-
int tempNameCounter = 0;
|
|
19
|
-
|
|
20
|
-
public DynamicFontModule(ReactApplicationContext reactContext) {
|
|
21
|
-
super(reactContext);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
public String getName() {
|
|
26
|
-
return "DynamicFont";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// TODO: Needs to be tested
|
|
30
|
-
// @ReactMethod
|
|
31
|
-
// public void loadFontFromFile(final ReadableMap options, final Callback callback) {
|
|
32
|
-
// Activity currentActivity = getCurrentActivity();
|
|
33
|
-
// if (currentActivity == null) {
|
|
34
|
-
// callback.invoke("Invalid activity");
|
|
35
|
-
// return;
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
// String filePath = options.hasKey("filePath") ? options.getString("filePath") : null,
|
|
39
|
-
// name = (options.hasKey("name")) ? options.getString("name") : null;
|
|
40
|
-
|
|
41
|
-
// if (filePath == null || filePath.length() == 0) {
|
|
42
|
-
// callback.invoke("filePath property empty");
|
|
43
|
-
// return;
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
// File f = new File(filePath);
|
|
47
|
-
|
|
48
|
-
// if (f.exists() && f.canRead()) {
|
|
49
|
-
// boolean wasLoaded = false;
|
|
50
|
-
// try {
|
|
51
|
-
// Typeface typeface = Typeface.createFromFile(f);
|
|
52
|
-
// //Cache the font for react
|
|
53
|
-
// TODO: probably needs to be Typeface.NORMAL and not typeface.getStyle()
|
|
54
|
-
// ReactFontManager.getInstance().setTypeface(name, typeface.getStyle(), typeface);
|
|
55
|
-
// wasLoaded = true;
|
|
56
|
-
// } catch (Throwable e) {
|
|
57
|
-
// callback.invoke(e.getMessage());
|
|
58
|
-
// } finally {
|
|
59
|
-
// if (wasLoaded) {
|
|
60
|
-
// callback.invoke(null, name);
|
|
61
|
-
// }
|
|
62
|
-
// }
|
|
63
|
-
// } else {
|
|
64
|
-
// callback.invoke("invalid file");
|
|
65
|
-
// }
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
@ReactMethod
|
|
69
|
-
public void loadFont(final ReadableMap options, final Callback callback) throws Exception {
|
|
70
|
-
Activity currentActivity = getCurrentActivity();
|
|
71
|
-
if (currentActivity == null) {
|
|
72
|
-
callback.invoke("Invalid activity");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
String name = (options.hasKey("name")) ? options.getString("name") : null,
|
|
77
|
-
data = (options.hasKey("data")) ? options.getString("data") : null,
|
|
78
|
-
type = null;
|
|
79
|
-
|
|
80
|
-
if (name == null || name.length() == 0) {
|
|
81
|
-
callback.invoke("Name property empty");
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (data == null || data.length() == 0) {
|
|
86
|
-
callback.invoke("Data property empty");
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (("data:").equalsIgnoreCase(data.substring(0, 5))) {
|
|
91
|
-
Integer pos = data.indexOf(',');
|
|
92
|
-
if (pos > 0) {
|
|
93
|
-
String[] encodingParams = data.substring(5, pos).split(";");
|
|
94
|
-
String mimeType = encodingParams[0];
|
|
95
|
-
|
|
96
|
-
data = data.substring(pos + 1);
|
|
97
|
-
|
|
98
|
-
if (("application/x-font-ttf").equalsIgnoreCase(mimeType) ||
|
|
99
|
-
("application/x-font-truetype").equalsIgnoreCase(mimeType) ||
|
|
100
|
-
("font/ttf").equalsIgnoreCase(mimeType)) {
|
|
101
|
-
type = "ttf";
|
|
102
|
-
} else if (("application/x-font-opentype").equalsIgnoreCase(mimeType) ||
|
|
103
|
-
("font/opentype").equalsIgnoreCase(mimeType)) {
|
|
104
|
-
type = "otf";
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (options.hasKey("type"))
|
|
110
|
-
type = options.getString("type");
|
|
111
|
-
|
|
112
|
-
if (type == null)
|
|
113
|
-
type = "ttf";
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
byte[] decodedBytes = Base64.decode(data, Base64.DEFAULT);
|
|
117
|
-
File cacheFile = new File(currentActivity.getCacheDir(), "tempFont" + (tempNameCounter++) + type);
|
|
118
|
-
|
|
119
|
-
FileOutputStream stream = new FileOutputStream(cacheFile);
|
|
120
|
-
try {
|
|
121
|
-
stream.write(decodedBytes);
|
|
122
|
-
} finally {
|
|
123
|
-
stream.close();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
//Load the font from the temporary file we just created
|
|
127
|
-
Typeface typeface = Typeface.createFromFile(cacheFile);
|
|
128
|
-
|
|
129
|
-
//Cache the font for react
|
|
130
|
-
ReactFontManager.getInstance().setTypeface(name, Typeface.NORMAL, typeface);
|
|
131
|
-
|
|
132
|
-
cacheFile.delete();
|
|
133
|
-
} catch(Exception e) {
|
|
134
|
-
callback.invoke(e.getMessage());
|
|
135
|
-
} finally {
|
|
136
|
-
callback.invoke(null, name);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.dynamicfont;
|
|
2
|
-
|
|
3
|
-
import java.util.Arrays;
|
|
4
|
-
import java.util.Collections;
|
|
5
|
-
import java.util.List;
|
|
6
|
-
|
|
7
|
-
import com.facebook.react.ReactPackage;
|
|
8
|
-
import com.facebook.react.bridge.NativeModule;
|
|
9
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
10
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
11
|
-
import com.facebook.react.bridge.JavaScriptModule;
|
|
12
|
-
|
|
13
|
-
public class DynamicFontPackage implements ReactPackage {
|
|
14
|
-
@Override
|
|
15
|
-
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
16
|
-
return Arrays.<NativeModule>asList(new DynamicFontModule(reactContext));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Deprecated from RN 0.47
|
|
20
|
-
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
21
|
-
return Collections.emptyList();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
26
|
-
return Collections.emptyList();
|
|
27
|
-
}
|
|
28
|
-
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
import android.content.res.Resources;
|
|
4
|
-
import android.graphics.RectF;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
|
|
8
|
-
public class HighlightFrame {
|
|
9
|
-
public float x;
|
|
10
|
-
public float y;
|
|
11
|
-
public float width;
|
|
12
|
-
public float height;
|
|
13
|
-
|
|
14
|
-
public HighlightFrame(Resources resources, ReadableMap highlightFrameMap) {
|
|
15
|
-
if (highlightFrameMap != null) {
|
|
16
|
-
x = UiUtils.pxToDp(resources, highlightFrameMap.getDouble("x"));
|
|
17
|
-
y = UiUtils.pxToDp(resources, highlightFrameMap.getDouble("y"));
|
|
18
|
-
width = UiUtils.pxToDp(resources, highlightFrameMap.getDouble("width"));
|
|
19
|
-
height = UiUtils.pxToDp(resources, highlightFrameMap.getDouble("height"));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public HighlightFrame(float x, float y, float width, float height) {
|
|
24
|
-
this.x = x;
|
|
25
|
-
this.y = y;
|
|
26
|
-
this.width = width;
|
|
27
|
-
this.height = height;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public RectF toRect() {
|
|
31
|
-
return new RectF(x, y, x + width,y + height);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
import android.content.res.Resources;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
6
|
-
import com.facebook.react.bridge.ReadableType;
|
|
7
|
-
|
|
8
|
-
public class HighlightViewTagParams {
|
|
9
|
-
public float paddingTop = 0;
|
|
10
|
-
public float paddingLeft = 0;
|
|
11
|
-
public float paddingBottom = 0;
|
|
12
|
-
public float paddingRight = 0;
|
|
13
|
-
public float offsetX = 0;
|
|
14
|
-
public float offsetY = 0;
|
|
15
|
-
|
|
16
|
-
public HighlightViewTagParams(Resources resources, ReadableMap highlightViewTagParams) {
|
|
17
|
-
if (highlightViewTagParams != null) {
|
|
18
|
-
if (highlightViewTagParams.hasKey("padding")) {
|
|
19
|
-
if (highlightViewTagParams.getType("padding") == ReadableType.Number) {
|
|
20
|
-
float paddingValue = UiUtils.pxToDp(resources, highlightViewTagParams.getDouble("padding"));
|
|
21
|
-
paddingTop = paddingLeft = paddingBottom = paddingRight = paddingValue;
|
|
22
|
-
} else if (highlightViewTagParams.getType("padding") == ReadableType.Map) {
|
|
23
|
-
ReadableMap paddingMap = highlightViewTagParams.getMap("padding");
|
|
24
|
-
if (paddingMap.hasKey("top")) {
|
|
25
|
-
paddingTop = UiUtils.pxToDp(resources, paddingMap.getDouble("top"));
|
|
26
|
-
}
|
|
27
|
-
if (paddingMap.hasKey("left")) {
|
|
28
|
-
paddingLeft = UiUtils.pxToDp(resources, paddingMap.getDouble("left"));
|
|
29
|
-
}
|
|
30
|
-
if (paddingMap.hasKey("bottom")) {
|
|
31
|
-
paddingBottom = UiUtils.pxToDp(resources, paddingMap.getDouble("bottom"));
|
|
32
|
-
}
|
|
33
|
-
if (paddingMap.hasKey("right")) {
|
|
34
|
-
paddingRight = UiUtils.pxToDp(resources, paddingMap.getDouble("right"));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (highlightViewTagParams.hasKey("offset")) {
|
|
40
|
-
ReadableMap offsetMap = highlightViewTagParams.getMap("offset");
|
|
41
|
-
if (offsetMap.hasKey("x")) {
|
|
42
|
-
offsetX = UiUtils.pxToDp(resources, offsetMap.getDouble("x"));
|
|
43
|
-
}
|
|
44
|
-
if (offsetMap.hasKey("y")) {
|
|
45
|
-
offsetY = UiUtils.pxToDp(resources, offsetMap.getDouble("y"));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
import android.annotation.TargetApi;
|
|
4
|
-
import android.content.Context;
|
|
5
|
-
import android.graphics.Canvas;
|
|
6
|
-
import android.graphics.Paint;
|
|
7
|
-
import android.graphics.PorterDuff;
|
|
8
|
-
import android.graphics.PorterDuffXfermode;
|
|
9
|
-
import android.graphics.RectF;
|
|
10
|
-
import android.view.View;
|
|
11
|
-
import android.util.SizeF;
|
|
12
|
-
|
|
13
|
-
import androidx.annotation.ColorInt;
|
|
14
|
-
|
|
15
|
-
public class HighlighterView extends View {
|
|
16
|
-
private RectF highlightFrame;
|
|
17
|
-
private RectF viewBasedHighlightFrame;
|
|
18
|
-
HighlightViewTagParams highlightViewTagParams;
|
|
19
|
-
private @ColorInt
|
|
20
|
-
int overlayColor;
|
|
21
|
-
private @ColorInt int strokeColor;
|
|
22
|
-
private float strokeWidth;
|
|
23
|
-
private float borderRadius;
|
|
24
|
-
private SizeF minimumRectSize;
|
|
25
|
-
private float innerPadding;
|
|
26
|
-
|
|
27
|
-
private static final PorterDuffXfermode porterDuffXfermode = new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
|
|
28
|
-
private static final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
|
29
|
-
|
|
30
|
-
public HighlighterView(Context context) {
|
|
31
|
-
super(context);
|
|
32
|
-
setLayerType(LAYER_TYPE_HARDWARE, null);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private RectF rectToDraw() {
|
|
36
|
-
if (viewBasedHighlightFrame != null && viewBasedHighlightFrame.width() > 0 && viewBasedHighlightFrame.height() > 0) {
|
|
37
|
-
if (highlightViewTagParams == null) {
|
|
38
|
-
RectF frame = adjustFrame(viewBasedHighlightFrame);
|
|
39
|
-
return frame;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
RectF highlightRect = new RectF(viewBasedHighlightFrame);
|
|
43
|
-
highlightRect.left -= highlightViewTagParams.paddingLeft;
|
|
44
|
-
highlightRect.top -= highlightViewTagParams.paddingTop;
|
|
45
|
-
highlightRect.right += highlightViewTagParams.paddingRight;
|
|
46
|
-
highlightRect.bottom += highlightViewTagParams.paddingBottom;
|
|
47
|
-
|
|
48
|
-
if (highlightViewTagParams.offsetX > 0) {
|
|
49
|
-
highlightRect.left += highlightViewTagParams.offsetX;
|
|
50
|
-
highlightRect.right += highlightViewTagParams.offsetX;
|
|
51
|
-
}
|
|
52
|
-
if (highlightViewTagParams.offsetY > 0) {
|
|
53
|
-
highlightRect.top += highlightViewTagParams.offsetY;
|
|
54
|
-
highlightRect.bottom += highlightViewTagParams.offsetY;
|
|
55
|
-
}
|
|
56
|
-
return highlightRect;
|
|
57
|
-
} else {
|
|
58
|
-
return highlightFrame;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
private float getRadius(RectF rect) {
|
|
63
|
-
float newRadius = 0;
|
|
64
|
-
if (borderRadius > 0) {
|
|
65
|
-
newRadius = borderRadius;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
if (rect != null) {
|
|
69
|
-
newRadius = Math.min(rect.width() / 2, rect.height() / 2);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return newRadius;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public void setHighlightFrame(HighlightFrame frame) {
|
|
76
|
-
highlightFrame = frame.toRect();
|
|
77
|
-
invalidate();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public void setOverlayColor(@ColorInt int overlayColor) {
|
|
81
|
-
this.overlayColor = overlayColor;
|
|
82
|
-
invalidate();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public void setStrokeColor(@ColorInt int strokeColor) {
|
|
86
|
-
this.strokeColor = strokeColor;
|
|
87
|
-
invalidate();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public void setStrokeWidth(int strokeWidth) {
|
|
91
|
-
this.strokeWidth = UiUtils.pxToDp(getResources(), strokeWidth);
|
|
92
|
-
invalidate();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
public void setBorderRadius(int borderRadius) {
|
|
96
|
-
this.borderRadius = UiUtils.pxToDp(getResources(), borderRadius);
|
|
97
|
-
invalidate();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public void setViewBasedHighlightFrame(HighlightFrame viewBasedHighlightFrame) {
|
|
101
|
-
this.viewBasedHighlightFrame = viewBasedHighlightFrame.toRect();
|
|
102
|
-
invalidate();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
public void setHighlightViewTagParams(HighlightViewTagParams highlightViewTagParams) {
|
|
106
|
-
this.highlightViewTagParams = highlightViewTagParams;
|
|
107
|
-
invalidate();
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@TargetApi(21)
|
|
111
|
-
public void setMinimumRectSize(SizeF minimumRectSize) {
|
|
112
|
-
float width = UiUtils.pxToDp(getResources(), minimumRectSize.getWidth());
|
|
113
|
-
float height = UiUtils.pxToDp(getResources(), minimumRectSize.getHeight());
|
|
114
|
-
this.minimumRectSize = new SizeF(width, height);
|
|
115
|
-
invalidate();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
public void setInnerPadding(int innerPadding) {
|
|
119
|
-
this.innerPadding = UiUtils.pxToDp(getResources(), innerPadding); //innerPadding;
|
|
120
|
-
invalidate();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@TargetApi(21)
|
|
124
|
-
public RectF adjustFrame(RectF frame) {
|
|
125
|
-
float x = frame.left;
|
|
126
|
-
float y = frame.top;
|
|
127
|
-
float fWidth = frame.right - frame.left;
|
|
128
|
-
float fHeight = frame.bottom - frame.top;
|
|
129
|
-
float width = fWidth + (innerPadding * 2);
|
|
130
|
-
float height = fHeight + (innerPadding * 2);
|
|
131
|
-
if (minimumRectSize != null) {
|
|
132
|
-
width = width < minimumRectSize.getWidth() ? minimumRectSize.getWidth() : width;
|
|
133
|
-
height = height < minimumRectSize.getHeight() ? minimumRectSize.getHeight() : height;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
x = x - ((width - fWidth) / 2);
|
|
137
|
-
y = y - ((height - fHeight) / 2);
|
|
138
|
-
|
|
139
|
-
return new RectF(x, y, x + width, y + height); // float left, float top, float right, float bottom
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@Override
|
|
143
|
-
public void onDraw(Canvas canvas) {
|
|
144
|
-
super.onDraw(canvas);
|
|
145
|
-
|
|
146
|
-
paint.setColor(overlayColor);
|
|
147
|
-
paint.setStyle(Paint.Style.FILL);
|
|
148
|
-
canvas.drawPaint(paint);
|
|
149
|
-
|
|
150
|
-
RectF rect = rectToDraw();
|
|
151
|
-
float radius = getRadius(rect);
|
|
152
|
-
|
|
153
|
-
if(rect != null) {
|
|
154
|
-
paint.setXfermode(porterDuffXfermode);
|
|
155
|
-
|
|
156
|
-
canvas.drawRoundRect(rect, radius, radius, paint);
|
|
157
|
-
|
|
158
|
-
if (strokeWidth > 0) {
|
|
159
|
-
paint.setXfermode(null);
|
|
160
|
-
paint.setColor(strokeColor);
|
|
161
|
-
paint.setStrokeWidth(strokeWidth);
|
|
162
|
-
paint.setStyle(Paint.Style.STROKE);
|
|
163
|
-
canvas.drawRoundRect(rect, radius, radius, paint);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
import android.annotation.TargetApi;
|
|
4
|
-
import android.app.Activity;
|
|
5
|
-
import android.graphics.Rect;
|
|
6
|
-
import android.util.Log;
|
|
7
|
-
import android.util.SizeF;
|
|
8
|
-
import android.view.View;
|
|
9
|
-
|
|
10
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
11
|
-
import com.facebook.react.bridge.UIManager;
|
|
12
|
-
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
13
|
-
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
14
|
-
import com.facebook.react.uimanager.SimpleViewManager;
|
|
15
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
16
|
-
import com.facebook.react.uimanager.UIManagerHelper;
|
|
17
|
-
import com.facebook.react.uimanager.UIManagerModule;
|
|
18
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
19
|
-
import com.facebook.react.uimanager.common.UIManagerType;
|
|
20
|
-
|
|
21
|
-
import javax.annotation.Nullable;
|
|
22
|
-
|
|
23
|
-
class HighlighterViewManager extends SimpleViewManager<HighlighterView> {
|
|
24
|
-
private static final String REACT_CLASS = "HighlighterView";
|
|
25
|
-
|
|
26
|
-
private ThemedReactContext context;
|
|
27
|
-
|
|
28
|
-
@Override
|
|
29
|
-
public String getName() {
|
|
30
|
-
return REACT_CLASS;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Override
|
|
34
|
-
public HighlighterView createViewInstance(ThemedReactContext context) {
|
|
35
|
-
this.context = context;
|
|
36
|
-
HighlighterView view = new HighlighterView(context);
|
|
37
|
-
view.setFitsSystemWindows(true);
|
|
38
|
-
return view;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@ReactProp(name = "highlightFrame")
|
|
42
|
-
public void setHighlightFrame(HighlighterView view, ReadableMap highlightFrame) {
|
|
43
|
-
view.setHighlightFrame(new HighlightFrame(view.getResources(), highlightFrame));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@ReactProp(name = "overlayColor")
|
|
47
|
-
public void setOverlayColor(HighlighterView view, @Nullable Integer overlayColor) {
|
|
48
|
-
view.setOverlayColor((overlayColor == null) ? 0 : overlayColor);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@ReactProp(name = "borderRadius")
|
|
52
|
-
public void setBorderRadius(HighlighterView view, @Nullable Integer borderRadius) {
|
|
53
|
-
view.setBorderRadius((borderRadius == null) ? 0 : borderRadius);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@ReactProp(name = "strokeColor")
|
|
57
|
-
public void setStrokeColor(HighlighterView view, @Nullable Integer strokeColor) {
|
|
58
|
-
view.setStrokeColor((strokeColor == null) ? 0 : strokeColor);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@ReactProp(name = "strokeWidth")
|
|
62
|
-
public void setStrokeWidth(HighlighterView view, @Nullable Integer strokeWidth) {
|
|
63
|
-
view.setStrokeWidth((strokeWidth == null) ? 0 : strokeWidth);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@TargetApi(21)
|
|
67
|
-
@ReactProp(name = "minimumRectSize")
|
|
68
|
-
public void setMinimumRectSize(HighlighterView view, ReadableMap minimumRectSize) {
|
|
69
|
-
float width = (float) minimumRectSize.getDouble("width");
|
|
70
|
-
float height = (float) minimumRectSize.getDouble("height");
|
|
71
|
-
view.setMinimumRectSize(new SizeF(width, height));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@ReactProp(name = "innerPadding")
|
|
75
|
-
public void setInnerPadding(HighlighterView view, @Nullable Integer innerPadding) {
|
|
76
|
-
view.setInnerPadding((innerPadding == null) ? 0 : innerPadding);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@ReactProp(name = "highlightViewTag")
|
|
80
|
-
public void setHighlightViewTag(final HighlighterView view, Integer highlightViewTag) {
|
|
81
|
-
if (highlightViewTag != null) {
|
|
82
|
-
try {
|
|
83
|
-
UIManager uiManager = UIManagerHelper.getUIManagerForReactTag(context, highlightViewTag);
|
|
84
|
-
if (uiManager != null) {
|
|
85
|
-
final View resolvedView = uiManager.resolveView(highlightViewTag);
|
|
86
|
-
if (resolvedView != null) {
|
|
87
|
-
if (resolvedView.getWidth() == 0 || resolvedView.getHeight() == 0) {
|
|
88
|
-
resolvedView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
|
89
|
-
@Override
|
|
90
|
-
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
|
91
|
-
float width = right - left;
|
|
92
|
-
float height = bottom - top;
|
|
93
|
-
if (width > 0 && height > 0) {
|
|
94
|
-
setViewBasedHighlightFrame(view, resolvedView);
|
|
95
|
-
resolvedView.removeOnLayoutChangeListener(this);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
setViewBasedHighlightFrame(view, resolvedView);
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
Log.e("HighlighterView", "was not able to resolve highlightViewTag: " + highlightViewTag.toString());
|
|
104
|
-
}
|
|
105
|
-
} else {
|
|
106
|
-
Log.e("HighlighterView", "was not able to resolve get uiManager for highlightViewTag: " + highlightViewTag.toString());
|
|
107
|
-
}
|
|
108
|
-
} catch (IllegalViewOperationException e) {
|
|
109
|
-
Log.e("HighlighterView", "invalid highlightViewTag: " + highlightViewTag.toString() + " " + e.toString());
|
|
110
|
-
}
|
|
111
|
-
} else {
|
|
112
|
-
Log.e("HighlighterView", "highlightViewTag is null");
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@ReactProp(name = "highlightViewTagParams")
|
|
117
|
-
public void setHighlightViewTagParams(HighlighterView view, ReadableMap highlightViewTagParams) {
|
|
118
|
-
view.setHighlightViewTagParams(new HighlightViewTagParams(view.getResources(), highlightViewTagParams));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
private void setViewBasedHighlightFrame(HighlighterView view, View resolvedView) {
|
|
122
|
-
Activity currentActivity = context.getCurrentActivity();
|
|
123
|
-
if (currentActivity == null) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
final float topOffset = UiUtils.getStatusBarHeight(view, currentActivity.getWindow());
|
|
128
|
-
Rect myViewRect = UiUtils.getVisibleRect(resolvedView);
|
|
129
|
-
view.setViewBasedHighlightFrame(new HighlightFrame(myViewRect.left, myViewRect.top - topOffset, resolvedView.getWidth(), resolvedView.getHeight()));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactPackage;
|
|
4
|
-
import com.facebook.react.bridge.JavaScriptModule;
|
|
5
|
-
import com.facebook.react.bridge.NativeModule;
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
8
|
-
|
|
9
|
-
import java.util.Arrays;
|
|
10
|
-
import java.util.Collections;
|
|
11
|
-
import java.util.List;
|
|
12
|
-
|
|
13
|
-
public class HighlighterViewPackage implements ReactPackage {
|
|
14
|
-
|
|
15
|
-
@Override
|
|
16
|
-
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
17
|
-
return Collections.emptyList();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
21
|
-
return Collections.emptyList();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
26
|
-
return Arrays.<ViewManager>asList( new HighlighterViewManager() );
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|