@react-navigation/native 8.0.0-alpha.5 → 8.0.0-alpha.51
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 +101 -28
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +42 -13
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +126 -24
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +42 -23
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +25 -7
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- 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 +30 -10
- package/ios/ReactNavigationSFSymbolView.swift +361 -65
- package/lib/module/Link.js +80 -24
- package/lib/module/Link.js.map +1 -1
- package/lib/module/Link.native.js +72 -0
- package/lib/module/Link.native.js.map +1 -0
- package/lib/module/NavigationContainer.js +77 -33
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/__stubs__/createStackNavigator.js +11 -8
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -1
- package/lib/module/checkSerializable.js +180 -0
- package/lib/module/checkSerializable.js.map +1 -0
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/constants.native.js +6 -0
- package/lib/module/constants.native.js.map +1 -0
- package/lib/module/createMemoryHistory.js +27 -10
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStandardNavigationFactories.js +97 -0
- package/lib/module/createStandardNavigationFactories.js.map +1 -0
- package/lib/module/createStaticNavigation.js +7 -5
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/extractPathFromURL.js +2 -2
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/getStateBreadcrumb.js +37 -0
- package/lib/module/getStateBreadcrumb.js.map +1 -0
- package/lib/module/getStateFromHref.js +2 -2
- package/lib/module/getStateFromHref.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +69 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +12 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/MaterialSymbol.android.js +19 -20
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbol.js +3 -0
- package/lib/module/native/MaterialSymbol.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +8 -4
- package/lib/module/native/NativeMaterialSymbolModule.js.map +1 -1
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/lib/module/native/SFSymbol.ios.js +37 -18
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbol.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +31 -15
- package/lib/module/server/ServerContext.js.map +1 -0
- package/lib/module/server/index.js +21 -0
- package/lib/module/server/index.js.map +1 -0
- package/lib/module/theming/DarkTheme.js +5 -5
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/LightTheme.js +16 -0
- package/lib/module/theming/LightTheme.js.map +1 -0
- package/lib/module/theming/MaterialFallbackTheme.js +28 -0
- package/lib/module/theming/MaterialFallbackTheme.js.map +1 -0
- package/lib/module/theming/MaterialTheme.android.js +33 -0
- package/lib/module/theming/MaterialTheme.android.js.map +1 -0
- package/lib/module/theming/MaterialTheme.js +4 -0
- package/lib/module/theming/MaterialTheme.js.map +1 -0
- package/lib/module/theming/fonts.js +15 -54
- package/lib/module/theming/fonts.js.map +1 -1
- package/lib/module/theming/fonts.native.js +42 -0
- package/lib/module/theming/fonts.native.js.map +1 -0
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useBackButton.native.js +4 -1
- package/lib/module/useBackButton.native.js.map +1 -1
- package/lib/module/useDeepStableValue.js +12 -0
- package/lib/module/useDeepStableValue.js.map +1 -0
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useLinkBuilder.js +17 -17
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +143 -68
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +5 -5
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +268 -58
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +31 -12
- 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/useMemoArray.js +25 -0
- package/lib/module/useMemoArray.js.map +1 -0
- package/lib/module/useRoutePath.js +1 -1
- package/lib/module/useRoutePath.js.map +1 -1
- package/lib/module/useScrollToTop.js +6 -9
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +8 -6
- package/lib/module/useThenable.js.map +1 -1
- package/lib/typescript/src/Link.d.ts +17 -9
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/Link.native.d.ts +4 -0
- package/lib/typescript/src/Link.native.d.ts.map +1 -0
- package/lib/typescript/src/LinkingContext.d.ts +2 -2
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +26 -14
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +6 -9
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/checkSerializable.d.ts +12 -0
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +4 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/constants.native.d.ts +4 -0
- package/lib/typescript/src/constants.native.d.ts.map +1 -0
- package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
- package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
- package/lib/typescript/src/createStandardNavigationFactories.d.ts +33 -0
- package/lib/typescript/src/createStandardNavigationFactories.d.ts.map +1 -0
- package/lib/typescript/src/createStaticNavigation.d.ts +9 -9
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
- package/lib/typescript/src/getStateBreadcrumb.d.ts +3 -0
- package/lib/typescript/src/getStateBreadcrumb.d.ts.map +1 -0
- package/lib/typescript/src/getStateFromHref.d.ts +3 -3
- package/lib/typescript/src/getStateFromHref.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -14
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +32 -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 +11 -5
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +10 -4
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +4 -3
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +2 -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.d.ts +8 -3
- package/lib/typescript/src/native/SFSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbol.ios.d.ts +9 -4
- package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +27 -14
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/types.d.ts +289 -52
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/{ServerContext.d.ts → server/ServerContext.d.ts} +1 -4
- package/lib/typescript/src/server/ServerContext.d.ts.map +1 -0
- package/lib/typescript/src/server/index.d.ts +10 -0
- package/lib/typescript/src/server/index.d.ts.map +1 -0
- package/lib/typescript/src/theming/DarkTheme.d.ts +4 -38
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/LightTheme.d.ts +30 -0
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/{DefaultTheme.d.ts → MaterialFallbackTheme.d.ts} +25 -30
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +115 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts +2 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/fonts.d.ts +0 -34
- package/lib/typescript/src/theming/fonts.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.native.d.ts +36 -0
- package/lib/typescript/src/theming/fonts.native.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +41 -21
- 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/useBackButton.native.d.ts.map +1 -1
- package/lib/typescript/src/useDeepStableValue.d.ts +2 -0
- package/lib/typescript/src/useDeepStableValue.d.ts.map +1 -0
- package/lib/typescript/src/useDocumentTitle.d.ts +2 -2
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +62 -70
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts +36 -12
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinkTo.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +7 -49
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +9 -83
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useLocale.d.ts +1 -1
- package/lib/typescript/src/useMemoArray.d.ts +2 -0
- package/lib/typescript/src/useMemoArray.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts +1 -4
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
- package/lib/typescript/src/useThenable.d.ts +1 -1
- package/lib/typescript/src/useThenable.d.ts.map +1 -1
- package/package.json +48 -23
- package/src/Link.native.tsx +69 -0
- package/src/Link.tsx +126 -37
- package/src/LinkingContext.tsx +1 -1
- package/src/NavigationContainer.tsx +141 -70
- package/src/__stubs__/createStackNavigator.tsx +20 -18
- package/src/checkSerializable.tsx +246 -0
- package/src/constants.native.tsx +10 -0
- package/src/constants.tsx +5 -0
- package/src/createMemoryHistory.tsx +32 -10
- package/src/createStandardNavigationFactories.tsx +217 -0
- package/src/createStaticNavigation.tsx +32 -31
- package/src/extractPathFromURL.tsx +5 -3
- package/src/getStateBreadcrumb.tsx +44 -0
- package/src/getStateFromHref.tsx +8 -3
- package/src/index.tsx +11 -2
- package/src/native/CornerInset.ios.tsx +87 -0
- package/src/native/CornerInset.tsx +44 -0
- package/src/native/MaterialSymbol.android.tsx +31 -26
- package/src/native/MaterialSymbol.tsx +16 -4
- package/src/native/MaterialSymbolData.tsx +200 -373
- package/src/native/MaterialSymbolViewNativeComponent.ts +8 -4
- package/src/native/NativeMaterialSymbolModule.ts +4 -1
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/src/native/SFSymbol.ios.tsx +80 -18
- package/src/native/SFSymbol.tsx +7 -2
- package/src/native/SFSymbolViewNativeComponent.ts +31 -15
- package/src/native/types.tsx +348 -54
- package/src/{ServerContext.tsx → server/ServerContext.tsx} +1 -4
- package/src/server/index.tsx +19 -0
- package/src/theming/DarkTheme.tsx +4 -4
- package/src/theming/{DefaultTheme.tsx → LightTheme.tsx} +4 -4
- package/src/theming/MaterialFallbackTheme.tsx +29 -0
- package/src/theming/MaterialTheme.android.tsx +45 -0
- package/src/theming/MaterialTheme.tsx +4 -0
- package/src/theming/fonts.native.tsx +41 -0
- package/src/theming/fonts.tsx +15 -54
- package/src/types.tsx +67 -45
- package/src/useBackButton.native.tsx +2 -0
- package/src/useBackButton.tsx +2 -2
- package/src/useDeepStableValue.tsx +12 -0
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +29 -25
- package/src/useLinkProps.tsx +371 -127
- package/src/useLinkTo.tsx +9 -8
- package/src/useLinking.native.tsx +70 -39
- package/src/useLinking.tsx +426 -87
- package/src/useLocale.tsx +1 -1
- package/src/useMemoArray.tsx +41 -0
- package/src/useRoutePath.tsx +1 -1
- package/src/useScrollToTop.tsx +21 -13
- package/src/useThenable.tsx +9 -7
- 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$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/MaterialSymbolTypefaceResult.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 -39
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +0 -45
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.java +0 -22
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +0 -81
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -34
- 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 -176
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -132
- 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/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsOutlined_400.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/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsOutlined_400.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$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/MaterialSymbolTypefaceResult.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/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerDelegate.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerInterface.class.uniqueId1 +0 -0
- 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$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/MaterialSymbolTypefaceResult.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/assets/fonts/MaterialSymbolsOutlined.codepoints +0 -4102
- 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/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.codepoints +0 -4102
- 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_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.codepoints +0 -4102
- 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_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/lib/module/ServerContainer.js +0 -55
- package/lib/module/ServerContainer.js.map +0 -1
- package/lib/module/ServerContext.js.map +0 -1
- package/lib/module/__stubs__/window.js +0 -75
- package/lib/module/__stubs__/window.js.map +0 -1
- package/lib/module/theming/DefaultTheme.js +0 -16
- package/lib/module/theming/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/ServerContainer.d.ts +0 -14
- package/lib/typescript/src/ServerContainer.d.ts.map +0 -1
- package/lib/typescript/src/ServerContext.d.ts.map +0 -1
- package/lib/typescript/src/__stubs__/window.d.ts +0 -18
- package/lib/typescript/src/__stubs__/window.d.ts.map +0 -1
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +0 -1
- package/src/ServerContainer.tsx +0 -57
- package/src/__stubs__/window.tsx +0 -77
- /package/lib/module/{ServerContext.js → server/ServerContext.js} +0 -0
package/android/build.gradle
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import groovy.json.JsonOutput
|
|
1
2
|
import groovy.json.JsonSlurper
|
|
2
3
|
|
|
3
4
|
buildscript {
|
|
4
5
|
ext.ReactNavigation = [
|
|
5
|
-
kotlinVersion: "2.
|
|
6
|
+
kotlinVersion: "2.1.20",
|
|
6
7
|
minSdkVersion: 24,
|
|
7
|
-
compileSdkVersion: 36
|
|
8
|
-
targetSdkVersion: 36
|
|
8
|
+
compileSdkVersion: 36
|
|
9
9
|
]
|
|
10
10
|
|
|
11
11
|
ext.getExtOrDefault = { prop ->
|
|
@@ -30,7 +30,10 @@ buildscript {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
apply plugin: "com.android.library"
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
if (project.extensions.findByName("kotlin") == null) {
|
|
35
|
+
apply plugin: "kotlin-android"
|
|
36
|
+
}
|
|
34
37
|
|
|
35
38
|
apply plugin: "com.facebook.react"
|
|
36
39
|
|
|
@@ -41,7 +44,6 @@ android {
|
|
|
41
44
|
|
|
42
45
|
defaultConfig {
|
|
43
46
|
minSdkVersion getExtOrDefault("minSdkVersion")
|
|
44
|
-
targetSdkVersion getExtOrDefault("targetSdkVersion")
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
buildTypes {
|
|
@@ -55,66 +57,137 @@ android {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
compileOptions {
|
|
58
|
-
sourceCompatibility JavaVersion.
|
|
59
|
-
targetCompatibility JavaVersion.
|
|
60
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
61
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
tasks.register('copyMaterialFonts', Copy) {
|
|
64
66
|
def packageJsonFile = file(rootDir.path + "/../package.json")
|
|
67
|
+
def materialSymbolsConfig = null
|
|
65
68
|
def fontsConfig = null
|
|
66
69
|
|
|
67
70
|
if (packageJsonFile.exists()) {
|
|
68
71
|
def packageJson = new JsonSlurper().parse(packageJsonFile)
|
|
69
72
|
|
|
70
|
-
|
|
73
|
+
materialSymbolsConfig = packageJson["react-navigation"]?.get("material-symbols")
|
|
74
|
+
fontsConfig = materialSymbolsConfig?.get("fonts")
|
|
71
75
|
}
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
def packageDir = projectDir.canonicalFile.parentFile
|
|
78
|
+
def materialSymbolsDir = [
|
|
79
|
+
new File(packageDir, "node_modules/@react-navigation/material-symbols"),
|
|
80
|
+
new File(packageDir.parentFile.parentFile, "@react-navigation/material-symbols")
|
|
81
|
+
].find { it.exists() }
|
|
82
|
+
|
|
83
|
+
if (materialSymbolsDir == null) {
|
|
84
|
+
materialSymbolsDir = new File(
|
|
85
|
+
providers.exec {
|
|
86
|
+
workingDir(projectDir)
|
|
87
|
+
commandLine("node", "--print", "require.resolve('@react-navigation/material-symbols/package.json')")
|
|
88
|
+
}.standardOutput.asText.get().trim()
|
|
89
|
+
).getParentFile()
|
|
90
|
+
}
|
|
74
91
|
|
|
75
|
-
def assetsFontsDir =
|
|
92
|
+
def assetsFontsDir = new File(materialSymbolsDir, "assets/fonts")
|
|
76
93
|
def availableFonts = assetsFontsDir.listFiles()
|
|
77
94
|
?.findAll { it.name.startsWith("MaterialSymbols") && it.name.endsWith(".ttf") }
|
|
78
95
|
?.collect { it.name.replaceFirst(/^MaterialSymbols/, '').replaceFirst(/\.ttf$/, '') } ?: []
|
|
79
96
|
|
|
80
|
-
|
|
97
|
+
if (!availableFonts && materialSymbolsConfig != null) {
|
|
98
|
+
throw new GradleException(
|
|
99
|
+
"Found \"react-navigation\" > \"material-symbols\" in package.json, but no fonts are available in \"@react-navigation/material-symbols\" at ${JsonOutput.toJson(materialSymbolsDir.path)}.\n\n" +
|
|
100
|
+
"If \"@react-navigation/material-symbols\" is overridden with an empty version, remove the override to use Material Symbols, or remove \"react-navigation\" > \"material-symbols\" from package.json."
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
def validVariants = availableFonts.collect { it.split('_')[0].uncapitalize() }.unique().sort()
|
|
81
105
|
def validWeights = availableFonts.collect { it.split('_')[1] as int }.unique().sort()
|
|
106
|
+
def validFills = availableFonts.collect { it.endsWith("_Filled") ? 1 : 0 }.unique().sort()
|
|
82
107
|
|
|
83
108
|
def errors = [] as Set
|
|
84
109
|
|
|
85
|
-
fontsConfig
|
|
86
|
-
|
|
87
|
-
|
|
110
|
+
if (fontsConfig != null && !(fontsConfig instanceof List)) {
|
|
111
|
+
errors << "Invalid fonts ${JsonOutput.toJson(fontsConfig)}. Expected an array."
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
def fonts = []
|
|
115
|
+
|
|
116
|
+
if (availableFonts) {
|
|
117
|
+
fonts = fontsConfig instanceof List ? fontsConfig : [[:]]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
fonts.each { font ->
|
|
121
|
+
if (!(font instanceof Map)) {
|
|
122
|
+
errors << "Invalid font ${JsonOutput.toJson(font)}. Expected an object."
|
|
123
|
+
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
(font.keySet() - ["variant", "weights", "fills"]).each { key ->
|
|
128
|
+
errors << "Unknown key ${JsonOutput.toJson(key)}."
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (font.variant != null && !validVariants.contains(font.variant)) {
|
|
132
|
+
errors << "Invalid variant ${JsonOutput.toJson(font.variant)}."
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (font.weights != null && !(font.weights instanceof List)) {
|
|
136
|
+
errors << "Invalid weights ${JsonOutput.toJson(font.weights)}. Expected an array."
|
|
137
|
+
} else {
|
|
138
|
+
font.weights.each { weight ->
|
|
139
|
+
if (!validWeights.contains(weight)) {
|
|
140
|
+
errors << "Invalid weight ${JsonOutput.toJson(weight)}."
|
|
141
|
+
}
|
|
142
|
+
}
|
|
88
143
|
}
|
|
89
144
|
|
|
90
|
-
font.
|
|
91
|
-
|
|
92
|
-
|
|
145
|
+
if (font.fills != null && !(font.fills instanceof List)) {
|
|
146
|
+
errors << "Invalid fills ${JsonOutput.toJson(font.fills)}. Expected an array."
|
|
147
|
+
} else {
|
|
148
|
+
font.fills.each { fill ->
|
|
149
|
+
if (!validFills.contains(fill)) {
|
|
150
|
+
errors << "Invalid fill ${JsonOutput.toJson(fill)}."
|
|
151
|
+
}
|
|
93
152
|
}
|
|
94
153
|
}
|
|
95
154
|
}
|
|
96
155
|
|
|
97
156
|
if (errors) {
|
|
98
157
|
throw new GradleException(
|
|
99
|
-
|
|
158
|
+
"Invalid Material Symbols fonts in \"react-navigation\" > \"material-symbols\" > \"fonts\" in package.json.\n\n" +
|
|
159
|
+
errors.join("\n") + "\n\n" +
|
|
160
|
+
"Available variants: ${validVariants.collect { JsonOutput.toJson(it) }.join(", ")}.\n" +
|
|
161
|
+
"Available weights: ${validWeights.join(", ")}.\n" +
|
|
162
|
+
"Available fills: ${validFills.join(", ")}."
|
|
100
163
|
)
|
|
101
164
|
}
|
|
102
165
|
|
|
103
|
-
def fontFiles =
|
|
104
|
-
def variant = font.variant
|
|
166
|
+
def fontFiles = fonts.collectMany { font ->
|
|
167
|
+
def variant = (font.variant ?: "outlined").capitalize()
|
|
168
|
+
def weights = font.weights ?: [400]
|
|
169
|
+
def fills = font.fills ?: [0]
|
|
170
|
+
|
|
171
|
+
weights.collectMany { weight ->
|
|
172
|
+
fills.collect { fill ->
|
|
173
|
+
def suffix = fill == 1 ? "_Filled" : ""
|
|
105
174
|
|
|
106
|
-
|
|
175
|
+
"MaterialSymbols${variant}_${weight}${suffix}.ttf"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
107
178
|
}
|
|
108
179
|
|
|
109
|
-
|
|
110
|
-
|
|
180
|
+
def assetFiles = fontFiles ? fontFiles + "MaterialSymbols.codepoints" + "MaterialSymbols.mirrored" : []
|
|
181
|
+
|
|
182
|
+
if (assetFiles) {
|
|
183
|
+
from(assetsFontsDir) { include assetFiles }
|
|
111
184
|
}
|
|
112
185
|
|
|
113
186
|
into layout.buildDirectory.dir("intermediates/react-navigation/fonts")
|
|
114
187
|
|
|
115
188
|
doFirst {
|
|
116
189
|
if (destinationDir.exists()) {
|
|
117
|
-
def extraFiles = destinationDir.listFiles()?.findAll { file -> !
|
|
190
|
+
def extraFiles = destinationDir.listFiles()?.findAll { file -> !assetFiles.contains(file.name) }
|
|
118
191
|
|
|
119
192
|
extraFiles?.each { file -> file.delete() }
|
|
120
193
|
}
|
|
@@ -123,11 +196,11 @@ tasks.register('copyMaterialFonts', Copy) {
|
|
|
123
196
|
doLast {
|
|
124
197
|
def digest = java.security.MessageDigest.getInstance("MD5")
|
|
125
198
|
|
|
126
|
-
|
|
127
|
-
def
|
|
199
|
+
assetFiles.sort().each { name ->
|
|
200
|
+
def assetFile = new File(assetsFontsDir, name)
|
|
128
201
|
|
|
129
|
-
if (
|
|
130
|
-
digest.update(
|
|
202
|
+
if (assetFile.exists()) {
|
|
203
|
+
digest.update(assetFile.bytes)
|
|
131
204
|
}
|
|
132
205
|
}
|
|
133
206
|
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
|
@@ -15,6 +16,7 @@ import kotlinx.coroutines.SupervisorJob
|
|
|
15
16
|
import kotlinx.coroutines.launch
|
|
16
17
|
import java.io.File
|
|
17
18
|
import java.io.FileOutputStream
|
|
19
|
+
import java.util.concurrent.ConcurrentHashMap
|
|
18
20
|
import kotlin.math.roundToInt
|
|
19
21
|
|
|
20
22
|
class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
@@ -24,6 +26,7 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
24
26
|
const val NAME = NativeMaterialSymbolModuleSpec.NAME
|
|
25
27
|
|
|
26
28
|
private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
|
|
29
|
+
private val cleanedCacheDirs = ConcurrentHashMap.newKeySet<String>()
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
private val fontHash: String by lazy {
|
|
@@ -31,8 +34,12 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
31
34
|
.trim()
|
|
32
35
|
}
|
|
33
36
|
|
|
37
|
+
override fun isAvailable(): Boolean {
|
|
38
|
+
return MaterialSymbolTypeface.isAvailable(reactApplicationContext)
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
override fun getImageSource(
|
|
35
|
-
name: String, variant: String?, weight: Double?, size: Double, color: ReadableMap
|
|
42
|
+
name: String, variant: String?, weight: Double?, fill: Boolean?, size: Double, color: ReadableMap, direction: String
|
|
36
43
|
): String {
|
|
37
44
|
val colorValue = color.getDynamic("value").let {
|
|
38
45
|
when (it.type) {
|
|
@@ -42,14 +49,15 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
val resolvedColor = ColorPropConverter.getColor(
|
|
46
|
-
|
|
52
|
+
val resolvedColor = ColorPropConverter.getColor(
|
|
53
|
+
colorValue, reactApplicationContext.currentActivity ?: reactApplicationContext
|
|
54
|
+
) ?: throw IllegalArgumentException("Invalid color value $colorValue for Material Symbol \"$name\".")
|
|
47
55
|
|
|
48
56
|
val density = reactApplicationContext.resources.displayMetrics.density
|
|
49
57
|
val scaledSize = (size * density).roundToInt().coerceAtLeast(1)
|
|
50
58
|
|
|
51
|
-
val
|
|
52
|
-
reactApplicationContext, variant, weight?.toInt()
|
|
59
|
+
val typefaceSuffix = MaterialSymbolTypeface.getSuffix(
|
|
60
|
+
reactApplicationContext, variant, weight?.toInt(), fill
|
|
53
61
|
)
|
|
54
62
|
|
|
55
63
|
val cacheDir = File(
|
|
@@ -57,20 +65,37 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
57
65
|
"react_navigation/material_symbols/$typefaceSuffix/$fontHash"
|
|
58
66
|
)
|
|
59
67
|
|
|
60
|
-
val
|
|
61
|
-
|
|
68
|
+
val mirrored =
|
|
69
|
+
direction == "rtl" && MaterialSymbolTypeface.isAutoMirrored(reactApplicationContext, name)
|
|
70
|
+
|
|
71
|
+
val cacheFile = File(
|
|
72
|
+
cacheDir, "${Uri.encode(name)}_${scaledSize}_$resolvedColor${if (mirrored) "_rtl" else ""}.png"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
val cacheUri = cacheFile.toUri().toString()
|
|
62
76
|
|
|
63
77
|
if (cacheFile.exists()) {
|
|
64
|
-
return
|
|
78
|
+
return cacheUri
|
|
65
79
|
}
|
|
66
80
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
val symbol = MaterialSymbolTypeface.getSymbol(reactApplicationContext, name)
|
|
82
|
+
?: throw IllegalArgumentException("No Material Symbol found with the name \"$name\".")
|
|
83
|
+
|
|
84
|
+
val cacheParent = cacheDir.parentFile
|
|
85
|
+
|
|
86
|
+
if (cacheParent != null && cleanedCacheDirs.add(cacheParent.absolutePath)) {
|
|
87
|
+
scope.launch {
|
|
88
|
+
cacheParent.listFiles { it.isDirectory && it.name != fontHash }
|
|
89
|
+
?.forEach { it.deleteRecursively() }
|
|
90
|
+
}
|
|
70
91
|
}
|
|
71
92
|
|
|
72
93
|
cacheDir.mkdirs()
|
|
73
94
|
|
|
95
|
+
val resolvedTypeface = MaterialSymbolTypeface.get(
|
|
96
|
+
reactApplicationContext, variant, weight?.toInt(), fill
|
|
97
|
+
).typeface
|
|
98
|
+
|
|
74
99
|
val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
|
75
100
|
typeface = resolvedTypeface
|
|
76
101
|
textSize = scaledSize.toFloat()
|
|
@@ -86,7 +111,11 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
86
111
|
val canvas = Canvas(bitmap)
|
|
87
112
|
val y = (scaledSize - (fontMetrics.descent - fontMetrics.ascent)) / 2f - fontMetrics.ascent
|
|
88
113
|
|
|
89
|
-
|
|
114
|
+
if (mirrored) {
|
|
115
|
+
canvas.scale(-1f, 1f, scaledSize / 2f, scaledSize / 2f)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
canvas.drawText(symbol, scaledSize / 2f, y, paint)
|
|
90
119
|
|
|
91
120
|
FileOutputStream(cacheFile).use {
|
|
92
121
|
bitmap.compress(Bitmap.CompressFormat.PNG, 100, it)
|
|
@@ -95,6 +124,6 @@ class MaterialSymbolModule(reactContext: ReactApplicationContext) :
|
|
|
95
124
|
bitmap.recycle()
|
|
96
125
|
}
|
|
97
126
|
|
|
98
|
-
return
|
|
127
|
+
return cacheUri
|
|
99
128
|
}
|
|
100
129
|
}
|
|
@@ -2,25 +2,36 @@ package org.reactnavigation
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.graphics.Typeface
|
|
5
|
+
import java.util.concurrent.ConcurrentHashMap
|
|
5
6
|
|
|
6
7
|
data class MaterialSymbolTypefaceResult(val typeface: Typeface, val suffix: String)
|
|
7
8
|
|
|
8
9
|
object MaterialSymbolTypeface {
|
|
9
|
-
private val
|
|
10
|
-
|
|
10
|
+
private const val CONFIG_HINT =
|
|
11
|
+
"Configure the fonts in \"react-navigation\" > \"material-symbols\" > \"fonts\" in package.json and rebuild the app."
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"sharp" -> "Sharp"
|
|
17
|
-
else -> "Outlined"
|
|
18
|
-
}
|
|
13
|
+
private val typefaces = ConcurrentHashMap<String, Typeface>()
|
|
14
|
+
private var availableFonts: Map<String, Map<Int, Set<Boolean>>>? = null
|
|
15
|
+
private var symbols: Map<String, String>? = null
|
|
16
|
+
private var autoMirroredSymbols: Set<String>? = null
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
fun isAvailable(context: Context): Boolean {
|
|
19
|
+
return getAvailableFonts(context).isNotEmpty()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
fun isAutoMirrored(context: Context, name: String): Boolean {
|
|
23
|
+
autoMirroredSymbols?.let { return it.contains(name) }
|
|
24
|
+
|
|
25
|
+
val result = context.assets.open("fonts/MaterialSymbols.mirrored").bufferedReader()
|
|
26
|
+
.useLines { lines -> lines.toSet() }
|
|
27
|
+
|
|
28
|
+
autoMirroredSymbols = result
|
|
29
|
+
|
|
30
|
+
return result.contains(name)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fun get(context: Context, variant: String?, weight: Int?, fill: Boolean?): MaterialSymbolTypefaceResult {
|
|
34
|
+
val suffix = getSuffix(context, variant, weight, fill)
|
|
24
35
|
|
|
25
36
|
val typeface = typefaces.getOrPut(suffix) {
|
|
26
37
|
val path = "fonts/MaterialSymbols${suffix}.ttf"
|
|
@@ -28,33 +39,124 @@ object MaterialSymbolTypeface {
|
|
|
28
39
|
try {
|
|
29
40
|
Typeface.createFromAsset(context.assets, path)
|
|
30
41
|
} catch (e: Exception) {
|
|
31
|
-
throw RuntimeException("$path
|
|
42
|
+
throw RuntimeException("Failed to load the Material Symbols font \"$path\".", e)
|
|
32
43
|
}
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
return MaterialSymbolTypefaceResult(typeface, suffix)
|
|
36
47
|
}
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
fun getSymbol(context: Context, name: String): String? {
|
|
50
|
+
symbols?.let { return it[name] }
|
|
40
51
|
|
|
41
|
-
val
|
|
42
|
-
|
|
52
|
+
val result = context.assets.open("fonts/MaterialSymbols.codepoints").bufferedReader()
|
|
53
|
+
.useLines { lines ->
|
|
54
|
+
lines.associate { line ->
|
|
55
|
+
val (key, codepoint) = line.split(" ")
|
|
56
|
+
|
|
57
|
+
key to String(Character.toChars(codepoint.toInt(16)))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
symbols = result
|
|
62
|
+
|
|
63
|
+
return result[name]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fun getSuffix(context: Context, variant: String?, weight: Int?, fill: Boolean?): String {
|
|
67
|
+
val fonts = getAvailableFonts(context)
|
|
43
68
|
|
|
44
69
|
if (fonts.isEmpty()) {
|
|
45
|
-
throw RuntimeException("No
|
|
70
|
+
throw RuntimeException("No Material Symbols fonts found. $CONFIG_HINT")
|
|
46
71
|
}
|
|
47
72
|
|
|
48
|
-
if (
|
|
73
|
+
val resolvedVariant = if (variant != null) {
|
|
74
|
+
when (variant) {
|
|
75
|
+
"outlined" -> "Outlined"
|
|
76
|
+
"rounded" -> "Rounded"
|
|
77
|
+
"sharp" -> "Sharp"
|
|
78
|
+
else -> throw IllegalArgumentException(
|
|
79
|
+
"Invalid Material Symbols variant \"$variant\". Expected \"outlined\", \"rounded\" or \"sharp\"."
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
resolveDefaultVariant(fonts)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
val variantName = "\"${resolvedVariant.lowercase()}\""
|
|
87
|
+
|
|
88
|
+
val weights = fonts[resolvedVariant]
|
|
89
|
+
?: throw RuntimeException("No Material Symbols font found for variant $variantName. $CONFIG_HINT")
|
|
90
|
+
|
|
91
|
+
val resolvedWeight = weight ?: resolveDefaultWeight(weights, resolvedVariant)
|
|
92
|
+
|
|
93
|
+
val fills = weights[resolvedWeight]
|
|
94
|
+
?: throw RuntimeException(
|
|
95
|
+
"No Material Symbols font found for variant $variantName and weight $resolvedWeight. $CONFIG_HINT"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
val resolvedFill = fill ?: fills.singleOrNull() ?: false
|
|
99
|
+
|
|
100
|
+
if (!fills.contains(resolvedFill)) {
|
|
49
101
|
throw RuntimeException(
|
|
50
|
-
"
|
|
102
|
+
"No Material Symbols font found for variant $variantName, weight $resolvedWeight and fill ${if (resolvedFill) 1 else 0}. $CONFIG_HINT"
|
|
51
103
|
)
|
|
52
104
|
}
|
|
53
105
|
|
|
54
|
-
|
|
106
|
+
return "${resolvedVariant}_$resolvedWeight" + if (resolvedFill) "_Filled" else ""
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private fun getAvailableFonts(context: Context): Map<String, Map<Int, Set<Boolean>>> {
|
|
110
|
+
availableFonts?.let { return it }
|
|
111
|
+
|
|
112
|
+
val files = context.assets.list("fonts")
|
|
113
|
+
?.filter { it.startsWith("MaterialSymbols") && it.endsWith(".ttf") } ?: emptyList()
|
|
114
|
+
|
|
115
|
+
val fonts = mutableMapOf<String, MutableMap<Int, MutableSet<Boolean>>>()
|
|
116
|
+
|
|
117
|
+
for (file in files) {
|
|
118
|
+
val parts = file.removePrefix("MaterialSymbols").removeSuffix(".ttf").split("_")
|
|
119
|
+
val variant = parts[0]
|
|
120
|
+
val weight = parts.getOrNull(1)?.toIntOrNull() ?: continue
|
|
121
|
+
val fill = parts.getOrNull(2) == "Filled"
|
|
122
|
+
|
|
123
|
+
fonts.getOrPut(variant) { mutableMapOf() }.getOrPut(weight) { mutableSetOf() }.add(fill)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
availableFonts = fonts
|
|
127
|
+
|
|
128
|
+
return fonts
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private fun resolveDefaultVariant(fonts: Map<String, Map<Int, Set<Boolean>>>): String {
|
|
132
|
+
val variants = fonts.keys
|
|
55
133
|
|
|
56
|
-
|
|
134
|
+
if (variants.size == 1) {
|
|
135
|
+
return variants.first()
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (variants.contains("Outlined")) {
|
|
139
|
+
return "Outlined"
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
throw RuntimeException(
|
|
143
|
+
"Multiple Material Symbols variants found: ${variants.joinToString { "\"${it.lowercase()}\"" }}. " +
|
|
144
|
+
"Specify the \"variant\" to use."
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private fun resolveDefaultWeight(weights: Map<Int, Set<Boolean>>, variant: String): Int {
|
|
149
|
+
if (weights.size == 1) {
|
|
150
|
+
return weights.keys.first()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (weights.contains(400)) {
|
|
154
|
+
return 400
|
|
155
|
+
}
|
|
57
156
|
|
|
58
|
-
|
|
157
|
+
throw RuntimeException(
|
|
158
|
+
"Multiple Material Symbols weights found for variant \"${variant.lowercase()}\": ${weights.keys.sorted().joinToString()}. " +
|
|
159
|
+
"Specify the \"weight\" to use."
|
|
160
|
+
)
|
|
59
161
|
}
|
|
60
162
|
}
|
|
@@ -11,13 +11,16 @@ class MaterialSymbolView @JvmOverloads constructor(
|
|
|
11
11
|
|
|
12
12
|
private var variant: String? = null
|
|
13
13
|
private var weight: Int? = null
|
|
14
|
+
private var fill: Boolean? = null
|
|
15
|
+
private var symbol: String? = null
|
|
16
|
+
private var autoMirrored = false
|
|
14
17
|
|
|
15
18
|
init {
|
|
16
|
-
|
|
19
|
+
setColor(null)
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
override fun onDraw(canvas: Canvas) {
|
|
20
|
-
val
|
|
23
|
+
val symbol = symbol ?: return
|
|
21
24
|
|
|
22
25
|
paint.color = currentTextColor
|
|
23
26
|
paint.textAlign = Paint.Align.CENTER
|
|
@@ -26,51 +29,67 @@ class MaterialSymbolView @JvmOverloads constructor(
|
|
|
26
29
|
val x = width / 2f
|
|
27
30
|
val y = (height - (fontMetrics.descent - fontMetrics.ascent)) / 2f - fontMetrics.ascent
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
if (autoMirrored && layoutDirection == LAYOUT_DIRECTION_RTL) {
|
|
33
|
+
canvas.scale(-1f, 1f, x, height / 2f)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
canvas.drawText(symbol, x, y, paint)
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
fun setName(name: String) {
|
|
33
|
-
|
|
39
|
+
fun setName(name: String?) {
|
|
40
|
+
symbol = name?.let { MaterialSymbolTypeface.getSymbol(context, it) }
|
|
41
|
+
autoMirrored = name?.let { MaterialSymbolTypeface.isAutoMirrored(context, it) } ?: false
|
|
34
42
|
|
|
35
43
|
invalidate()
|
|
36
44
|
}
|
|
37
45
|
|
|
38
|
-
fun setVariant(variant: String) {
|
|
39
|
-
if (this.variant == variant) {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
46
|
+
fun setVariant(variant: String?) {
|
|
43
47
|
this.variant = variant
|
|
44
|
-
|
|
45
|
-
updateTypeface()
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
fun setWeight(weight: Int) {
|
|
49
|
-
if (this.weight == weight) {
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
|
|
50
|
+
fun setWeight(weight: Int?) {
|
|
53
51
|
this.weight = weight
|
|
52
|
+
}
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
fun setFill(fill: Int) {
|
|
55
|
+
this.fill = if (fill == -1) null else fill == 1
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
fun updateTypeface() {
|
|
59
59
|
setTypeface(
|
|
60
60
|
MaterialSymbolTypeface.get(
|
|
61
61
|
context,
|
|
62
62
|
variant?.ifEmpty { null },
|
|
63
|
-
weight.takeIf { it != 0 }
|
|
63
|
+
weight.takeIf { it != 0 },
|
|
64
|
+
fill).typeface
|
|
64
65
|
)
|
|
65
66
|
|
|
66
67
|
invalidate()
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
fun setColor(color: Int) {
|
|
70
|
-
|
|
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()
|
|
71
90
|
}
|
|
72
91
|
|
|
73
92
|
fun setSize(size: Float) {
|
|
74
|
-
|
|
93
|
+
setTextSize(android.util.TypedValue.COMPLEX_UNIT_DIP, size)
|
|
75
94
|
}
|
|
76
95
|
}
|
|
@@ -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,41 @@ 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)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@ReactProp(name = "fill")
|
|
37
|
+
override fun setFill(view: MaterialSymbolView, fill: Int) {
|
|
38
|
+
view.setFill(fill)
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
@ReactProp(name = "size")
|
|
35
|
-
fun setSize(view: MaterialSymbolView, size: Float) {
|
|
42
|
+
override fun setSize(view: MaterialSymbolView, size: Float) {
|
|
36
43
|
view.setSize(size)
|
|
37
44
|
}
|
|
38
45
|
|
|
46
|
+
@ReactProp(name = "color", customType = "Color")
|
|
47
|
+
override fun setColor(view: MaterialSymbolView, color: Int?) {
|
|
48
|
+
view.setColor(color)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun onAfterUpdateTransaction(view: MaterialSymbolView) {
|
|
52
|
+
super.onAfterUpdateTransaction(view)
|
|
53
|
+
|
|
54
|
+
view.updateTypeface()
|
|
55
|
+
}
|
|
56
|
+
|
|
39
57
|
companion object {
|
|
40
58
|
const val NAME = "ReactNavigationMaterialSymbolView"
|
|
41
59
|
}
|