@react-navigation/native 8.0.0-alpha.2 → 8.0.0-alpha.21
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/android/build.gradle +96 -15
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +58 -58
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +81 -4
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +52 -7
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +14 -7
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +14 -15
- package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
- package/{android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsOutlined.ttf → assets/fonts/MaterialSymbolsOutlined_400.ttf} +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
- package/assets/fonts/{MaterialSymbolsRounded.ttf → MaterialSymbolsRounded_400.ttf} +0 -0
- package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
- package/assets/fonts/{MaterialSymbolsSharp.ttf → MaterialSymbolsSharp_400.ttf} +0 -0
- package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
- package/ios/ReactNavigationCornerInsetView.h +14 -0
- package/ios/ReactNavigationCornerInsetView.mm +182 -0
- package/ios/ReactNavigationCornerInsetView.swift +193 -0
- package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
- package/ios/ReactNavigationCornerInsetViewState.h +19 -0
- package/ios/ReactNavigationSFSymbolView.mm +21 -0
- package/ios/ReactNavigationSFSymbolView.swift +257 -7
- package/lib/module/NavigationContainer.js +16 -11
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/ServerContainer.js +5 -4
- package/lib/module/ServerContainer.js.map +1 -1
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/__stubs__/createStackNavigator.js +1 -3
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -1
- package/lib/module/createStaticNavigation.js +5 -4
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +66 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +17 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/MaterialSymbol.android.js +8 -15
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbolData.js +0 -9
- package/lib/module/native/MaterialSymbolData.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +6 -2
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/lib/module/native/SFSymbol.ios.js +24 -1
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +15 -1
- package/lib/module/native/constants.js +14 -0
- package/lib/module/native/constants.js.map +1 -0
- package/lib/module/theming/DarkTheme.js +4 -4
- package/lib/module/theming/{DefaultTheme.js → LightTheme.js} +5 -5
- package/lib/module/theming/LightTheme.js.map +1 -0
- package/lib/module/theming/MaterialTheme.android.js +29 -0
- package/lib/module/theming/MaterialTheme.android.js.map +1 -0
- package/lib/module/theming/MaterialTheme.js +18 -0
- package/lib/module/theming/MaterialTheme.js.map +1 -0
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useLinkBuilder.js +4 -4
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +5 -26
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +1 -1
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +40 -4
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +20 -3
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useLocale.js +1 -1
- package/lib/module/useLocale.js.map +1 -1
- package/lib/module/useRoutePath.js +1 -1
- package/lib/module/useRoutePath.js.map +1 -1
- package/lib/module/useScrollToTop.js +1 -1
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +12 -5
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/ServerContainer.d.ts +6 -3
- package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
- package/lib/typescript/src/ServerContext.d.ts +1 -1
- package/lib/typescript/src/ServerContext.d.ts.map +1 -1
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +5 -8
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/createStaticNavigation.d.ts +5 -5
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +28 -0
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts +2 -2
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +0 -5
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +3 -2
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts.map +1 -1
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/native/SFSymbol.ios.d.ts +1 -1
- package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +15 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/constants.d.ts +12 -0
- package/lib/typescript/src/native/constants.d.ts.map +1 -0
- package/lib/typescript/src/native/types.d.ts +143 -7
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/theming/DarkTheme.d.ts +4 -4
- package/lib/typescript/src/theming/{DefaultTheme.d.ts → LightTheme.d.ts} +5 -5
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +127 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts +114 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +13 -13
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.d.ts +1 -1
- package/lib/typescript/src/useBackButton.d.ts.map +1 -1
- package/lib/typescript/src/useDocumentTitle.d.ts +1 -1
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +56 -66
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +11 -13
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +21 -23
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/package.json +43 -26
- package/src/NavigationContainer.tsx +41 -32
- package/src/ServerContainer.tsx +3 -5
- package/src/ServerContext.tsx +6 -4
- package/src/__stubs__/createStackNavigator.tsx +6 -12
- package/src/createStaticNavigation.tsx +13 -17
- package/src/index.tsx +7 -1
- package/src/native/CornerInset.ios.tsx +85 -0
- package/src/native/CornerInset.tsx +40 -0
- package/src/native/MaterialSymbol.android.tsx +8 -19
- package/src/native/MaterialSymbolData.tsx +0 -6
- package/src/native/MaterialSymbolViewNativeComponent.ts +6 -2
- package/src/native/NativeMaterialSymbolModule.ts +3 -3
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/src/native/SFSymbol.ios.tsx +24 -1
- package/src/native/SFSymbolViewNativeComponent.ts +15 -1
- package/src/native/constants.tsx +11 -0
- package/src/native/types.tsx +182 -7
- package/src/theming/DarkTheme.tsx +4 -4
- package/src/theming/{DefaultTheme.tsx → LightTheme.tsx} +4 -4
- package/src/theming/MaterialTheme.android.tsx +30 -0
- package/src/theming/MaterialTheme.tsx +19 -0
- package/src/types.tsx +38 -36
- package/src/useBackButton.tsx +2 -2
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +11 -5
- package/src/useLinkProps.tsx +8 -41
- package/src/useLinkTo.tsx +1 -1
- package/src/useLinking.native.tsx +41 -20
- package/src/useLinking.tsx +68 -9
- package/src/useLocale.tsx +1 -1
- package/src/useRoutePath.tsx +1 -1
- package/src/useScrollToTop.tsx +1 -1
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/results.bin +0 -1
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/results.bin +0 -1
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/BuildConfig.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$WhenMappings.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$getImageSource$future$1$1$1.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypeface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolView.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/ReactNavigationPackage.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/org/reactnavigation/BuildConfig.java +0 -10
- package/android/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.java +0 -38
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +0 -42
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.java +0 -21
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +0 -39
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -20
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec-generated.cpp +0 -32
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec.h +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.cpp +0 -23
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.h +0 -25
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.cpp +0 -17
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.h +0 -30
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.cpp +0 -101
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -55
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI.h +0 -71
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.cpp +0 -18
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.h +0 -43
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.cpp +0 -16
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.h +0 -22
- package/android/build/generated/source/codegen/schema.json +0 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsRounded.ttf +0 -0
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsSharp.ttf +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsOutlined.ttf +0 -0
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsRounded.ttf +0 -0
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsSharp.ttf +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$getImageSource$future$1$1$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$getImageSource$future$1$1$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/android/gradle.properties +0 -5
- package/assets/fonts/MaterialSymbolsOutlined.ttf +0 -0
- package/lib/module/theming/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +0 -1
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import groovy.json.JsonSlurper
|
|
2
|
+
|
|
1
3
|
buildscript {
|
|
2
|
-
ext.
|
|
3
|
-
|
|
4
|
+
ext.ReactNavigation = [
|
|
5
|
+
kotlinVersion: "2.0.21",
|
|
6
|
+
minSdkVersion: 24,
|
|
7
|
+
compileSdkVersion: 36,
|
|
8
|
+
targetSdkVersion: 36
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
ext.getExtOrDefault = { prop ->
|
|
12
|
+
if (rootProject.ext.has(prop)) {
|
|
13
|
+
return rootProject.ext.get(prop)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return ReactNavigation[prop]
|
|
4
17
|
}
|
|
5
18
|
|
|
6
19
|
repositories {
|
|
@@ -21,18 +34,14 @@ apply plugin: "kotlin-android"
|
|
|
21
34
|
|
|
22
35
|
apply plugin: "com.facebook.react"
|
|
23
36
|
|
|
24
|
-
def getExtOrIntegerDefault(name) {
|
|
25
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNavigation_" + name]).toInteger()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
37
|
android {
|
|
29
38
|
namespace "org.reactnavigation"
|
|
30
39
|
|
|
31
|
-
compileSdkVersion
|
|
40
|
+
compileSdkVersion getExtOrDefault("compileSdkVersion")
|
|
32
41
|
|
|
33
42
|
defaultConfig {
|
|
34
|
-
minSdkVersion
|
|
35
|
-
targetSdkVersion
|
|
43
|
+
minSdkVersion getExtOrDefault("minSdkVersion")
|
|
44
|
+
targetSdkVersion getExtOrDefault("targetSdkVersion")
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
buildTypes {
|
|
@@ -51,15 +60,87 @@ android {
|
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
tasks.register('copyMaterialFonts', Copy) {
|
|
64
|
+
def packageJsonFile = file(rootDir.path + "/../package.json")
|
|
65
|
+
def fontsConfig = null
|
|
66
|
+
|
|
67
|
+
if (packageJsonFile.exists()) {
|
|
68
|
+
def packageJson = new JsonSlurper().parse(packageJsonFile)
|
|
69
|
+
|
|
70
|
+
fontsConfig = packageJson["react-navigation"]?.get("material-symbols")?.get("fonts")
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fontsConfig = fontsConfig != null ? fontsConfig : [[variant: "outlined", weights: [400]]]
|
|
74
|
+
|
|
75
|
+
def assetsFontsDir = file("../assets/fonts")
|
|
76
|
+
def availableFonts = assetsFontsDir.listFiles()
|
|
77
|
+
?.findAll { it.name.startsWith("MaterialSymbols") && it.name.endsWith(".ttf") }
|
|
78
|
+
?.collect { it.name.replaceFirst(/^MaterialSymbols/, '').replaceFirst(/\.ttf$/, '') } ?: []
|
|
79
|
+
|
|
80
|
+
def validVariants = availableFonts.collect { it.split('_')[0].toLowerCase() }.unique().sort()
|
|
81
|
+
def validWeights = availableFonts.collect { it.split('_')[1] as int }.unique().sort()
|
|
82
|
+
|
|
83
|
+
def errors = [] as Set
|
|
84
|
+
|
|
85
|
+
fontsConfig.each { font ->
|
|
86
|
+
if (font.variant && !validVariants.contains(font.variant.toLowerCase())) {
|
|
87
|
+
errors << "Invalid font variant: ${font.variant}"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
font.weights.each { weight ->
|
|
91
|
+
if (!validWeights.contains(weight)) {
|
|
92
|
+
errors << "Invalid font weight: ${weight}"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (errors) {
|
|
98
|
+
throw new GradleException(
|
|
99
|
+
errors.join("\n") + "\n\nAvailable variants: ${validVariants.join(", ")}.\nAvailable weights: ${validWeights.join(", ")}."
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
def fontFiles = fontsConfig.collectMany { font ->
|
|
104
|
+
def variant = font.variant?.capitalize() ?: ""
|
|
105
|
+
|
|
106
|
+
font.weights.collect { weight -> "MaterialSymbols${variant}_${weight}.ttf" }
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (fontFiles) {
|
|
110
|
+
from(assetsFontsDir) { include fontFiles }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
into layout.buildDirectory.dir("intermediates/react-navigation/fonts")
|
|
114
|
+
|
|
115
|
+
doFirst {
|
|
116
|
+
if (destinationDir.exists()) {
|
|
117
|
+
def extraFiles = destinationDir.listFiles()?.findAll { file -> !fontFiles.contains(file.name) }
|
|
118
|
+
|
|
119
|
+
extraFiles?.each { file -> file.delete() }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
doLast {
|
|
124
|
+
def digest = java.security.MessageDigest.getInstance("MD5")
|
|
125
|
+
|
|
126
|
+
fontFiles.sort().each { name ->
|
|
127
|
+
def fontFile = new File(assetsFontsDir, name)
|
|
128
|
+
|
|
129
|
+
if (fontFile.exists()) {
|
|
130
|
+
digest.update(fontFile.bytes)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
def hash = digest.digest().encodeHex().toString().take(8)
|
|
135
|
+
def hashFile = new File(destinationDir, "MaterialSymbols.hash")
|
|
136
|
+
|
|
137
|
+
hashFile.text = hash
|
|
138
|
+
}
|
|
58
139
|
}
|
|
59
140
|
|
|
60
|
-
android.sourceSets.main.assets.srcDirs +=
|
|
141
|
+
android.sourceSets.main.assets.srcDirs += layout.buildDirectory.dir("intermediates/react-navigation")
|
|
61
142
|
|
|
62
|
-
preBuild.dependsOn(
|
|
143
|
+
preBuild.dependsOn(copyMaterialFonts)
|
|
63
144
|
|
|
64
145
|
dependencies {
|
|
65
146
|
implementation "com.facebook.react:react-android"
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
package org.reactnavigation
|
|
2
2
|
|
|
3
|
+
import android.net.Uri
|
|
3
4
|
import android.graphics.Bitmap
|
|
4
5
|
import android.graphics.Canvas
|
|
5
6
|
import android.graphics.Paint
|
|
7
|
+
import androidx.core.graphics.createBitmap
|
|
6
8
|
import androidx.core.net.toUri
|
|
7
9
|
import com.facebook.fbreact.specs.NativeMaterialSymbolModuleSpec
|
|
8
10
|
import com.facebook.react.bridge.ColorPropConverter
|
|
@@ -14,23 +16,26 @@ import kotlinx.coroutines.SupervisorJob
|
|
|
14
16
|
import kotlinx.coroutines.launch
|
|
15
17
|
import java.io.File
|
|
16
18
|
import java.io.FileOutputStream
|
|
17
|
-
import java.util.concurrent.Callable
|
|
18
19
|
import java.util.concurrent.ConcurrentHashMap
|
|
19
|
-
import java.util.concurrent.Executors
|
|
20
|
-
import java.util.concurrent.Future
|
|
21
20
|
import kotlin.math.roundToInt
|
|
22
21
|
|
|
23
22
|
class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
24
23
|
NativeMaterialSymbolModuleSpec(reactContext) {
|
|
25
24
|
|
|
26
25
|
companion object {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const val NAME = NativeMaterialSymbolModuleSpec.NAME
|
|
27
|
+
|
|
29
28
|
private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
|
|
29
|
+
private val cleanedCacheDirs = ConcurrentHashMap.newKeySet<String>()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private val fontHash: String by lazy {
|
|
33
|
+
reactApplicationContext.assets.open("fonts/MaterialSymbols.hash").bufferedReader().readText()
|
|
34
|
+
.trim()
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
override fun getImageSource(
|
|
33
|
-
name: String, variant: String
|
|
38
|
+
name: String, variant: String?, weight: Double?, size: Double, color: ReadableMap
|
|
34
39
|
): String {
|
|
35
40
|
val colorValue = color.getDynamic("value").let {
|
|
36
41
|
when (it.type) {
|
|
@@ -40,72 +45,67 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
val resolvedColor = ColorPropConverter.getColor(
|
|
44
|
-
|
|
48
|
+
val resolvedColor = ColorPropConverter.getColor(
|
|
49
|
+
colorValue, currentActivity ?: reactApplicationContext
|
|
50
|
+
) ?: throw IllegalArgumentException("Could not resolve color")
|
|
45
51
|
|
|
46
52
|
val density = reactApplicationContext.resources.displayMetrics.density
|
|
47
53
|
val scaledSize = (size * density).roundToInt().coerceAtLeast(1)
|
|
48
54
|
|
|
55
|
+
val (resolvedTypeface, typefaceSuffix) = MaterialSymbolTypeface.get(
|
|
56
|
+
reactApplicationContext, variant, weight?.toInt()
|
|
57
|
+
)
|
|
58
|
+
|
|
49
59
|
val cacheDir = File(
|
|
50
|
-
reactApplicationContext.cacheDir,
|
|
60
|
+
reactApplicationContext.cacheDir,
|
|
61
|
+
"react_navigation/material_symbols/$typefaceSuffix/$fontHash"
|
|
51
62
|
)
|
|
52
63
|
|
|
53
|
-
val
|
|
54
|
-
|
|
64
|
+
val cacheFile = File(
|
|
65
|
+
cacheDir, "${Uri.encode(name)}_${scaledSize}_$resolvedColor.png"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
val cacheUri = cacheFile.toUri().toString()
|
|
55
69
|
|
|
56
70
|
if (cacheFile.exists()) {
|
|
57
|
-
return
|
|
71
|
+
return cacheUri
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
val cacheParent = cacheDir.parentFile
|
|
75
|
+
|
|
76
|
+
if (cacheParent != null && cleanedCacheDirs.add(cacheParent.absolutePath)) {
|
|
77
|
+
scope.launch {
|
|
78
|
+
cacheParent.listFiles { it.isDirectory && it.name != fontHash }
|
|
79
|
+
?.forEach { it.deleteRecursively() }
|
|
80
|
+
}
|
|
58
81
|
}
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
cacheDir.mkdirs()
|
|
70
|
-
|
|
71
|
-
val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
|
72
|
-
typeface = MaterialSymbolTypeface.get(reactApplicationContext, variant)
|
|
73
|
-
textSize = scaledSize.toFloat()
|
|
74
|
-
textAlign = Paint.Align.CENTER
|
|
75
|
-
|
|
76
|
-
this.color = resolvedColor
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
val fontMetrics = paint.fontMetrics
|
|
80
|
-
val bitmap = Bitmap.createBitmap(scaledSize, scaledSize, Bitmap.Config.ARGB_8888)
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
val canvas = Canvas(bitmap)
|
|
84
|
-
val y =
|
|
85
|
-
(scaledSize - (fontMetrics.descent - fontMetrics.ascent)) / 2f - fontMetrics.ascent
|
|
86
|
-
|
|
87
|
-
canvas.drawText(name, scaledSize / 2f, y, paint)
|
|
88
|
-
|
|
89
|
-
FileOutputStream(cacheFile).use {
|
|
90
|
-
bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
|
|
91
|
-
}
|
|
92
|
-
} finally {
|
|
93
|
-
bitmap.recycle()
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return@Callable cacheFile.toUri().toString()
|
|
97
|
-
} catch (e: Exception) {
|
|
98
|
-
futures.remove(cacheKey)
|
|
99
|
-
|
|
100
|
-
throw e
|
|
101
|
-
}
|
|
102
|
-
})
|
|
83
|
+
cacheDir.mkdirs()
|
|
84
|
+
|
|
85
|
+
val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
|
86
|
+
typeface = resolvedTypeface
|
|
87
|
+
textSize = scaledSize.toFloat()
|
|
88
|
+
textAlign = Paint.Align.CENTER
|
|
89
|
+
|
|
90
|
+
this.color = resolvedColor
|
|
103
91
|
}
|
|
104
92
|
|
|
93
|
+
val fontMetrics = paint.fontMetrics
|
|
94
|
+
val bitmap = createBitmap(scaledSize, scaledSize)
|
|
95
|
+
|
|
105
96
|
try {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
val canvas = Canvas(bitmap)
|
|
98
|
+
val y = (scaledSize - (fontMetrics.descent - fontMetrics.ascent)) / 2f - fontMetrics.ascent
|
|
99
|
+
|
|
100
|
+
canvas.drawText(name, scaledSize / 2f, y, paint)
|
|
101
|
+
|
|
102
|
+
FileOutputStream(cacheFile).use {
|
|
103
|
+
bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
|
|
104
|
+
}
|
|
105
|
+
} finally {
|
|
106
|
+
bitmap.recycle()
|
|
109
107
|
}
|
|
108
|
+
|
|
109
|
+
return cacheUri
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -2,18 +2,32 @@ package org.reactnavigation
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.graphics.Typeface
|
|
5
|
+
import java.util.concurrent.ConcurrentHashMap
|
|
6
|
+
|
|
7
|
+
data class MaterialSymbolTypefaceResult(val typeface: Typeface, val suffix: String)
|
|
5
8
|
|
|
6
9
|
object MaterialSymbolTypeface {
|
|
7
|
-
private val typefaces =
|
|
10
|
+
private val typefaces = ConcurrentHashMap<String, Typeface>()
|
|
11
|
+
private var availableFonts: Map<String, Set<Int>>? = null
|
|
12
|
+
|
|
13
|
+
fun get(context: Context, variant: String?, weight: Int?): MaterialSymbolTypefaceResult {
|
|
14
|
+
val fonts = getAvailableFonts(context)
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
val suffix = when (variant) {
|
|
16
|
+
val resolvedVariant = if (variant != null) {
|
|
17
|
+
when (variant) {
|
|
12
18
|
"rounded" -> "Rounded"
|
|
13
19
|
"sharp" -> "Sharp"
|
|
14
20
|
else -> "Outlined"
|
|
15
21
|
}
|
|
22
|
+
} else {
|
|
23
|
+
resolveDefaultVariant(fonts)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
val resolvedWeight = weight ?: resolveDefaultWeight(fonts, resolvedVariant)
|
|
27
|
+
|
|
28
|
+
val suffix = "${resolvedVariant}_$resolvedWeight"
|
|
16
29
|
|
|
30
|
+
val typeface = typefaces.getOrPut(suffix) {
|
|
17
31
|
val path = "fonts/MaterialSymbols${suffix}.ttf"
|
|
18
32
|
|
|
19
33
|
try {
|
|
@@ -22,5 +36,68 @@ object MaterialSymbolTypeface {
|
|
|
22
36
|
throw RuntimeException("$path not found.", e)
|
|
23
37
|
}
|
|
24
38
|
}
|
|
39
|
+
|
|
40
|
+
return MaterialSymbolTypefaceResult(typeface, suffix)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private fun getAvailableFonts(context: Context): Map<String, Set<Int>> {
|
|
44
|
+
availableFonts?.let { return it }
|
|
45
|
+
|
|
46
|
+
val files = context.assets.list("fonts")
|
|
47
|
+
?.filter { it.startsWith("MaterialSymbols") && it.endsWith(".ttf") } ?: emptyList()
|
|
48
|
+
|
|
49
|
+
if (files.isEmpty()) {
|
|
50
|
+
throw RuntimeException("No MaterialSymbols font found in assets.")
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
val fonts = mutableMapOf<String, MutableSet<Int>>()
|
|
54
|
+
|
|
55
|
+
for (file in files) {
|
|
56
|
+
val suffix = file.removePrefix("MaterialSymbols").removeSuffix(".ttf")
|
|
57
|
+
val variant = suffix.substringBefore("_")
|
|
58
|
+
val weight = suffix.substringAfter("_").toIntOrNull() ?: continue
|
|
59
|
+
|
|
60
|
+
fonts.getOrPut(variant) { mutableSetOf() }.add(weight)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
availableFonts = fonts
|
|
64
|
+
|
|
65
|
+
return fonts
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private fun resolveDefaultVariant(fonts: Map<String, Set<Int>>): String {
|
|
69
|
+
val variants = fonts.keys
|
|
70
|
+
|
|
71
|
+
if (variants.size == 1) {
|
|
72
|
+
return variants.first()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (variants.contains("Outlined")) {
|
|
76
|
+
return "Outlined"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw RuntimeException(
|
|
80
|
+
"Multiple MaterialSymbols variants found: ${variants.joinToString()}. " + "Please specify a variant explicitly."
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private fun resolveDefaultWeight(fonts: Map<String, Set<Int>>, variant: String): Int {
|
|
85
|
+
val weights = fonts[variant]
|
|
86
|
+
|
|
87
|
+
if (weights.isNullOrEmpty()) {
|
|
88
|
+
throw RuntimeException("No MaterialSymbols font found for variant: $variant")
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (weights.size == 1) {
|
|
92
|
+
return weights.first()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (weights.contains(400)) {
|
|
96
|
+
return 400
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
throw RuntimeException(
|
|
100
|
+
"Multiple MaterialSymbols weights found for variant $variant: ${weights.joinToString()}. " + "Please specify a weight explicitly."
|
|
101
|
+
)
|
|
25
102
|
}
|
|
26
103
|
}
|
|
@@ -4,13 +4,18 @@ import android.content.Context
|
|
|
4
4
|
import android.graphics.Canvas
|
|
5
5
|
import android.graphics.Paint
|
|
6
6
|
import android.util.AttributeSet
|
|
7
|
-
import android.widget.TextView
|
|
8
7
|
|
|
9
8
|
class MaterialSymbolView @JvmOverloads constructor(
|
|
10
9
|
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
|
11
|
-
) :
|
|
10
|
+
) : androidx.appcompat.widget.AppCompatTextView(context, attrs, defStyleAttr) {
|
|
12
11
|
|
|
13
12
|
private var variant: String? = null
|
|
13
|
+
private var weight: Int? = null
|
|
14
|
+
|
|
15
|
+
init {
|
|
16
|
+
setColor(null)
|
|
17
|
+
updateTypeface()
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
override fun onDraw(canvas: Canvas) {
|
|
16
21
|
val text = text?.toString() ?: return
|
|
@@ -25,23 +30,63 @@ class MaterialSymbolView @JvmOverloads constructor(
|
|
|
25
30
|
canvas.drawText(text, x, y, paint)
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
fun setName(name: String) {
|
|
33
|
+
fun setName(name: String?) {
|
|
29
34
|
text = name
|
|
35
|
+
|
|
36
|
+
invalidate()
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
fun setVariant(variant: String) {
|
|
39
|
+
fun setVariant(variant: String?) {
|
|
33
40
|
if (this.variant == variant) {
|
|
34
41
|
return
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
this.variant = variant
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
updateTypeface()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fun setWeight(weight: Int?) {
|
|
50
|
+
if (this.weight == weight) {
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this.weight = weight
|
|
55
|
+
|
|
56
|
+
updateTypeface()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private fun updateTypeface() {
|
|
60
|
+
setTypeface(
|
|
61
|
+
MaterialSymbolTypeface.get(
|
|
62
|
+
context,
|
|
63
|
+
variant?.ifEmpty { null },
|
|
64
|
+
weight.takeIf { it != 0 }).typeface
|
|
65
|
+
)
|
|
66
|
+
|
|
40
67
|
invalidate()
|
|
41
68
|
}
|
|
42
69
|
|
|
43
|
-
fun setColor(color: Int) {
|
|
44
|
-
|
|
70
|
+
fun setColor(color: Int?) {
|
|
71
|
+
if (color == null) {
|
|
72
|
+
val typedValue = android.util.TypedValue()
|
|
73
|
+
|
|
74
|
+
context.theme.resolveAttribute(
|
|
75
|
+
android.R.attr.colorForeground, typedValue, true
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
val resolvedColor = if (typedValue.resourceId != 0) {
|
|
79
|
+
context.getColor(typedValue.resourceId)
|
|
80
|
+
} else {
|
|
81
|
+
typedValue.data
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
setTextColor(resolvedColor)
|
|
85
|
+
} else {
|
|
86
|
+
setTextColor(color)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
invalidate()
|
|
45
90
|
}
|
|
46
91
|
|
|
47
92
|
fun setSize(size: Float) {
|
|
@@ -4,9 +4,11 @@ import com.facebook.react.module.annotations.ReactModule
|
|
|
4
4
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
5
5
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
6
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
7
|
+
import com.facebook.react.viewmanagers.ReactNavigationMaterialSymbolViewManagerInterface
|
|
7
8
|
|
|
8
9
|
@ReactModule(name = MaterialSymbolViewManager.NAME)
|
|
9
|
-
class MaterialSymbolViewManager : SimpleViewManager<MaterialSymbolView>()
|
|
10
|
+
class MaterialSymbolViewManager : SimpleViewManager<MaterialSymbolView>(),
|
|
11
|
+
ReactNavigationMaterialSymbolViewManagerInterface<MaterialSymbolView> {
|
|
10
12
|
|
|
11
13
|
override fun getName(): String {
|
|
12
14
|
return NAME
|
|
@@ -17,25 +19,30 @@ class MaterialSymbolViewManager : SimpleViewManager<MaterialSymbolView>() {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
@ReactProp(name = "name")
|
|
20
|
-
fun setName(view: MaterialSymbolView, name: String) {
|
|
22
|
+
override fun setName(view: MaterialSymbolView, name: String?) {
|
|
21
23
|
view.setName(name)
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
@ReactProp(name = "variant")
|
|
25
|
-
fun setVariant(view: MaterialSymbolView, variant: String) {
|
|
27
|
+
override fun setVariant(view: MaterialSymbolView, variant: String?) {
|
|
26
28
|
view.setVariant(variant)
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
@ReactProp(name = "
|
|
30
|
-
fun
|
|
31
|
-
view.
|
|
31
|
+
@ReactProp(name = "weight")
|
|
32
|
+
override fun setWeight(view: MaterialSymbolView, weight: Int?) {
|
|
33
|
+
view.setWeight(weight)
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
@ReactProp(name = "size")
|
|
35
|
-
fun setSize(view: MaterialSymbolView, size: Float) {
|
|
37
|
+
override fun setSize(view: MaterialSymbolView, size: Float) {
|
|
36
38
|
view.setSize(size)
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
@ReactProp(name = "color", customType = "Color")
|
|
42
|
+
override fun setColor(view: MaterialSymbolView, color: Int?) {
|
|
43
|
+
view.setColor(color)
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
companion object {
|
|
40
47
|
const val NAME = "ReactNavigationMaterialSymbolView"
|
|
41
48
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package org.reactnavigation
|
|
2
2
|
|
|
3
|
-
import com.facebook.fbreact.specs.NativeMaterialSymbolModuleSpec
|
|
4
3
|
import com.facebook.react.BaseReactPackage
|
|
5
4
|
import com.facebook.react.bridge.NativeModule
|
|
6
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -10,28 +9,28 @@ import com.facebook.react.uimanager.ViewManager
|
|
|
10
9
|
|
|
11
10
|
class ReactNavigationPackage : BaseReactPackage() {
|
|
12
11
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
13
|
-
return listOf(
|
|
12
|
+
return listOf(
|
|
13
|
+
MaterialSymbolViewManager()
|
|
14
|
+
)
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
17
18
|
return when (name) {
|
|
18
|
-
|
|
19
|
+
MaterialSymbolModule.NAME -> MaterialSymbolModule(reactContext)
|
|
19
20
|
else -> null
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
override fun getReactModuleInfoProvider()
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
true // isTurboModule
|
|
33
|
-
)
|
|
24
|
+
override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
|
|
25
|
+
mapOf(
|
|
26
|
+
MaterialSymbolModule.NAME to ReactModuleInfo(
|
|
27
|
+
name = MaterialSymbolModule.NAME,
|
|
28
|
+
className = MaterialSymbolModule.NAME,
|
|
29
|
+
canOverrideExistingModule = false,
|
|
30
|
+
needsEagerInit = false,
|
|
31
|
+
isCxxModule = false,
|
|
32
|
+
isTurboModule = true
|
|
34
33
|
)
|
|
35
|
-
|
|
34
|
+
)
|
|
36
35
|
}
|
|
37
36
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#import <React/RCTViewComponentView.h>
|
|
2
|
+
#import <UIKit/UIKit.h>
|
|
3
|
+
|
|
4
|
+
#ifndef ReactNavigationCornerInsetViewNativeComponent_h
|
|
5
|
+
#define ReactNavigationCornerInsetViewNativeComponent_h
|
|
6
|
+
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
|
|
9
|
+
@interface ReactNavigationCornerInsetView : RCTViewComponentView
|
|
10
|
+
@end
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_END
|
|
13
|
+
|
|
14
|
+
#endif /* ReactNavigationCornerInsetViewNativeComponent_h */
|