@xrnjs/app-template 0.0.1
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/$package.json +51 -0
- package/.env +6 -0
- package/.env.prod +6 -0
- package/LICENSE +202 -0
- package/android/app/build.gradle +176 -0
- package/android/app/build_defs.bzl +19 -0
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +10 -0
- package/android/app/src/debug/AndroidManifest.xml +13 -0
- package/android/app/src/debug/java/com/xrn/template/ReactNativeFlipper.java +73 -0
- package/android/app/src/main/AndroidManifest.xml +46 -0
- package/android/app/src/main/assets/index.main-bundle.bundle +178940 -0
- package/android/app/src/main/assets/index.sub-bundle.bundle +178928 -0
- package/android/app/src/main/assets/xrn-manifest.json +1 -0
- package/android/app/src/main/java/com/xrn/template/MainActivity.kt +52 -0
- package/android/app/src/main/java/com/xrn/template/MainApplication.kt +91 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XBundleInfoHook.kt +9 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XDevSupportParams.kt +6 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XRNHostParams.kt +81 -0
- package/android/app/src/main/java/com/xrn/template/navigation/MainClazzFactory.kt +14 -0
- package/android/app/src/main/java/com/xrn/template/navigation/XBundleActivity.kt +56 -0
- package/android/app/src/main/java/com/xrn/template/navigation/XMainActivity.kt +4 -0
- package/android/app/src/main/java/com/xrn/template/utils/DevEntryUtil.kt +29 -0
- package/android/app/src/main/java/com/xrn/template/utils/LifecycleAwareRunnable.kt +37 -0
- package/android/app/src/main/jni/CMakeLists.txt +7 -0
- package/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -0
- package/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -0
- package/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/android/app/src/main/res/drawable/bg_debug_entry.xml +15 -0
- package/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_alerttriangle.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_chevronleft.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_chevronright.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_close.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_loader.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backiconmask.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_images_fail_icon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_images_success_icon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_close.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_filter.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_more.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_search.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_share.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_navigation_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_copy_icon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_app_info.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_app_start_time.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_file.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_fps.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_h5.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_health.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_kadun.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_net.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_qingchu.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_scan.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_self.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_setting.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_view_check.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_view_level.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_viewmetrics.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_images_rebackwhiteicon.png +0 -0
- package/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/layout/activity_splash.xml +16 -0
- package/android/app/src/main/res/layout/layout_rn_dev_float.xml +18 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/raw/bundle_config.json +23 -0
- package/android/app/src/main/res/raw/launch_screen.json +1 -0
- package/android/app/src/main/res/values/strings.xml +3 -0
- package/android/app/src/main/res/values/styles.xml +9 -0
- package/android/build.gradle +83 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +63 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/settings.gradle +18 -0
- package/harmony/.clang-format +64 -0
- package/harmony/.clang-tidy +1 -0
- package/harmony/.clangd +13 -0
- package/harmony/AppScope/app.json5 +10 -0
- package/harmony/AppScope/resources/base/element/string.json +8 -0
- package/harmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/harmony/XRNTemplate-dev.cer +52 -0
- package/harmony/XRNTemplate-devDebug.p7b +0 -0
- package/harmony/XRNTemplate.p12 +0 -0
- package/harmony/build-profile.json5 +91 -0
- package/harmony/code-linter.json5 +20 -0
- package/harmony/entry/build-profile.json5 +33 -0
- package/harmony/entry/hvigorfile.ts +6 -0
- package/harmony/entry/obfuscation-rules.txt +23 -0
- package/harmony/entry/oh-package-lock.json5 +486 -0
- package/harmony/entry/oh-package.json5 +59 -0
- package/harmony/entry/src/main/cpp/CMakeLists.txt +72 -0
- package/harmony/entry/src/main/cpp/PackageProvider.cpp +51 -0
- package/harmony/entry/src/main/cpp/generated/BundleNavigation.cpp +25 -0
- package/harmony/entry/src/main/cpp/generated/BundleNavigation.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ImageResizer.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/ImageResizer.h +21 -0
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.h +21 -0
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.cpp +31 -0
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.cpp +28 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewJSIBinder.h +120 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.cpp +137 -0
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.cpp +24 -0
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonJSIBinder.h +38 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.cpp +28 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewJSIBinder.h +31 -0
- package/harmony/entry/src/main/cpp/generated/RNLocalize.cpp +31 -0
- package/harmony/entry/src/main/cpp/generated/RNLocalize.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNOHGeneratedPackage.h +191 -0
- package/harmony/entry/src/main/cpp/generated/RTNCodePush.cpp +48 -0
- package/harmony/entry/src/main/cpp/generated/RTNCodePush.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.cpp +51 -0
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAppUtilsModule.cpp +29 -0
- package/harmony/entry/src/main/cpp/generated/XRNAppUtilsModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNBundleModule.cpp +27 -0
- package/harmony/entry/src/main/cpp/generated/XRNBundleModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.cpp +32 -0
- package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNLoadingModule.cpp +25 -0
- package/harmony/entry/src/main/cpp/generated/XRNLoadingModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNMultiBundleModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNMultiBundleModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNNativeStorageModule.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/XRNNativeStorageModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNNavigation.cpp +23 -0
- package/harmony/entry/src/main/cpp/generated/XRNNavigation.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNToastModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/XRNToastModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/BaseReactNativeOhTplAsyncStoragePackage.h +68 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/turbo_modules/RNCAsyncStorage.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/turbo_modules/RNCAsyncStorage.h +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ComponentDescriptors.h +22 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/EventEmitters.cpp +18 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/EventEmitters.h +19 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/Props.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/Props.h +20 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ShadowNodes.cpp +19 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ShadowNodes.h +25 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/States.cpp +18 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/States.h +23 -0
- package/harmony/entry/src/main/ets/BundleHelper.ets +198 -0
- package/harmony/entry/src/main/ets/Constants.ets +2 -0
- package/harmony/entry/src/main/ets/MainAbilityStage.ets +60 -0
- package/harmony/entry/src/main/ets/entryability/EntryAbility.ets +57 -0
- package/harmony/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +12 -0
- package/harmony/entry/src/main/ets/lottie/launch_screen.json +1 -0
- package/harmony/entry/src/main/ets/module/devtools/components/FloatBall.ets +359 -0
- package/harmony/entry/src/main/ets/navDestination/BizModuleContainer.ets +8 -0
- package/harmony/entry/src/main/ets/navDestination/MainModuleContainer.ets +8 -0
- package/harmony/entry/src/main/ets/navDestination/Splash.ets +79 -0
- package/harmony/entry/src/main/ets/pages/Index.ets +66 -0
- package/harmony/entry/src/main/module.json5 +68 -0
- package/harmony/entry/src/main/resources/base/element/color.json +12 -0
- package/harmony/entry/src/main/resources/base/element/string.json +19 -0
- package/harmony/entry/src/main/resources/base/media/background.png +0 -0
- package/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
- package/harmony/entry/src/main/resources/base/media/ic_back.png +0 -0
- package/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/harmony/entry/src/main/resources/base/profile/backup_config.json +3 -0
- package/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/entry/src/main/resources/en_US/element/string.json +16 -0
- package/harmony/entry/src/main/resources/rawfile/bundle_config.json5 +23 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/AntDesign.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Entypo.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/EvilIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Feather.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Brands.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Regular.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Solid.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Brands.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Regular.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Solid.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Fontisto.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Foundation.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Ionicons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/MaterialCommunityIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/MaterialIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Octicons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/SimpleLineIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Zocial.ttf +0 -0
- package/harmony/entry/src/main/resources/zh_CN/element/string.json +16 -0
- package/harmony/entry/src/mock/mock-config.json5 +2 -0
- package/harmony/entry/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/harmony/entry/src/ohosTest/ets/test/List.test.ets +5 -0
- package/harmony/entry/src/ohosTest/module.json5 +13 -0
- package/harmony/entry/src/test/List.test.ets +5 -0
- package/harmony/entry/src/test/LocalUnit.test.ets +33 -0
- package/harmony/hvigor/hvigor-config.json5 +22 -0
- package/harmony/hvigorfile.ts +6 -0
- package/harmony/material/ac/6a282c38039b44b2949441a85986c35d +1 -0
- package/harmony/material/ce/b2a765b7b925475797f45ae55c8d3ad3 +0 -0
- package/harmony/material/fd/0/9cbed212f275489b874de30a02692f59 +1 -0
- package/harmony/material/fd/1/dc8ea45ef44142d09bca7eeacdc5ecac +1 -0
- package/harmony/material/fd/2/d34888210a5846829d745f65295f90b7 +1 -0
- package/harmony/oh-package-lock.json5 +27 -0
- package/harmony/oh-package.json5 +17 -0
- package/ios/.xcode.env +11 -0
- package/ios/BundleEventCenter/XTBundleProvider.h +17 -0
- package/ios/BundleEventCenter/XTBundleProvider.m +129 -0
- package/ios/BundleEventCenter/XTBundleViewControllerFactory.h +18 -0
- package/ios/BundleEventCenter/XTBundleViewControllerFactory.m +39 -0
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.h +16 -0
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.m +35 -0
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.h +16 -0
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.m +41 -0
- package/ios/BundleEventCenter/bundleController/xtBundles.plist +14 -0
- package/ios/Podfile +221 -0
- package/ios/Podfile.lock +955 -0
- package/ios/RNDebug/DebugPlugin/XTPluginManage.h +24 -0
- package/ios/RNDebug/DebugPlugin/XTPluginManage.m +93 -0
- package/ios/RNDebug/Views/XTLoadJSErrorTipPanel.swift +231 -0
- package/ios/RNDebug/Views/XTScanQRPlugin.swift +122 -0
- package/ios/RNDebug/Views/XTSuspendBall.h +34 -0
- package/ios/RNDebug/Views/XTSuspendBall.m +357 -0
- package/ios/XRNTemplate/AppDelegate.h +8 -0
- package/ios/XRNTemplate/AppDelegate.mm +168 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +55 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/icon120_120@2x.png +0 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/icon180_180@3x.png +0 -0
- package/ios/XRNTemplate/Images.xcassets/Contents.json +6 -0
- package/ios/XRNTemplate/Images.xcassets/launch_icon.imageset/Contents.json +21 -0
- package/ios/XRNTemplate/Images.xcassets/launch_icon.imageset/launch_icon@2x.png +0 -0
- package/ios/XRNTemplate/Info.plist +82 -0
- package/ios/XRNTemplate/LaunchScreen.storyboard +43 -0
- package/ios/XRNTemplate/main.m +10 -0
- package/ios/XRNTemplate-Bridging-Header.h +29 -0
- package/ios/XRNTemplate.xcodeproj/project.pbxproj +1022 -0
- package/ios/XRNTemplate.xcodeproj/xcshareddata/xcschemes/XRNTemplate.xcscheme +88 -0
- package/ios/XRNTemplate.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/XRNTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/XRNTemplateTests/Info.plist +24 -0
- package/ios/XRNTemplateTests/XRNTemplateTests.m +66 -0
- package/main-bundle/App.tsx +29 -0
- package/main-bundle/app.json +15 -0
- package/main-bundle/babel.config.js +4 -0
- package/main-bundle/index.ts +3 -0
- package/main-bundle/metro.config.js +21 -0
- package/main-bundle/package.json +35 -0
- package/main-bundle/router.ts +18 -0
- package/main-bundle/tsconfig.json +26 -0
- package/main-bundle/xrn.config.ts +13 -0
- package/main-bundle/yarn.lock +13622 -0
- package/package.json +16 -0
- package/react-native.config.js +36 -0
- package/sub-bundle/App.tsx +23 -0
- package/sub-bundle/app.json +15 -0
- package/sub-bundle/babel.config.js +4 -0
- package/sub-bundle/index.ts +3 -0
- package/sub-bundle/metro.config.js +21 -0
- package/sub-bundle/package.json +36 -0
- package/sub-bundle/router.ts +18 -0
- package/sub-bundle/tsconfig.json +26 -0
- package/sub-bundle/xrn.config.ts +13 -0
- package/sub-bundle/yarn.lock +13652 -0
- package/xrn-react-native-xcode.sh +172 -0
- package/xrn.config.json +46 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { window } from '@kit.ArkUI'
|
|
2
|
+
|
|
3
|
+
const TAG: string = '[FloatBall]';
|
|
4
|
+
|
|
5
|
+
@Component
|
|
6
|
+
export struct FloatBall {
|
|
7
|
+
@State statusHeight: number = 0 // 状态栏高度
|
|
8
|
+
@State bottomAvoidAreaHeight: number = 0 // 手机底部规避区域高度
|
|
9
|
+
@State curLeft: number = 0 // 当前悬浮按钮距离窗口左边距离
|
|
10
|
+
@State curTop: number = 0 // 当前悬浮按钮距离窗口顶部距离
|
|
11
|
+
@State opacityN: number = 0 // 当前透明度
|
|
12
|
+
private startLeft: number = 0 // 开始移动那一刻悬浮按钮距离窗口左边距离
|
|
13
|
+
private startTop: number = 0 // 开始移动那一刻悬浮按钮距离窗口顶部距离
|
|
14
|
+
private startX: number = 0 // 开始移动触摸点x坐标,相对窗口左上角
|
|
15
|
+
private startY: number = 0 // 开始移动触摸点y坐标,相对窗口左上角
|
|
16
|
+
private winWidth: number = 0 // 窗口宽度
|
|
17
|
+
private winHeight: number = 0 // 窗口高度
|
|
18
|
+
private isTouc = false // 是否触摸中
|
|
19
|
+
private time = 0 // 隐藏定时器
|
|
20
|
+
private state = 0 // 当前状态 0 未处理 1 显示 2 贴边 3 隐藏
|
|
21
|
+
@Prop
|
|
22
|
+
env: string = "sitxt30" // 当前的网络环境
|
|
23
|
+
image: Resource = null! // 图片资源
|
|
24
|
+
radius: number = 25 // 悬浮按钮半径
|
|
25
|
+
opacityHide: number = 0.5 // 半隐藏后的透明度
|
|
26
|
+
opacityDefault: number = 1.0 // 默认透明度
|
|
27
|
+
marginSart = 25 // 从隐藏恢复到显示状态的默认边距
|
|
28
|
+
aotoHide = true // 开启自动隐藏
|
|
29
|
+
aotoHideTime = 3000 // 自动隐藏的超时时间
|
|
30
|
+
aotoEdging = true // 自动贴边
|
|
31
|
+
enableOutEdging = true // 拖拽时允许超过边界
|
|
32
|
+
enableDragWhenHidden = true // 允许隐藏时直接拖动,如果false,则需要先点击一下,从隐藏状态显示后,才能继续拖动
|
|
33
|
+
aotoEdgingTime = 3000 // 自动贴边的超时时间
|
|
34
|
+
onClickEvent?: () => boolean; // 点击事件传递, 如果返回false,则阻止后续事件
|
|
35
|
+
onEdgingEvent?: () => boolean; // 贴边事件传递, 如果返回false,则阻止后续事件
|
|
36
|
+
onHideEvent?: () => boolean; // 半隐藏事件传递, 如果返回false,则阻止后续事件
|
|
37
|
+
onShowEvent?: () => boolean; // 显示事件传递, 如果返回false,则阻止后续事件
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 生命周期函数-初始化
|
|
41
|
+
*/
|
|
42
|
+
aboutToAppear() {
|
|
43
|
+
// 初始化透明度
|
|
44
|
+
this.opacityN = this.opacityDefault
|
|
45
|
+
// 初始化窗口信息
|
|
46
|
+
this.getWindowInfo()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 获取窗口尺寸信息
|
|
51
|
+
*/
|
|
52
|
+
getWindowInfo() {
|
|
53
|
+
window.getLastWindow(getContext(this), (err, windowClass) => {
|
|
54
|
+
if (!err.code) { //状态栏高度
|
|
55
|
+
this.statusHeight = px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
|
|
56
|
+
//获取手机底部规避区域高度
|
|
57
|
+
this.bottomAvoidAreaHeight =
|
|
58
|
+
px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR)
|
|
59
|
+
.bottomRect
|
|
60
|
+
.height) //获取窗口宽高
|
|
61
|
+
let windowProperties = windowClass.getWindowProperties()
|
|
62
|
+
this.winWidth = px2vp(windowProperties.windowRect.width)
|
|
63
|
+
this.winHeight = px2vp(windowProperties.windowRect.height)
|
|
64
|
+
//设置初始位置位于屏幕右下角,演示设置可根据实际调整
|
|
65
|
+
this.curLeft = 10
|
|
66
|
+
this.curTop = this.winHeight * 0.75
|
|
67
|
+
|
|
68
|
+
// 开启自动用隐藏
|
|
69
|
+
if (this.aotoHide) {
|
|
70
|
+
this.onHide()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* UI 绘制
|
|
78
|
+
*/
|
|
79
|
+
build() {
|
|
80
|
+
//悬浮按钮
|
|
81
|
+
Row() {
|
|
82
|
+
// Image(this.image).width(this.radius * 2) // 图片
|
|
83
|
+
Text(this.env)
|
|
84
|
+
.fontSize(12)
|
|
85
|
+
}
|
|
86
|
+
.backgroundColor('green')
|
|
87
|
+
.width(this.radius * 2)
|
|
88
|
+
.height(this.radius * 2)
|
|
89
|
+
.justifyContent(FlexAlign.Center)
|
|
90
|
+
.borderRadius(this.radius)
|
|
91
|
+
.opacity(this.opacityN) // 透明度
|
|
92
|
+
.position({ x: this.curLeft, y: this.curTop }) // 位置绑定,注意@State关键词
|
|
93
|
+
.onTouch((event: TouchEvent) => { // 手指按下记录初始触摸点坐标、悬浮按钮位置
|
|
94
|
+
if (event.type === TouchType.Down) {
|
|
95
|
+
this.isTouc = true
|
|
96
|
+
console.log('TouchEvent: 按下');
|
|
97
|
+
// 恢复透明度
|
|
98
|
+
this.restoreOpacity()
|
|
99
|
+
this.startX = event.touches[0].windowX
|
|
100
|
+
this.startY = event.touches[0].windowY
|
|
101
|
+
this.startLeft = this.curLeft
|
|
102
|
+
this.startTop = this.curTop
|
|
103
|
+
} // 按下
|
|
104
|
+
else if (event.type === TouchType.Up) {
|
|
105
|
+
this.isTouc = false
|
|
106
|
+
console.log('TouchEvent: 松开');
|
|
107
|
+
if (this.aotoHide) { // 松开后隐藏
|
|
108
|
+
this.onHide()
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else if (event.type === TouchType.Move) { // 拖动
|
|
112
|
+
if(this.state == 3 && !this.enableDragWhenHidden){
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
this.isTouc = true
|
|
116
|
+
let touch = event.touches[0] // 获取手指触摸位置
|
|
117
|
+
let curLeft = this.startLeft + (touch.windowX - this.startX) // 计算悬浮球位置
|
|
118
|
+
// 是否允许超过边界
|
|
119
|
+
if(!this.enableOutEdging){
|
|
120
|
+
curLeft = Math.max(0, curLeft) // 限制悬浮球不能移除屏幕右边
|
|
121
|
+
this.curLeft = Math.min(this.winWidth - 2 * this.radius,curLeft) // 限制悬浮球不能移除屏幕左边
|
|
122
|
+
}
|
|
123
|
+
else{
|
|
124
|
+
this.curLeft = curLeft
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let curTop = this.startTop + (touch.windowY - this.startY) // 限制悬浮球不能移除屏幕上边
|
|
128
|
+
curTop = Math.max(0, curTop) // 限制悬浮球不能移除屏幕下边
|
|
129
|
+
this.curTop =
|
|
130
|
+
Math.min(this.winHeight - 2 * this.radius - this.bottomAvoidAreaHeight - this.statusHeight, curTop)
|
|
131
|
+
console.log('TouchEvent: 移动');
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
.onClick(() => {
|
|
135
|
+
if (!this.isShow() || this.state == 3) {
|
|
136
|
+
this.onMyShow()
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
let fal = false
|
|
140
|
+
if (this.onClickEvent !== undefined) {
|
|
141
|
+
fal = this.onClickEvent();
|
|
142
|
+
}
|
|
143
|
+
if (fal && this.aotoHide) {
|
|
144
|
+
this.onHide(); // 点击完,就继续去隐藏
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
public onMyClick2(onClickEvent: () => boolean) {
|
|
151
|
+
this.onClickEvent = onClickEvent
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 隐藏
|
|
156
|
+
*/
|
|
157
|
+
onHide() {
|
|
158
|
+
// 如果已经是隐藏,就退出
|
|
159
|
+
if (!this.isShow()) {
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
// 如果开启了自动贴边,就先判断是否贴边
|
|
163
|
+
if (this.aotoEdging && !this.ifEdging()) {
|
|
164
|
+
// 先执行贴边
|
|
165
|
+
console.log(TAG, "开启了自动贴边, 当前未贴边")
|
|
166
|
+
this.onEdging()
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
// 先取消上一个定时器,在搞新的
|
|
170
|
+
if (this.time != 0) {
|
|
171
|
+
console.log(TAG, "清除上次未执行的目标")
|
|
172
|
+
clearTimeout(this.time);
|
|
173
|
+
}
|
|
174
|
+
console.log(TAG, "创建目标: 隐藏")
|
|
175
|
+
this.time = setTimeout(() => {
|
|
176
|
+
console.log(TAG, "进入执行目标: 隐藏")
|
|
177
|
+
this.onMyHideDo()
|
|
178
|
+
}, this.aotoHideTime)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 贴边
|
|
183
|
+
*/
|
|
184
|
+
onEdging() {
|
|
185
|
+
if (this.time != 0) {
|
|
186
|
+
console.log(TAG, "清除上次未执行的目标")
|
|
187
|
+
clearTimeout(this.time)
|
|
188
|
+
}
|
|
189
|
+
console.log(TAG, "创建目标: 贴边")
|
|
190
|
+
this.time = setTimeout(() => {
|
|
191
|
+
console.log(TAG, "进入执行目标: 贴边")
|
|
192
|
+
this.onEdgingDo()
|
|
193
|
+
}, this.aotoEdgingTime)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* 执行贴边
|
|
198
|
+
*/
|
|
199
|
+
onEdgingDo() {
|
|
200
|
+
if (this.isTouc) {
|
|
201
|
+
// 如果还在触摸中,就往后延时执行
|
|
202
|
+
console.log(TAG, "推后执行目标:在触摸中 贴边")
|
|
203
|
+
this.onEdging()
|
|
204
|
+
} else {
|
|
205
|
+
this.state = 2
|
|
206
|
+
// 隐藏动画
|
|
207
|
+
console.log(TAG, "执行目标:贴边")
|
|
208
|
+
animateTo({
|
|
209
|
+
duration: 1000,
|
|
210
|
+
onFinish: (() => {
|
|
211
|
+
console.log(TAG, "贴边动画结束")
|
|
212
|
+
let fal = true
|
|
213
|
+
// 记得清除定时器资源
|
|
214
|
+
clearTimeout(this.time)
|
|
215
|
+
this.time = 0
|
|
216
|
+
// 传递贴边事件
|
|
217
|
+
if(this.onEdgingEvent !== undefined){
|
|
218
|
+
fal = this.onEdgingEvent()
|
|
219
|
+
}
|
|
220
|
+
// 贴边动画结束 开始准备隐藏
|
|
221
|
+
if (fal && this.aotoHide) {
|
|
222
|
+
this.onHide()
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
}, () => {
|
|
226
|
+
// 修改位置
|
|
227
|
+
if (this.curLeft > this.winWidth / 2) {
|
|
228
|
+
this.curLeft = this.winWidth - this.radius * 2
|
|
229
|
+
} else {
|
|
230
|
+
this.curLeft = 0
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
// 取消定时器
|
|
234
|
+
if (this.time != 0) {
|
|
235
|
+
clearTimeout(this.time);
|
|
236
|
+
this.time = 0
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 执行隐藏动作
|
|
243
|
+
*/
|
|
244
|
+
onMyHideDo() {
|
|
245
|
+
if (this.isTouc) {
|
|
246
|
+
// 如果还在触摸中,就往后延时执行
|
|
247
|
+
console.log(TAG, "推后执行目标:在触摸中 隐藏")
|
|
248
|
+
this.onHide()
|
|
249
|
+
} else {
|
|
250
|
+
this.state = 3
|
|
251
|
+
// 隐藏动画
|
|
252
|
+
console.log(TAG, "执行目标:隐藏")
|
|
253
|
+
animateTo({
|
|
254
|
+
duration: 1000,
|
|
255
|
+
onFinish: (() => {
|
|
256
|
+
console.log(TAG, "隐藏动画结束")
|
|
257
|
+
// 记得清除定时器资源
|
|
258
|
+
clearTimeout(this.time)
|
|
259
|
+
this.time = 0
|
|
260
|
+
// 传递隐藏事件
|
|
261
|
+
if(this.onHideEvent !== undefined){
|
|
262
|
+
this.onHideEvent()
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
}, () => {
|
|
266
|
+
// 修改透明度
|
|
267
|
+
this.onOpacity()
|
|
268
|
+
// 修改坐标
|
|
269
|
+
if (this.curLeft > this.winWidth / 2) {
|
|
270
|
+
this.curLeft = this.winWidth - this.radius
|
|
271
|
+
} else {
|
|
272
|
+
this.curLeft = 0 - this.radius
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
// 取消定时器
|
|
276
|
+
if (this.time != 0) {
|
|
277
|
+
clearTimeout(this.time);
|
|
278
|
+
this.time = 0
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* 显示
|
|
285
|
+
*/
|
|
286
|
+
onMyShow() {
|
|
287
|
+
// 显示动画
|
|
288
|
+
console.log(TAG, "执行目标:显示")
|
|
289
|
+
this.state = 1
|
|
290
|
+
animateTo({
|
|
291
|
+
duration: 500, onFinish: (() => {
|
|
292
|
+
console.log(TAG, "显示动画结束")
|
|
293
|
+
let fal = true
|
|
294
|
+
// 记得清除定时器资源
|
|
295
|
+
clearTimeout(this.time)
|
|
296
|
+
this.time = 0
|
|
297
|
+
if(this.onShowEvent !== undefined){
|
|
298
|
+
fal = this.onShowEvent()
|
|
299
|
+
}
|
|
300
|
+
if(fal){
|
|
301
|
+
// 重新加载隐藏
|
|
302
|
+
this.onHide()
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
}, () => {
|
|
306
|
+
// 修改坐标
|
|
307
|
+
if (this.curLeft > this.winWidth / 2) {
|
|
308
|
+
this.curLeft = this.winWidth - this.radius * 2 - this.marginSart
|
|
309
|
+
} else {
|
|
310
|
+
this.curLeft = this.marginSart
|
|
311
|
+
}
|
|
312
|
+
})
|
|
313
|
+
// 显示后,就取消定时器
|
|
314
|
+
if (this.time != 0) {
|
|
315
|
+
clearTimeout(this.time);
|
|
316
|
+
this.time = 0
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* 启用半透明
|
|
322
|
+
*/
|
|
323
|
+
onOpacity(){
|
|
324
|
+
this.opacityN = this.opacityHide
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* 恢复默认透明度
|
|
329
|
+
*/
|
|
330
|
+
restoreOpacity(){
|
|
331
|
+
this.opacityN = this.opacityDefault
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* 判断是否是隐藏状态
|
|
336
|
+
* @returns
|
|
337
|
+
*/
|
|
338
|
+
isShow() {
|
|
339
|
+
if (this.curLeft < 0) {
|
|
340
|
+
return false
|
|
341
|
+
} else if (this.curLeft >= this.winWidth - this.radius) {
|
|
342
|
+
return false
|
|
343
|
+
}
|
|
344
|
+
return true
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* 判断是否贴边
|
|
349
|
+
* @returns
|
|
350
|
+
*/
|
|
351
|
+
ifEdging() {
|
|
352
|
+
if (this.curLeft == 0) {
|
|
353
|
+
return true
|
|
354
|
+
} else if (this.curLeft == this.winWidth - this.radius * 2) {
|
|
355
|
+
return true
|
|
356
|
+
}
|
|
357
|
+
return false
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import lottie, { AnimationItem } from "@ohos/lottie"
|
|
2
|
+
import { NavPath, replaceToMain } from "xrn-navigation"
|
|
3
|
+
|
|
4
|
+
@Component
|
|
5
|
+
export struct Splash {
|
|
6
|
+
@Consume('navigation') navigation: NavPathStack
|
|
7
|
+
private renderingSettings: RenderingContextSettings = new RenderingContextSettings(true)
|
|
8
|
+
private canvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.renderingSettings)
|
|
9
|
+
private animateItem: AnimationItem | null = null;
|
|
10
|
+
private animateName: string = "animation"; // name
|
|
11
|
+
@State
|
|
12
|
+
private showLottie: boolean = false
|
|
13
|
+
|
|
14
|
+
aboutToAppear(): void {
|
|
15
|
+
// 特殊场景处理
|
|
16
|
+
if (this.navigation.getAllPathName().indexOf(NavPath.Main) >= 0) {
|
|
17
|
+
this.navigation.popToName(NavPath.Main)
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
this.showLottie = true
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
loadAnimation() {
|
|
24
|
+
this.animateItem = lottie.loadAnimation({
|
|
25
|
+
container: this.canvasRenderingContext,
|
|
26
|
+
renderer: 'canvas', // canvas renderer
|
|
27
|
+
loop: false,
|
|
28
|
+
autoplay: false,
|
|
29
|
+
name: this.animateName,
|
|
30
|
+
contentMode: 'Contain',
|
|
31
|
+
path: "lottie/launch_screen.json",
|
|
32
|
+
})
|
|
33
|
+
this.animateItem?.addEventListener('DOMLoaded', (args: Object): void => {
|
|
34
|
+
this.animateItem?.play()
|
|
35
|
+
});
|
|
36
|
+
this.animateItem?.addEventListener('complete', (args: object): void => {
|
|
37
|
+
replaceToMain()
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
aboutToDisappear(): void {
|
|
42
|
+
console.debug(`Splash.aboutToDisappear`)
|
|
43
|
+
this.animateItem?.removeEventListener("DOMLoaded");
|
|
44
|
+
this.animateItem?.removeEventListener("complete")
|
|
45
|
+
lottie.destroy(this.animateName);
|
|
46
|
+
this.animateItem = null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
build() {
|
|
50
|
+
NavDestination() {
|
|
51
|
+
Column() {
|
|
52
|
+
if (this.showLottie) {
|
|
53
|
+
// Configure a canvas.
|
|
54
|
+
Canvas(this.canvasRenderingContext)
|
|
55
|
+
.width('100%')
|
|
56
|
+
.height('100%')
|
|
57
|
+
.backgroundColor(Color.Gray)
|
|
58
|
+
.onReady(() => {
|
|
59
|
+
// Load the animation.
|
|
60
|
+
if (this.animateItem != null) {
|
|
61
|
+
// Load animations during canvas onReady, ensure that the animation size is correct.
|
|
62
|
+
this.animateItem?.resize();
|
|
63
|
+
} else {
|
|
64
|
+
// Anti-aliasing settings.
|
|
65
|
+
this.canvasRenderingContext.imageSmoothingEnabled = true;
|
|
66
|
+
this.canvasRenderingContext.imageSmoothingQuality = 'medium'
|
|
67
|
+
this.loadAnimation();
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.width('100%')
|
|
73
|
+
.height('100%')
|
|
74
|
+
}
|
|
75
|
+
.hideTitleBar(true)
|
|
76
|
+
.hideToolBar(true)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Splash } from '../navDestination/Splash';
|
|
2
|
+
import { NavigationContainer, getModuleRouteParams, ModuleRouteParams } from 'xrn-navigation'
|
|
3
|
+
import webview from '@ohos.web.webview';
|
|
4
|
+
import { preferences } from "@kit.ArkData";
|
|
5
|
+
import { MainModuleContainer } from '../navDestination/MainModuleContainer';
|
|
6
|
+
import { BizModuleContainer } from '../navDestination/BizModuleContainer';
|
|
7
|
+
import { RN_INSTANCE_MANAGER } from 'xrn-multi-bundle';
|
|
8
|
+
import { FloatBall } from '../module/devtools/components/FloatBall'
|
|
9
|
+
import { RNInstance } from '@rnoh/react-native-openharmony';
|
|
10
|
+
import { BuildConfig } from '@react-native-oh-tpl/react-native-config/BuildConfig'
|
|
11
|
+
// const DEV_ENV_NAME = "DEV_ENV_NAME"
|
|
12
|
+
const DEV_ENV_NAME = "dev"
|
|
13
|
+
const PROD = 'prod';
|
|
14
|
+
|
|
15
|
+
@Entry
|
|
16
|
+
@Component
|
|
17
|
+
struct MainPage {
|
|
18
|
+
// @State envName: string = BuildConfig.ENV_NAME
|
|
19
|
+
|
|
20
|
+
aboutToAppear(): void {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@Builder
|
|
26
|
+
SplashBuilder(name: string) {
|
|
27
|
+
if (name === 'Splash') {
|
|
28
|
+
Splash()
|
|
29
|
+
} else if (name === 'Main') {
|
|
30
|
+
MainModuleContainer()
|
|
31
|
+
} else if (name === 'Biz') {
|
|
32
|
+
BizModuleContainer()
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
Stack() {
|
|
37
|
+
Column() {
|
|
38
|
+
NavigationContainer({
|
|
39
|
+
navDestination: this.SplashBuilder
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// if (this.envName !== PROD) {
|
|
44
|
+
FloatBall({
|
|
45
|
+
env: DEV_ENV_NAME,
|
|
46
|
+
onClickEvent: (): boolean => {
|
|
47
|
+
const params = getModuleRouteParams() as ModuleRouteParams
|
|
48
|
+
console.log('params',params)
|
|
49
|
+
let bundleName = (params.bundleName || 'xrngo-main') as string
|
|
50
|
+
console.log('bundleName',bundleName)
|
|
51
|
+
let rnInstance = RN_INSTANCE_MANAGER.getRNInstanceByBundle(bundleName) as RNInstance
|
|
52
|
+
rnInstance?.emitDeviceEvent("NATIVE_FLOAT_BAR_CLICK", { params: { where: "NATIVE" } })
|
|
53
|
+
return true
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
.hitTestBehavior(HitTestMode.None)
|
|
57
|
+
.width("100%")
|
|
58
|
+
.height("100%")
|
|
59
|
+
// }
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.width('100%')
|
|
63
|
+
.height('100%')
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
module: {
|
|
3
|
+
name: "entry",
|
|
4
|
+
type: "entry",
|
|
5
|
+
description: "$string:module_desc",
|
|
6
|
+
srcEntry: "./ets/MainAbilityStage.ets",
|
|
7
|
+
mainElement: "EntryAbility",
|
|
8
|
+
deviceTypes: ["phone", "tablet", "2in1"],
|
|
9
|
+
querySchemes: ["alipays", "amapuri", "zhihu"],
|
|
10
|
+
deliveryWithInstall: true,
|
|
11
|
+
installationFree: false,
|
|
12
|
+
pages: "$profile:main_pages",
|
|
13
|
+
abilities: [
|
|
14
|
+
{
|
|
15
|
+
name: "EntryAbility",
|
|
16
|
+
srcEntry: "./ets/entryability/EntryAbility.ets",
|
|
17
|
+
description: "$string:EntryAbility_desc",
|
|
18
|
+
icon: "$media:layered_image",
|
|
19
|
+
label: "$string:EntryAbility_label",
|
|
20
|
+
startWindowIcon: "$media:startIcon",
|
|
21
|
+
startWindowBackground: "$color:start_window_background",
|
|
22
|
+
exported: true,
|
|
23
|
+
skills: [
|
|
24
|
+
{ entities: ["entity.system.home"], actions: ["action.system.home"] },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
extensionAbilities: [
|
|
29
|
+
{
|
|
30
|
+
name: "EntryBackupAbility",
|
|
31
|
+
srcEntry: "./ets/entrybackupability/EntryBackupAbility.ets",
|
|
32
|
+
type: "backup",
|
|
33
|
+
exported: false,
|
|
34
|
+
metadata: [
|
|
35
|
+
{ name: "ohos.extension.backup", resource: "$profile:backup_config" },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
requestPermissions: [
|
|
40
|
+
{
|
|
41
|
+
name: "ohos.permission.APP_TRACKING_CONSENT",
|
|
42
|
+
reason: "$string:reason", // 如果IDE提示错误,需自行在entry/src/main/resources/base/element/string.json,中添加对应信息
|
|
43
|
+
usedScene: {},
|
|
44
|
+
},
|
|
45
|
+
{ name: "ohos.permission.INTERNET" },
|
|
46
|
+
{ name: "ohos.permission.GET_NETWORK_INFO" },
|
|
47
|
+
{
|
|
48
|
+
name: "ohos.permission.CAMERA",
|
|
49
|
+
reason: "$string:camera_reason",
|
|
50
|
+
usedScene: { abilities: ["EntryAbility"], when: "inuse" },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "ohos.permission.MICROPHONE",
|
|
54
|
+
reason: "$string:microphone_reason",
|
|
55
|
+
usedScene: { abilities: ["EntryAbility"], when: "inuse" },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "ohos.permission.APPROXIMATELY_LOCATION",
|
|
59
|
+
reason: "$string:location_reason",
|
|
60
|
+
usedScene: { abilities: ["EntryAbility"], when: "inuse" },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "ohos.permission.ACCESS_BIOMETRIC",
|
|
64
|
+
"reason": "$string:biometric_reason",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{ "name": "module_desc", "value": "module description" },
|
|
4
|
+
{ "name": "EntryAbility_desc", "value": "description" },
|
|
5
|
+
{ "name": "EntryAbility_label", "value": "XRNTemplate" },
|
|
6
|
+
{ "name": "reason", "value": "采集oaid信息用于崩溃、性能分析" },
|
|
7
|
+
{ "name": "camera_reason", "value": "使用相机" },
|
|
8
|
+
{ "name": "location_reason", "value": "获取当前位置" },
|
|
9
|
+
{ "name": "microphone_reason", "value": "使用麦克风" },
|
|
10
|
+
{
|
|
11
|
+
"name": "clipboard_reason",
|
|
12
|
+
"value": "获取剪切板内容"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "biometric_reason",
|
|
16
|
+
"value": "生物识别认证"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|