@momo-kits/native-kits 0.157.1-beta.9-debug → 0.157.1-com.1-debug
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/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +350 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +449 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +21 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
- package/gradle.properties +1 -1
- package/ios/Input/Input.swift +4 -0
- package/local.properties +2 -2
- package/package.json +1 -1
- package/src/doctor/README.md +73 -0
- package/src/doctor/package-lock.json +885 -0
- package/src/doctor/package.json +44 -0
- package/src/doctor/publish.sh +27 -0
- package/src/doctor/src/Users.json +112 -0
- package/src/doctor/src/Whitelist.json +6 -0
- package/src/doctor/src/commands/check.ts +81 -0
- package/src/doctor/src/commands/doctor.ts +193 -0
- package/src/doctor/src/index.ts +35 -0
- package/src/doctor/src/logger.ts +84 -0
- package/src/doctor/src/task/native.ts +21 -0
- package/src/doctor/src/task/utils.ts +20 -0
- package/src/doctor/src/utils/checkCoreDependencies.ts +138 -0
- package/src/doctor/src/utils/checkDeletedPackage.ts +53 -0
- package/src/doctor/src/utils/checkDeprecatedPackages.ts +168 -0
- package/src/doctor/src/utils/checkDeprecatedVersion.ts +60 -0
- package/src/doctor/src/utils/checkShareDependencies.ts +251 -0
- package/src/doctor/src/utils/checkWrongVersionCommunityPackage.ts +64 -0
- package/src/doctor/src/utils/getErrorMessage.ts +84 -0
- package/src/doctor/src/utils/scanComponentUsage.ts +206 -0
- package/src/doctor/src/utils/scanFoundationImports.ts +169 -0
- package/src/doctor/src/utils/scanMaxApiUsage.ts +86 -0
- package/src/doctor/src/utils/scanNativeModulesUsage.ts +78 -0
- package/src/doctor/src/utils/sendMessage.ts +28 -0
- package/src/doctor/tsconfig.json +14 -0
- package/src/doctor/yarn.lock +492 -0
- package/src/foundations/Application/BottomSheet.tsx +358 -0
- package/src/foundations/Application/BottomTab/BottomTabBar.tsx +320 -0
- package/src/foundations/Application/BottomTab/CustomBottomTabItem.tsx +155 -0
- package/src/foundations/Application/BottomTab/TabBarIcon.tsx +113 -0
- package/src/foundations/Application/BottomTab/index.tsx +449 -0
- package/src/foundations/Application/Components/BackgroundImageView.tsx +126 -0
- package/src/foundations/Application/Components/HeaderAnimated.tsx +69 -0
- package/src/foundations/Application/Components/HeaderBackground.tsx +83 -0
- package/src/foundations/Application/Components/HeaderExtendHeader.tsx +225 -0
- package/src/foundations/Application/Components/HeaderLeft.tsx +93 -0
- package/src/foundations/Application/Components/HeaderRight.tsx +444 -0
- package/src/foundations/Application/Components/HeaderTitle.tsx +596 -0
- package/src/foundations/Application/Components/NavigationButton.tsx +76 -0
- package/src/foundations/Application/Components/SearchHeader.tsx +127 -0
- package/src/foundations/Application/Localize.ts +44 -0
- package/src/foundations/Application/ModalScreen.tsx +148 -0
- package/src/foundations/Application/Navigation.ts +63 -0
- package/src/foundations/Application/NavigationContainer.tsx +245 -0
- package/src/foundations/Application/Navigator.ts +171 -0
- package/src/foundations/Application/ScaleSizeProvider.tsx +16 -0
- package/src/foundations/Application/StackScreen.tsx +420 -0
- package/src/foundations/Application/TooltipPortal.tsx +127 -0
- package/src/foundations/Application/WidgetContainer.tsx +162 -0
- package/src/foundations/Application/index.ts +34 -0
- package/src/foundations/Application/types.ts +350 -0
- package/src/foundations/Application/utils.tsx +239 -0
- package/src/foundations/Assets/DotAnimation.json +256 -0
- package/src/foundations/Assets/SpinnerAnimation.json +1027 -0
- package/src/foundations/Assets/icon.json +4052 -0
- package/src/foundations/Assets/icon_bank.json +506 -0
- package/src/foundations/Assets/language.json +208 -0
- package/src/foundations/Assets/lottie_circle_loader.json +1 -0
- package/src/foundations/Assets/pinAnimation.json +1 -0
- package/src/foundations/Assets/unpinAnimation.json +1 -0
- package/src/foundations/Badge/Badge.tsx +104 -0
- package/src/foundations/Badge/BadgeDot.tsx +35 -0
- package/src/foundations/Badge/BadgeDotAnimation.tsx +95 -0
- package/src/foundations/Badge/BadgeRibbon.tsx +112 -0
- package/src/foundations/Badge/Shape.tsx +29 -0
- package/src/foundations/Badge/index.tsx +8 -0
- package/src/foundations/Badge/styles.ts +125 -0
- package/src/foundations/Badge/types.ts +68 -0
- package/src/foundations/Button/index.tsx +371 -0
- package/src/foundations/Button/styles.ts +65 -0
- package/src/foundations/CheckBox/index.tsx +104 -0
- package/src/foundations/CheckBox/styles.ts +17 -0
- package/src/foundations/CheckBox/types.ts +37 -0
- package/src/foundations/Consts/colors+spacing+radius.ts +232 -0
- package/src/foundations/Consts/index.ts +4 -0
- package/src/foundations/Consts/styles.ts +52 -0
- package/src/foundations/Consts/theme.ts +121 -0
- package/src/foundations/Context/index.ts +27 -0
- package/src/foundations/Divider/DashDivider.tsx +46 -0
- package/src/foundations/Divider/index.tsx +45 -0
- package/src/foundations/FoundationList/index.tsx +12 -0
- package/src/foundations/FoundationList/types.ts +7 -0
- package/src/foundations/Icon/index.tsx +57 -0
- package/src/foundations/Icon/types.ts +32 -0
- package/src/foundations/IconButton/index.tsx +144 -0
- package/src/foundations/IconButton/styles.ts +20 -0
- package/src/foundations/Image/index.tsx +115 -0
- package/src/foundations/Image/styles.ts +7 -0
- package/src/foundations/Image/types.ts +7 -0
- package/src/foundations/Input/Input.tsx +280 -0
- package/src/foundations/Input/InputDropDown.tsx +161 -0
- package/src/foundations/Input/InputMoney.tsx +325 -0
- package/src/foundations/Input/InputOTP.tsx +299 -0
- package/src/foundations/Input/InputPhoneNumber.tsx +287 -0
- package/src/foundations/Input/InputSearch.tsx +351 -0
- package/src/foundations/Input/InputTextArea.tsx +218 -0
- package/src/foundations/Input/SystemTextInput.tsx +44 -0
- package/src/foundations/Input/TextTyping.tsx +115 -0
- package/src/foundations/Input/common.tsx +243 -0
- package/src/foundations/Input/index.tsx +373 -0
- package/src/foundations/Input/styles.ts +226 -0
- package/src/foundations/Input/utils.ts +97 -0
- package/src/foundations/Layout/Card.tsx +108 -0
- package/src/foundations/Layout/FloatingButton.tsx +179 -0
- package/src/foundations/Layout/GridSystem.tsx +137 -0
- package/src/foundations/Layout/Item.tsx +59 -0
- package/src/foundations/Layout/ItemList.tsx +66 -0
- package/src/foundations/Layout/ItemSectionList.tsx +40 -0
- package/src/foundations/Layout/Screen.tsx +644 -0
- package/src/foundations/Layout/Section.tsx +103 -0
- package/src/foundations/Layout/TrackingScope.tsx +18 -0
- package/src/foundations/Layout/index.ts +34 -0
- package/src/foundations/Layout/styles.ts +95 -0
- package/src/foundations/Layout/types.ts +40 -0
- package/src/foundations/Layout/utils.ts +47 -0
- package/src/foundations/Loader/DotLoader.tsx +37 -0
- package/src/foundations/Loader/Loader.tsx +13 -0
- package/src/foundations/Loader/ProgressBar.tsx +45 -0
- package/src/foundations/Loader/Spinner.tsx +29 -0
- package/src/foundations/Loader/index.tsx +6 -0
- package/src/foundations/Loader/styles.ts +10 -0
- package/src/foundations/Loader/types.ts +35 -0
- package/src/foundations/Loader/utils.ts +25 -0
- package/src/foundations/Pagination/Dot.tsx +19 -0
- package/src/foundations/Pagination/PaginationDot.tsx +44 -0
- package/src/foundations/Pagination/PaginationNumber.tsx +31 -0
- package/src/foundations/Pagination/PaginationScroll.tsx +99 -0
- package/src/foundations/Pagination/PaginationWhiteDot.tsx +43 -0
- package/src/foundations/Pagination/index.tsx +25 -0
- package/src/foundations/Pagination/styles.ts +51 -0
- package/src/foundations/Pagination/types.ts +40 -0
- package/src/foundations/Popup/PopupNotify.tsx +276 -0
- package/src/foundations/Popup/PopupPromotion.tsx +118 -0
- package/src/foundations/Popup/index.tsx +4 -0
- package/src/foundations/Popup/types.ts +96 -0
- package/src/foundations/Radio/index.tsx +108 -0
- package/src/foundations/Radio/styles.ts +15 -0
- package/src/foundations/Radio/types.ts +31 -0
- package/src/foundations/Skeleton/index.tsx +118 -0
- package/src/foundations/Skeleton/styles.ts +5 -0
- package/src/foundations/Skeleton/types.ts +6 -0
- package/src/foundations/Switch/index.tsx +68 -0
- package/src/foundations/Switch/styles.ts +25 -0
- package/src/foundations/Switch/types.ts +19 -0
- package/src/foundations/Tag/index.tsx +128 -0
- package/src/foundations/Tag/types.ts +41 -0
- package/src/foundations/Text/index.tsx +241 -0
- package/src/foundations/Text/styles.ts +78 -0
- package/src/foundations/Text/types.ts +53 -0
- package/src/foundations/Text/utils.ts +63 -0
- package/src/foundations/Title/index.tsx +285 -0
- package/src/foundations/Title/styles.ts +55 -0
- package/src/foundations/Title/types.ts +21 -0
- package/src/foundations/index.ts +50 -0
- package/src/foundations/package.json +35 -0
- package/src/foundations/publish.sh +17 -0
- package/src/libs/AutoComplete/index.tsx +88 -0
- package/src/libs/AutoComplete/package.json +16 -0
- package/src/libs/AutoComplete/publish.sh +16 -0
- package/src/libs/AutoComplete/styles.ts +15 -0
- package/src/libs/AutoComplete/types.ts +60 -0
- package/src/libs/Avatar/index.tsx +146 -0
- package/src/libs/Avatar/package.json +16 -0
- package/src/libs/Avatar/publish.sh +20 -0
- package/src/libs/Avatar/styles.ts +18 -0
- package/src/libs/Avatar/types.ts +57 -0
- package/src/libs/Badge/Badge.tsx +70 -0
- package/src/libs/Badge/BadgeDot.tsx +11 -0
- package/src/libs/Badge/BadgeRibbon.tsx +122 -0
- package/src/libs/Badge/Shape.tsx +29 -0
- package/src/libs/Badge/index.tsx +7 -0
- package/src/libs/Badge/package.json +16 -0
- package/src/libs/Badge/publish.sh +18 -0
- package/src/libs/Badge/styles.ts +55 -0
- package/src/libs/Badge/types.ts +63 -0
- package/src/libs/Calendar/CalendarPro.tsx +307 -0
- package/src/libs/Calendar/Day.tsx +150 -0
- package/src/libs/Calendar/HeaderControl.tsx +55 -0
- package/src/libs/Calendar/LunarDateConverter.ts +228 -0
- package/src/libs/Calendar/LunarService.ts +206 -0
- package/src/libs/Calendar/Month.tsx +118 -0
- package/src/libs/Calendar/MonthList.tsx +226 -0
- package/src/libs/Calendar/TabHeader.tsx +91 -0
- package/src/libs/Calendar/Util.ts +288 -0
- package/src/libs/Calendar/holidayData.ts +118 -0
- package/src/libs/Calendar/index.tsx +383 -0
- package/src/libs/Calendar/package.json +18 -0
- package/src/libs/Calendar/publish.sh +18 -0
- package/src/libs/Calendar/styles.ts +122 -0
- package/src/libs/Calendar/types.ts +212 -0
- package/src/libs/Carousel/animation.ts +62 -0
- package/src/libs/Carousel/index.tsx +517 -0
- package/src/libs/Carousel/package.json +18 -0
- package/src/libs/Carousel/publish.sh +16 -0
- package/src/libs/Carousel/types.ts +71 -0
- package/src/libs/Chip/index.tsx +164 -0
- package/src/libs/Chip/package.json +16 -0
- package/src/libs/Chip/publish.sh +16 -0
- package/src/libs/Chip/styles.ts +20 -0
- package/src/libs/Chip/types.ts +72 -0
- package/src/libs/Collapse/index.tsx +305 -0
- package/src/libs/Collapse/package.json +16 -0
- package/src/libs/Collapse/publish.sh +18 -0
- package/src/libs/Collapse/styles.ts +37 -0
- package/src/libs/Collapse/types.ts +84 -0
- package/src/libs/DateTimePicker/WheelPicker.tsx +163 -0
- package/src/libs/DateTimePicker/WheelPickerItem.tsx +58 -0
- package/src/libs/DateTimePicker/index.tsx +188 -0
- package/src/libs/DateTimePicker/package.json +16 -0
- package/src/libs/DateTimePicker/publish.sh +17 -0
- package/src/libs/DateTimePicker/styles.ts +31 -0
- package/src/libs/DateTimePicker/types.ts +102 -0
- package/src/libs/DateTimePicker/utils.ts +114 -0
- package/src/libs/Information/index.tsx +129 -0
- package/src/libs/Information/package.json +16 -0
- package/src/libs/Information/publish.sh +18 -0
- package/src/libs/Information/styles.ts +34 -0
- package/src/libs/Information/types.ts +79 -0
- package/src/libs/Logo/index.tsx +39 -0
- package/src/libs/Logo/package.json +17 -0
- package/src/libs/Logo/publish.sh +16 -0
- package/src/libs/Logo/styles.ts +25 -0
- package/src/libs/Logo/types.ts +13 -0
- package/src/libs/ProgressInfo/ProgressInfoHorizontal.tsx +128 -0
- package/src/libs/ProgressInfo/ProgressInfoIcon.tsx +88 -0
- package/src/libs/ProgressInfo/ProgressInfoVertical.tsx +85 -0
- package/src/libs/ProgressInfo/index.tsx +22 -0
- package/src/libs/ProgressInfo/package.json +16 -0
- package/src/libs/ProgressInfo/publish.sh +16 -0
- package/src/libs/ProgressInfo/styles.ts +46 -0
- package/src/libs/ProgressInfo/types.ts +60 -0
- package/src/libs/ProgressInfo/yarn.lock +8 -0
- package/src/libs/Rating/index.tsx +74 -0
- package/src/libs/Rating/package.json +16 -0
- package/src/libs/Rating/publish.sh +18 -0
- package/src/libs/Rating/type.ts +25 -0
- package/src/libs/Slider/Label.tsx +33 -0
- package/src/libs/Slider/helpers.ts +35 -0
- package/src/libs/Slider/hooks.tsx +218 -0
- package/src/libs/Slider/index.tsx +453 -0
- package/src/libs/Slider/package.json +16 -0
- package/src/libs/Slider/publish.sh +18 -0
- package/src/libs/Slider/styles.ts +36 -0
- package/src/libs/Stepper/NumberView.tsx +64 -0
- package/src/libs/Stepper/StepperButton.tsx +37 -0
- package/src/libs/Stepper/index.tsx +139 -0
- package/src/libs/Stepper/package.json +16 -0
- package/src/libs/Stepper/publish.sh +17 -0
- package/src/libs/Stepper/styles.ts +44 -0
- package/src/libs/Stepper/types.ts +154 -0
- package/src/libs/Steps/StepIcon.tsx +86 -0
- package/src/libs/Steps/StepsHorizontal.tsx +189 -0
- package/src/libs/Steps/StepsVertical.tsx +133 -0
- package/src/libs/Steps/index.tsx +20 -0
- package/src/libs/Steps/package.json +16 -0
- package/src/libs/Steps/publish.sh +16 -0
- package/src/libs/Steps/styles.ts +46 -0
- package/src/libs/Steps/types.ts +159 -0
- package/src/libs/Steps/utils.ts +175 -0
- package/src/libs/SuggestAction/SuggestActionView.tsx +124 -0
- package/src/libs/SuggestAction/index.tsx +3 -0
- package/src/libs/SuggestAction/package.json +16 -0
- package/src/libs/SuggestAction/publish.sh +16 -0
- package/src/libs/SuggestAction/styles.ts +30 -0
- package/src/libs/SuggestAction/types.ts +36 -0
- package/src/libs/Swipe/SwipeView.tsx +151 -0
- package/src/libs/Swipe/index.tsx +5 -0
- package/src/libs/Swipe/package.json +16 -0
- package/src/libs/Swipe/publish.sh +16 -0
- package/src/libs/Swipe/styles.ts +16 -0
- package/src/libs/Swipe/types.ts +109 -0
- package/src/libs/TabView/assets/Path.tsx +29 -0
- package/src/libs/TabView/index.tsx +184 -0
- package/src/libs/TabView/package.json +16 -0
- package/src/libs/TabView/publish.sh +16 -0
- package/src/libs/TabView/styles.ts +96 -0
- package/src/libs/TabView/tabBar/CardTabBar.tsx +137 -0
- package/src/libs/TabView/tabBar/SrollableTabBar.tsx +218 -0
- package/src/libs/TabView/tabBar/TabBar.tsx +67 -0
- package/src/libs/TabView/tabItem/CardTabItem.tsx +118 -0
- package/src/libs/TabView/tabItem/TabItem.tsx +180 -0
- package/src/libs/TabView/types.ts +166 -0
- package/src/libs/Template/HeaderSliderBanner/index.tsx +86 -0
- package/src/libs/Template/HeaderSliderBanner/types.ts +16 -0
- package/src/libs/Template/TrustBanner/CustomAvatar.tsx +39 -0
- package/src/libs/Template/TrustBanner/index.tsx +161 -0
- package/src/libs/Template/TrustBanner/styles.ts +48 -0
- package/src/libs/Template/TrustBanner/types.ts +50 -0
- package/src/libs/Template/index.tsx +4 -0
- package/src/libs/Template/package.json +18 -0
- package/src/libs/Template/publish.sh +17 -0
- package/src/libs/Title/index.tsx +284 -0
- package/src/libs/Title/package.json +17 -0
- package/src/libs/Title/publish.sh +16 -0
- package/src/libs/Title/styles.ts +54 -0
- package/src/libs/Title/types.ts +21 -0
- package/src/libs/Tooltip/TooltipButtons.tsx +54 -0
- package/src/libs/Tooltip/index.tsx +608 -0
- package/src/libs/Tooltip/package.json +16 -0
- package/src/libs/Tooltip/publish.sh +18 -0
- package/src/libs/Tooltip/styles.ts +70 -0
- package/src/libs/Tooltip/types.ts +61 -0
- package/src/libs/Uploader/index.tsx +87 -0
- package/src/libs/Uploader/package.json +17 -0
- package/src/libs/Uploader/publish.sh +18 -0
- package/src/libs/Uploader/styles.ts +30 -0
- package/src/libs/Uploader/types.ts +69 -0
- package/src/native/MoMoNative.podspec +18 -0
- package/src/native/calculator/android/build.gradle +61 -0
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/native/calculator/android/gradlew +172 -0
- package/src/native/calculator/android/gradlew.bat +84 -0
- package/src/native/calculator/android/src/main/AndroidManifest.xml +5 -0
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewModule.java +22 -0
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewPackage.java +35 -0
- package/src/native/calculator/android/src/main/java/com/calculator/modules/CalculatorKeyboardModule.java +157 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/CalculatorEditText.java +36 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/FixedRelativeLayout.java +45 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/MomoTextInputCalculatorManager.java +173 -0
- package/src/native/calculator/android/src/main/java/com/calculator/views/customkeyboard/RNCustomKeyboardModule.java +417 -0
- package/src/native/calculator/ios/Helper/MomoHelper.swift +16 -0
- package/src/native/calculator/ios/KeyboardView-Bridging-Header.h +60 -0
- package/src/native/calculator/ios/KeyboardView.h +19 -0
- package/src/native/calculator/ios/KeyboardView.m +56 -0
- package/src/native/calculator/ios/MomoTextInputCalculator.swift +144 -0
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.h +6 -0
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.m +143 -0
- package/src/native/package.json +14 -0
- package/src/native/publish.sh +29 -0
- package/src/native/resource/android/build.gradle +57 -0
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/native/resource/android/src/main/AndroidManifest.xml +6 -0
- package/src/native/resource/android/src/main/java/com/resource/RNResourceModule.java +90 -0
- package/src/native/resource/android/src/main/java/com/resource/RNResourcePackage.java +22 -0
- package/src/native/resource/ios/RNResouce.m +71 -0
- package/src/native/resource/ios/RNResource.h +5 -0
- package/example/ios/Example.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/sophia.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sophia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sophia.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
package com.calculator;
|
|
3
|
+
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
import java.util.Arrays;
|
|
6
|
+
import java.util.Collections;
|
|
7
|
+
import java.util.List;
|
|
8
|
+
|
|
9
|
+
import com.facebook.react.ReactPackage;
|
|
10
|
+
import com.facebook.react.bridge.NativeModule;
|
|
11
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
12
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
13
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
14
|
+
import com.calculator.modules.CalculatorKeyboardModule;
|
|
15
|
+
import com.calculator.views.calculatorkeyboard.MomoTextInputCalculatorManager;
|
|
16
|
+
import com.calculator.views.customkeyboard.RNCustomKeyboardModule;
|
|
17
|
+
|
|
18
|
+
public class KeyboardViewPackage implements ReactPackage {
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
22
|
+
List<NativeModule> nativeModules = new ArrayList<>();
|
|
23
|
+
nativeModules.add(new CalculatorKeyboardModule(reactContext));
|
|
24
|
+
nativeModules.add(new RNCustomKeyboardModule(reactContext));
|
|
25
|
+
return nativeModules;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
29
|
+
// Register your native component's view manager
|
|
30
|
+
// https://facebook.github.io/react-native/docs/native-components-android.html#4-register-the-viewmanager
|
|
31
|
+
List<ViewManager> viewManagers = new ArrayList<>();
|
|
32
|
+
viewManagers.add(new MomoTextInputCalculatorManager());
|
|
33
|
+
return viewManagers;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
package com.calculator.modules;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import androidx.annotation.NonNull;
|
|
6
|
+
|
|
7
|
+
import com.facebook.react.ReactInstanceManager;
|
|
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.UiThreadUtil;
|
|
12
|
+
import com.facebook.react.views.textinput.ReactEditText;
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
public class CalculatorKeyboardModule extends ReactContextBaseJavaModule {
|
|
16
|
+
public boolean isRegisted = false;
|
|
17
|
+
public static ReactEditText editText = null;
|
|
18
|
+
|
|
19
|
+
public CalculatorKeyboardModule(ReactApplicationContext reactContext) {
|
|
20
|
+
super(reactContext);
|
|
21
|
+
this.isRegisted = false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@NonNull
|
|
25
|
+
@Override
|
|
26
|
+
public String getName() {
|
|
27
|
+
return "CalculatorKeyboardModule";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@ReactMethod
|
|
31
|
+
public void setText(String text) {
|
|
32
|
+
if(isValidText(text)) {
|
|
33
|
+
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
34
|
+
@Override
|
|
35
|
+
public void run() {
|
|
36
|
+
try {
|
|
37
|
+
editText.setText("");
|
|
38
|
+
editText.append(text);
|
|
39
|
+
}
|
|
40
|
+
catch (Exception e){
|
|
41
|
+
System.out.println("Exception occurred" + e.getMessage());
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
boolean isValidText(String text) {
|
|
50
|
+
boolean numeric = true;
|
|
51
|
+
try {
|
|
52
|
+
Double num = Double.parseDouble(text);
|
|
53
|
+
if(num <= 0) {
|
|
54
|
+
numeric = false;
|
|
55
|
+
}
|
|
56
|
+
} catch (NumberFormatException e) {
|
|
57
|
+
numeric = false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return numeric;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactMethod
|
|
64
|
+
public static void insertText(final String text) {
|
|
65
|
+
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
66
|
+
@Override
|
|
67
|
+
public void run() {
|
|
68
|
+
try {
|
|
69
|
+
int start = Math.max(editText.getSelectionStart(), 0);
|
|
70
|
+
int end = Math.max(editText.getSelectionEnd(), 0);
|
|
71
|
+
if(text.equals("+") || text.equals("-") || text.equals("×") || text.equals("÷")){
|
|
72
|
+
String txt = String.valueOf(editText.getText());
|
|
73
|
+
String newtxt = "";
|
|
74
|
+
String lastTxt = "";
|
|
75
|
+
if(txt.length() >= Math.max(start, end)){
|
|
76
|
+
newtxt = txt.substring(0, Math.max(start, end));
|
|
77
|
+
}
|
|
78
|
+
if(newtxt.length() > 0){
|
|
79
|
+
lastTxt = newtxt.substring(newtxt.length()-1);
|
|
80
|
+
}
|
|
81
|
+
if ( lastTxt.equals("+") || lastTxt.equals("-")||lastTxt.equals("×")||lastTxt.equals("÷")){
|
|
82
|
+
editText.getText().replace(Math.min(start, end)-1, Math.max(start, end),
|
|
83
|
+
text, 0, text.length());
|
|
84
|
+
}else if(lastTxt.equals(" ")){
|
|
85
|
+
editText.getText().replace(Math.min(start, end)-2, Math.max(start, end),
|
|
86
|
+
text, 0, text.length());
|
|
87
|
+
}else{
|
|
88
|
+
editText.getText().replace(Math.min(start, end), Math.max(start, end),
|
|
89
|
+
text, 0, text.length());
|
|
90
|
+
}
|
|
91
|
+
}else{
|
|
92
|
+
int min1 = Math.min(start, end);
|
|
93
|
+
int min2 = Math.max(start, end);
|
|
94
|
+
editText.getText().replace(Math.min(start, end), Math.max(start, end),
|
|
95
|
+
text, 0, text.length());
|
|
96
|
+
}
|
|
97
|
+
}catch (Exception e){
|
|
98
|
+
System.out.println("Exception occurred" + e.getMessage());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@ReactMethod
|
|
105
|
+
public void backSpace() {
|
|
106
|
+
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
107
|
+
@Override
|
|
108
|
+
public void run() {
|
|
109
|
+
try {
|
|
110
|
+
int start = Math.max(editText.getSelectionStart(), 0);
|
|
111
|
+
int end = Math.max(editText.getSelectionEnd(), 0);
|
|
112
|
+
if (start != end) {
|
|
113
|
+
editText.getText().delete(start, end);
|
|
114
|
+
} else if (start > 0){
|
|
115
|
+
String txt = String.valueOf(editText.getText());
|
|
116
|
+
String newtxt = "";
|
|
117
|
+
String lastTxt = "";
|
|
118
|
+
if(txt.length() >= Math.max(start, end)){
|
|
119
|
+
newtxt = txt.substring(0, Math.max(start, end));
|
|
120
|
+
}
|
|
121
|
+
if(newtxt.length() > 0){
|
|
122
|
+
lastTxt = newtxt.substring(newtxt.length()-1);
|
|
123
|
+
}
|
|
124
|
+
if (lastTxt.equals(" ")){
|
|
125
|
+
editText.getText().delete(start - 2, end);
|
|
126
|
+
}else{
|
|
127
|
+
editText.getText().delete(start - 1, end);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}catch (Exception e){
|
|
131
|
+
System.out.println("Exception occurred" + e.getMessage());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@ReactMethod
|
|
138
|
+
public void doDelete() {
|
|
139
|
+
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
140
|
+
@Override
|
|
141
|
+
public void run() {
|
|
142
|
+
try {
|
|
143
|
+
int start = Math.max(editText.getSelectionStart(), 0);
|
|
144
|
+
int end = Math.max(editText.getSelectionEnd(), 0);
|
|
145
|
+
if (start != end) {
|
|
146
|
+
editText.getText().delete(start, end);
|
|
147
|
+
} else if (start > 0){
|
|
148
|
+
editText.getText().delete(0, end);
|
|
149
|
+
}
|
|
150
|
+
}catch (Exception e){
|
|
151
|
+
System.out.println("Exception occurred" + e.getMessage());
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package com.calculator.views.calculatorkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.graphics.Rect;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.views.textinput.ReactEditText;
|
|
7
|
+
|
|
8
|
+
class CalculatorEditText extends ReactEditText {
|
|
9
|
+
public OnFocusChangeListener onFocusListener = null;
|
|
10
|
+
|
|
11
|
+
public CalculatorEditText(Context context) {
|
|
12
|
+
super(context);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
|
17
|
+
// Always return true if we are already focused. This is used by android in certain places,
|
|
18
|
+
// such as text selection.
|
|
19
|
+
if (isFocused()) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
this.setFocusable(true);
|
|
23
|
+
this.setFocusableInTouchMode(true);
|
|
24
|
+
boolean focused = super.requestFocus(direction, previouslyFocusedRect);
|
|
25
|
+
|
|
26
|
+
return focused;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
|
|
31
|
+
super.onFocusChanged(focused, direction, previouslyFocusedRect);
|
|
32
|
+
if (this.onFocusListener != null) {
|
|
33
|
+
this.onFocusListener.onFocusChange(this, this.isFocused());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.calculator.views.calculatorkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.annotation.TargetApi;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import android.os.Build;
|
|
6
|
+
import android.util.AttributeSet;
|
|
7
|
+
import android.view.WindowInsets;
|
|
8
|
+
import android.widget.RelativeLayout;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Created by phancuong on 6/7/18.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
public class FixedRelativeLayout extends RelativeLayout {
|
|
15
|
+
private int[] mInsets = new int[4];
|
|
16
|
+
|
|
17
|
+
public FixedRelativeLayout(Context context) {
|
|
18
|
+
super(context);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public FixedRelativeLayout(Context context, AttributeSet attrs) {
|
|
22
|
+
super(context, attrs);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public FixedRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
26
|
+
super(context, attrs, defStyleAttr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
|
30
|
+
public FixedRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
|
31
|
+
super(context, attrs, defStyleAttr, defStyleRes);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
public final WindowInsets onApplyWindowInsets(WindowInsets insets) {
|
|
36
|
+
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
|
|
37
|
+
mInsets[0] = insets.getSystemWindowInsetLeft();
|
|
38
|
+
mInsets[1] = insets.getSystemWindowInsetTop();
|
|
39
|
+
mInsets[2] = insets.getSystemWindowInsetRight();
|
|
40
|
+
return super.onApplyWindowInsets(insets.replaceSystemWindowInsets(0, 0, 0, insets.getSystemWindowInsetBottom()));
|
|
41
|
+
} else {
|
|
42
|
+
return insets;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
package com.calculator.views.calculatorkeyboard;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.graphics.Color;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
import android.os.ResultReceiver;
|
|
7
|
+
import android.text.InputType;
|
|
8
|
+
import android.util.DisplayMetrics;
|
|
9
|
+
import android.view.KeyEvent;
|
|
10
|
+
import android.view.View;
|
|
11
|
+
import android.view.ViewGroup;
|
|
12
|
+
import android.view.WindowManager;
|
|
13
|
+
import android.view.inputmethod.InputMethodManager;
|
|
14
|
+
import android.widget.RelativeLayout;
|
|
15
|
+
import com.facebook.react.ReactInstanceManager;
|
|
16
|
+
import com.facebook.react.ReactRootView;
|
|
17
|
+
import com.facebook.react.bridge.Arguments;
|
|
18
|
+
import com.facebook.react.bridge.UiThreadUtil;
|
|
19
|
+
import com.facebook.react.bridge.WritableMap;
|
|
20
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
21
|
+
import com.facebook.react.uimanager.PixelUtil;
|
|
22
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
23
|
+
import com.facebook.react.views.textinput.ReactEditText;
|
|
24
|
+
import com.facebook.react.views.textinput.ReactTextInputManager;
|
|
25
|
+
import com.calculator.modules.CalculatorKeyboardModule;
|
|
26
|
+
|
|
27
|
+
import javax.annotation.Nullable;
|
|
28
|
+
|
|
29
|
+
public class MomoTextInputCalculatorManager extends ReactTextInputManager {
|
|
30
|
+
|
|
31
|
+
public static final String REACT_CLASS = "MomoTextInputCalculator";
|
|
32
|
+
public static ReactInstanceManager mReactInstanceManager;
|
|
33
|
+
private RelativeLayout layout = null;
|
|
34
|
+
|
|
35
|
+
private int HEIGHT_SCREEN = 0;
|
|
36
|
+
private int HEIGHT_CALCULATOR = 0;
|
|
37
|
+
private int PIXEL_KEYBOARD = 0;
|
|
38
|
+
private int STATUS_BAR_HEIGHT = 0;
|
|
39
|
+
|
|
40
|
+
ThemedReactContext mContext = null;
|
|
41
|
+
ReactRootView mContentView = null;
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public String getName() {
|
|
45
|
+
return REACT_CLASS;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Override
|
|
49
|
+
public ReactEditText createViewInstance(final ThemedReactContext context) {
|
|
50
|
+
mContext = context;
|
|
51
|
+
mContentView = new ReactRootView(mContext);
|
|
52
|
+
final CalculatorEditText editText = new CalculatorEditText(context);
|
|
53
|
+
int inputType = editText.getInputType();
|
|
54
|
+
editText.setInputType(inputType & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
|
|
55
|
+
editText.setReturnKeyType("done");
|
|
56
|
+
editText.setShowSoftInputOnFocus(false);
|
|
57
|
+
CalculatorKeyboardModule.editText = editText;
|
|
58
|
+
CalculatorKeyboardModule.insertText("0");
|
|
59
|
+
getCustomKeyboard(context);
|
|
60
|
+
|
|
61
|
+
editText.setOnClickListener(v -> UiThreadUtil.runOnUiThread(() -> {
|
|
62
|
+
((InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(v.getWindowToken(), 0);
|
|
63
|
+
editText.setShowSoftInputOnFocus(false);
|
|
64
|
+
if (!editText.isFocused()) {
|
|
65
|
+
editText.requestFocusFromJS();
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
editText.onFocusListener = (v, hasFocus) -> UiThreadUtil.runOnUiThread(() -> {
|
|
70
|
+
if (editText.isFocused()) {
|
|
71
|
+
addContentView(context, editText);
|
|
72
|
+
} else {
|
|
73
|
+
removeContentView(context, editText);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
editText.setOnKeyListener((view, keyCode, keyEvent) -> {
|
|
78
|
+
if(keyCode == KeyEvent.KEYCODE_BACK && editText.isFocused()) {
|
|
79
|
+
editText.setFocusable(false);
|
|
80
|
+
editText.clearFocus();
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
});
|
|
85
|
+
return editText;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
void addContentView(final ThemedReactContext context, CalculatorEditText editText) {
|
|
89
|
+
sendEvent("keyboardDidShow", getShowCalculatorParam());
|
|
90
|
+
if (layout.getParent() == null) {
|
|
91
|
+
context.getCurrentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
|
92
|
+
layout.setY(HEIGHT_CALCULATOR);
|
|
93
|
+
context.getCurrentActivity().addContentView(layout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
94
|
+
layout.animate().translationY(0).setDuration(250).withEndAction(() -> {
|
|
95
|
+
sendEvent("keyboardDidShow", getShowCalculatorParam());
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void removeContentView(final ThemedReactContext context, CalculatorEditText editText) {
|
|
101
|
+
sendEvent("keyboardDidHide", getHideCalculatorParam());
|
|
102
|
+
if(layout.getParent() != null){
|
|
103
|
+
layout.setY(0);
|
|
104
|
+
layout.animate().translationY(HEIGHT_CALCULATOR).setDuration(250).withEndAction(() -> {
|
|
105
|
+
context.getCurrentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
|
106
|
+
sendEvent("keyboardDidHide", getHideCalculatorParam());
|
|
107
|
+
if (layout.getParent() != null) {
|
|
108
|
+
((ViewGroup) layout.getParent()).removeView(layout);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
WritableMap getShowCalculatorParam() {
|
|
115
|
+
WritableMap params = Arguments.createMap();
|
|
116
|
+
WritableMap coordinates = Arguments.createMap();
|
|
117
|
+
|
|
118
|
+
coordinates.putDouble("screenY", PixelUtil.toDIPFromPixel(this.PIXEL_KEYBOARD));
|
|
119
|
+
coordinates.putDouble("screenX", PixelUtil.toDIPFromPixel(0));
|
|
120
|
+
coordinates.putDouble("width", PixelUtil.toDIPFromPixel(0));
|
|
121
|
+
coordinates.putDouble("height", PixelUtil.toDIPFromPixel(this.HEIGHT_CALCULATOR + STATUS_BAR_HEIGHT));
|
|
122
|
+
coordinates.putString("keyboardType", "calculator");
|
|
123
|
+
params.putMap("endCoordinates", coordinates);
|
|
124
|
+
return params;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
WritableMap getHideCalculatorParam() {
|
|
128
|
+
WritableMap params = Arguments.createMap();
|
|
129
|
+
WritableMap coordinates = Arguments.createMap();
|
|
130
|
+
|
|
131
|
+
coordinates.putDouble("screenY", PixelUtil.toDIPFromPixel(this.HEIGHT_SCREEN));
|
|
132
|
+
coordinates.putDouble("screenX", PixelUtil.toDIPFromPixel(0));
|
|
133
|
+
coordinates.putDouble("width", PixelUtil.toDIPFromPixel(0));
|
|
134
|
+
coordinates.putDouble("height", PixelUtil.toDIPFromPixel(0));
|
|
135
|
+
coordinates.putString("keyboardType", "calculator");
|
|
136
|
+
params.putMap("endCoordinates", coordinates);
|
|
137
|
+
return params;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
void sendEvent(String eventName, @Nullable WritableMap params) {
|
|
141
|
+
DeviceEventManagerModule.RCTDeviceEventEmitter emitter = mContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
|
|
142
|
+
if(emitter != null) {
|
|
143
|
+
emitter.emit(eventName, params);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
private View getCustomKeyboard(ThemedReactContext context) {
|
|
148
|
+
ReactRootView rootView;
|
|
149
|
+
layout = new FixedRelativeLayout(context);
|
|
150
|
+
layout.setFitsSystemWindows(true);
|
|
151
|
+
rootView = new ReactRootView(context);
|
|
152
|
+
rootView.setBackgroundColor(Color.WHITE);
|
|
153
|
+
rootView.setFitsSystemWindows(true);
|
|
154
|
+
|
|
155
|
+
Bundle bundle = new Bundle();
|
|
156
|
+
rootView.startReactApplication(mReactInstanceManager, "KeyboardCalculator", bundle);
|
|
157
|
+
DisplayMetrics displayMetrics = context.getCurrentActivity().getResources().getDisplayMetrics();
|
|
158
|
+
int resourceId = context.getCurrentActivity().getResources().getIdentifier("status_bar_height", "dimen", "android");
|
|
159
|
+
|
|
160
|
+
this.HEIGHT_SCREEN = displayMetrics.heightPixels;
|
|
161
|
+
this.HEIGHT_CALCULATOR = (int) (displayMetrics.widthPixels * 0.675);
|
|
162
|
+
this.PIXEL_KEYBOARD = this.HEIGHT_SCREEN - this.HEIGHT_CALCULATOR;
|
|
163
|
+
this.STATUS_BAR_HEIGHT = context.getCurrentActivity().getResources().getDimensionPixelSize(resourceId);
|
|
164
|
+
|
|
165
|
+
RelativeLayout.LayoutParams lParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
|
166
|
+
lParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
|
|
167
|
+
lParams.setMargins(0, this.PIXEL_KEYBOARD, 0, 0);
|
|
168
|
+
if (context.getCurrentActivity() != null) {
|
|
169
|
+
layout.addView(rootView, lParams);
|
|
170
|
+
}
|
|
171
|
+
return layout;
|
|
172
|
+
}
|
|
173
|
+
}
|