@luckylca/react-native-liquid-glass 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +294 -2
- package/README.zh-CN.md +297 -0
- package/THIRD_PARTY_NOTICES.md +98 -0
- package/android/build.gradle +19 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/expo/modules/liquidglass/EffectiveScrollInputBridge.kt +47 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassCaptureView.kt +1125 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassRegistry.kt +75 -0
- package/android/src/main/java/expo/modules/liquidglass/GlassSurfaceView.kt +571 -0
- package/android/src/main/java/expo/modules/liquidglass/LiquidGlassModule.kt +205 -0
- package/android/src/main/java/expo/modules/liquidglass/LocalMaterialView.kt +138 -0
- package/android/src/main/java/expo/modules/liquidglass/PassSurfaceSuppression.kt +39 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassProbeLog.kt +23 -0
- package/android/src/main/java/expo/modules/liquidglass/SharedGlassPassWiring.kt +59 -0
- package/android-core/build.gradle +36 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/BackdropRecorder.kt +930 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/FrozenBackdrop.kt +66 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropCoordinator.kt +624 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassBackdropSourceHandle.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassScrollSource.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassViewController.kt +1002 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassProviderLayout.kt +340 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/LiquidGlassView.kt +103 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/ReferenceSourceWindowPolicy.kt +13 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/StableSceneTexturePolicy.kt +43 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceFrameBuilder.kt +278 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/SurfaceInteraction.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassFrame.kt +110 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/GlassViewRenderer.kt +728 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceParityPasses.kt +705 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/ReferenceTabSampling.kt +15 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/internal/SharedSceneCapture.kt +163 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassCapabilities.kt +21 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassEngine.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMaterial.kt +89 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassMath.kt +131 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassOpticalInsets.kt +8 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassRenderTier.kt +54 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassShapePacker.kt +77 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassSurfaceState.kt +11 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/GlassUniforms.kt +113 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/LiquidGlassShaders.kt +234 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/SharedGlassPass.kt +456 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/G2RoundedRectangle.kt +207 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/geometry/ReferenceG2MaskTexture.kt +334 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/HeightFieldGlassShader.kt +7 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceBackdropBlurShader.kt +58 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGaussianDiscBackdropBlur.kt +42 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceGlassUniforms.kt +111 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityGlassShader.kt +613 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/ReferenceParityMultiShapeShader.kt +128 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/SdfScaleLensShader.kt +144 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassHardwareLayerExperiment.kt +29 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassMaterial.kt +14 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRenderer.kt +126 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassRuntimeShader.kt +50 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassShader.kt +59 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/local/LocalGlassView.kt +47 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionDriver.kt +824 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/GlassMotionState.kt +359 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/PointerVelocityTracker.kt +109 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/motion/SpringSpec.kt +209 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/G2Corner.kt +194 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassMaterial.kt +250 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassOpticsShader.kt +696 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassParityProbe.kt +342 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassShapeGeometry.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/GlassUniformBinder.kt +308 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/PixelDiff.kt +363 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/optics/ReferenceOptics.kt +568 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceHost.kt +317 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/GlassSurfaceRenderer.kt +847 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/rendering/RetainedBackdropLayer.kt +83 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/scheduler/GlassFrameScheduler.kt +27 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/EffectiveScrollFpsProbe.kt +965 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/GlassTelemetry.kt +16 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassPerfTelemetry.kt +676 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LiquidGlassTrace.kt +30 -0
- package/android-core/src/main/java/io/github/luckylca/liquidglass/telemetry/LocalGlassTelemetry.kt +55 -0
- package/app.plugin.js +25 -0
- package/docs/architecture.md +61 -0
- package/docs/images/buttons.webp +0 -0
- package/docs/images/controls.webp +0 -0
- package/docs/images/tabs.webp +0 -0
- package/docs/migration-0.3.md +19 -0
- package/docs/publishing.md +106 -0
- package/expo-module.config.json +10 -0
- package/lib/commonjs/GlassSurface.js +404 -0
- package/lib/commonjs/GlassSurface.js.map +1 -0
- package/lib/commonjs/GlassTabBar.js +37 -0
- package/lib/commonjs/GlassTabBar.js.map +1 -0
- package/lib/commonjs/GlassTabLens.js +67 -0
- package/lib/commonjs/GlassTabLens.js.map +1 -0
- package/lib/commonjs/LiquidGlassProvider.js +40 -0
- package/lib/commonjs/LiquidGlassProvider.js.map +1 -0
- package/lib/commonjs/LocalGlassMaterial.js +188 -0
- package/lib/commonjs/LocalGlassMaterial.js.map +1 -0
- package/lib/commonjs/adaptiveLuminance.js +14 -0
- package/lib/commonjs/adaptiveLuminance.js.map +1 -0
- package/lib/commonjs/badgePalette.js +46 -0
- package/lib/commonjs/badgePalette.js.map +1 -0
- package/lib/commonjs/buttonGesturePolicy.js +22 -0
- package/lib/commonjs/buttonGesturePolicy.js.map +1 -0
- package/lib/commonjs/components/AdaptiveLuminance.js +20 -0
- package/lib/commonjs/components/AdaptiveLuminance.js.map +1 -0
- package/lib/commonjs/components/BottomSheet.js +222 -0
- package/lib/commonjs/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/components/Button.js +20 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Card.js +206 -0
- package/lib/commonjs/components/Card.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +123 -0
- package/lib/commonjs/components/Checkbox.js.map +1 -0
- package/lib/commonjs/components/ControlPressContext.js +8 -0
- package/lib/commonjs/components/ControlPressContext.js.map +1 -0
- package/lib/commonjs/components/Dialog.js +122 -0
- package/lib/commonjs/components/Dialog.js.map +1 -0
- package/lib/commonjs/components/DialogAction.js +124 -0
- package/lib/commonjs/components/DialogAction.js.map +1 -0
- package/lib/commonjs/components/DialogContent.js +23 -0
- package/lib/commonjs/components/DialogContent.js.map +1 -0
- package/lib/commonjs/components/GlassButton.js +96 -0
- package/lib/commonjs/components/GlassButton.js.map +1 -0
- package/lib/commonjs/components/GlassFab.js +43 -0
- package/lib/commonjs/components/GlassFab.js.map +1 -0
- package/lib/commonjs/components/GlassMagnifier.js +135 -0
- package/lib/commonjs/components/GlassMagnifier.js.map +1 -0
- package/lib/commonjs/components/GlassPlayground.js +158 -0
- package/lib/commonjs/components/GlassPlayground.js.map +1 -0
- package/lib/commonjs/components/GlassSlider.js +364 -0
- package/lib/commonjs/components/GlassSlider.js.map +1 -0
- package/lib/commonjs/components/GlassSwitch.js +334 -0
- package/lib/commonjs/components/GlassSwitch.js.map +1 -0
- package/lib/commonjs/components/GlassTabBar.js +387 -0
- package/lib/commonjs/components/GlassTabBar.js.map +1 -0
- package/lib/commonjs/components/Input.js +180 -0
- package/lib/commonjs/components/Input.js.map +1 -0
- package/lib/commonjs/components/ListRow.js +64 -0
- package/lib/commonjs/components/ListRow.js.map +1 -0
- package/lib/commonjs/components/Menu.js +214 -0
- package/lib/commonjs/components/Menu.js.map +1 -0
- package/lib/commonjs/components/NavigationBar.js +20 -0
- package/lib/commonjs/components/NavigationBar.js.map +1 -0
- package/lib/commonjs/components/NumberWheel.js +273 -0
- package/lib/commonjs/components/NumberWheel.js.map +1 -0
- package/lib/commonjs/components/PageFeedList.js +25 -0
- package/lib/commonjs/components/PageFeedList.js.map +1 -0
- package/lib/commonjs/components/PageScaffold.js +161 -0
- package/lib/commonjs/components/PageScaffold.js.map +1 -0
- package/lib/commonjs/components/PreferenceGroup.js +34 -0
- package/lib/commonjs/components/PreferenceGroup.js.map +1 -0
- package/lib/commonjs/components/ProgressIndicator.js +79 -0
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -0
- package/lib/commonjs/components/ProgressiveBlur.js +29 -0
- package/lib/commonjs/components/ProgressiveBlur.js.map +1 -0
- package/lib/commonjs/components/ReferenceSlider.js +304 -0
- package/lib/commonjs/components/ReferenceSlider.js.map +1 -0
- package/lib/commonjs/components/ReferenceTabBar.js +381 -0
- package/lib/commonjs/components/ReferenceTabBar.js.map +1 -0
- package/lib/commonjs/components/SearchBar.js +200 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -0
- package/lib/commonjs/components/SegmentedControl.js +62 -0
- package/lib/commonjs/components/SegmentedControl.js.map +1 -0
- package/lib/commonjs/components/Slider.js +12 -0
- package/lib/commonjs/components/Slider.js.map +1 -0
- package/lib/commonjs/components/Snackbar.js +11 -0
- package/lib/commonjs/components/Snackbar.js.map +1 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js +35 -0
- package/lib/commonjs/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/commonjs/components/SurfaceGroup.js +39 -0
- package/lib/commonjs/components/SurfaceGroup.js.map +1 -0
- package/lib/commonjs/components/Switch.js +11 -0
- package/lib/commonjs/components/Switch.js.map +1 -0
- package/lib/commonjs/components/Toast.js +110 -0
- package/lib/commonjs/components/Toast.js.map +1 -0
- package/lib/commonjs/components/TopAppBar.js +107 -0
- package/lib/commonjs/components/TopAppBar.js.map +1 -0
- package/lib/commonjs/components/bottomSheetMotion.js +14 -0
- package/lib/commonjs/components/bottomSheetMotion.js.map +1 -0
- package/lib/commonjs/components/glassControlMaterial.js +22 -0
- package/lib/commonjs/components/glassControlMaterial.js.map +1 -0
- package/lib/commonjs/components/menuPosition.js +42 -0
- package/lib/commonjs/components/menuPosition.js.map +1 -0
- package/lib/commonjs/components/pages/FeedPage.js +15 -0
- package/lib/commonjs/components/pages/FeedPage.js.map +1 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js +123 -0
- package/lib/commonjs/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsPage.js +47 -0
- package/lib/commonjs/components/pages/SettingsPage.js.map +1 -0
- package/lib/commonjs/components/pages/SettingsSection.js +14 -0
- package/lib/commonjs/components/pages/SettingsSection.js.map +1 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js +16 -0
- package/lib/commonjs/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/commonjs/fallbackKnobGeometry.js +19 -0
- package/lib/commonjs/fallbackKnobGeometry.js.map +1 -0
- package/lib/commonjs/glassController.js +61 -0
- package/lib/commonjs/glassController.js.map +1 -0
- package/lib/commonjs/glassNativeEngine.js +16 -0
- package/lib/commonjs/glassNativeEngine.js.map +1 -0
- package/lib/commonjs/glassRuntime.js +15 -0
- package/lib/commonjs/glassRuntime.js.map +1 -0
- package/lib/commonjs/index.js +218 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/inputPresentation.js +17 -0
- package/lib/commonjs/inputPresentation.js.map +1 -0
- package/lib/commonjs/localGlassTelemetry.js +104 -0
- package/lib/commonjs/localGlassTelemetry.js.map +1 -0
- package/lib/commonjs/motion/MotionProvider.js +15 -0
- package/lib/commonjs/motion/MotionProvider.js.map +1 -0
- package/lib/commonjs/motion/easings.js +71 -0
- package/lib/commonjs/motion/easings.js.map +1 -0
- package/lib/commonjs/motion/folmeSpring.js +24 -0
- package/lib/commonjs/motion/folmeSpring.js.map +1 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js +22 -0
- package/lib/commonjs/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/commonjs/motion/index.js +57 -0
- package/lib/commonjs/motion/index.js.map +1 -0
- package/lib/commonjs/motion/presets.js +101 -0
- package/lib/commonjs/motion/presets.js.map +1 -0
- package/lib/commonjs/nativeGlassViews.js +30 -0
- package/lib/commonjs/nativeGlassViews.js.map +1 -0
- package/lib/commonjs/performanceTelemetry.js +24 -0
- package/lib/commonjs/performanceTelemetry.js.map +1 -0
- package/lib/commonjs/pointerEventBridge.js +17 -0
- package/lib/commonjs/pointerEventBridge.js.map +1 -0
- package/lib/commonjs/pointerGeometry.js +12 -0
- package/lib/commonjs/pointerGeometry.js.map +1 -0
- package/lib/commonjs/pressVelocity.js +34 -0
- package/lib/commonjs/pressVelocity.js.map +1 -0
- package/lib/commonjs/primitives/Divider.js +32 -0
- package/lib/commonjs/primitives/Divider.js.map +1 -0
- package/lib/commonjs/primitives/Icon.js +22 -0
- package/lib/commonjs/primitives/Icon.js.map +1 -0
- package/lib/commonjs/primitives/PressIndication.js +58 -0
- package/lib/commonjs/primitives/PressIndication.js.map +1 -0
- package/lib/commonjs/primitives/Pressable.js +28 -0
- package/lib/commonjs/primitives/Pressable.js.map +1 -0
- package/lib/commonjs/primitives/PressableScale.js +64 -0
- package/lib/commonjs/primitives/PressableScale.js.map +1 -0
- package/lib/commonjs/primitives/Surface.js +122 -0
- package/lib/commonjs/primitives/Surface.js.map +1 -0
- package/lib/commonjs/primitives/Text.js +43 -0
- package/lib/commonjs/primitives/Text.js.map +1 -0
- package/lib/commonjs/primitives/index.js +18 -0
- package/lib/commonjs/primitives/index.js.map +1 -0
- package/lib/commonjs/renderer.js +58 -0
- package/lib/commonjs/renderer.js.map +1 -0
- package/lib/commonjs/sliderValue.js +28 -0
- package/lib/commonjs/sliderValue.js.map +1 -0
- package/lib/commonjs/surface/InlineSurface.js +134 -0
- package/lib/commonjs/surface/InlineSurface.js.map +1 -0
- package/lib/commonjs/surface/MaterialProvider.js +78 -0
- package/lib/commonjs/surface/MaterialProvider.js.map +1 -0
- package/lib/commonjs/surface/NativeSurface.js +55 -0
- package/lib/commonjs/surface/NativeSurface.js.map +1 -0
- package/lib/commonjs/surface/PortalLayers.js +331 -0
- package/lib/commonjs/surface/PortalLayers.js.map +1 -0
- package/lib/commonjs/surface/contexts.js +108 -0
- package/lib/commonjs/surface/contexts.js.map +1 -0
- package/lib/commonjs/surface/registry.js +113 -0
- package/lib/commonjs/surface/registry.js.map +1 -0
- package/lib/commonjs/surface/styles.js +34 -0
- package/lib/commonjs/surface/styles.js.map +1 -0
- package/lib/commonjs/surface/types.js +3 -0
- package/lib/commonjs/surface/types.js.map +1 -0
- package/lib/commonjs/surfaceRendererPolicy.js +32 -0
- package/lib/commonjs/surfaceRendererPolicy.js.map +1 -0
- package/lib/commonjs/tabs/GlassTabItem.js +66 -0
- package/lib/commonjs/tabs/GlassTabItem.js.map +1 -0
- package/lib/commonjs/tabs/InlineTabBar.js +867 -0
- package/lib/commonjs/tabs/InlineTabBar.js.map +1 -0
- package/lib/commonjs/tabs/tabConstants.js +22 -0
- package/lib/commonjs/tabs/tabConstants.js.map +1 -0
- package/lib/commonjs/tabs/tabDebug.js +50 -0
- package/lib/commonjs/tabs/tabDebug.js.map +1 -0
- package/lib/commonjs/tabs/tabStyles.js +107 -0
- package/lib/commonjs/tabs/tabStyles.js.map +1 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js +227 -0
- package/lib/commonjs/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +37 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/buildTheme.js +157 -0
- package/lib/commonjs/theme/buildTheme.js.map +1 -0
- package/lib/commonjs/theme/glassColors.js +17 -0
- package/lib/commonjs/theme/glassColors.js.map +1 -0
- package/lib/commonjs/theme/index.js +38 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/liquidGlass.js +24 -0
- package/lib/commonjs/theme/liquidGlass.js.map +1 -0
- package/lib/commonjs/theme/presentation.js +14 -0
- package/lib/commonjs/theme/presentation.js.map +1 -0
- package/lib/commonjs/theme/registry.js +17 -0
- package/lib/commonjs/theme/registry.js.map +1 -0
- package/lib/commonjs/theme/selectVariant.js +13 -0
- package/lib/commonjs/theme/selectVariant.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +266 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/theme/types.js +3 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/wallpaper.js +91 -0
- package/lib/commonjs/theme/wallpaper.js.map +1 -0
- package/lib/commonjs/types.js +3 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useButtonGesture.js +135 -0
- package/lib/commonjs/useButtonGesture.js.map +1 -0
- package/lib/commonjs/useGlassKnobMotion.js +115 -0
- package/lib/commonjs/useGlassKnobMotion.js.map +1 -0
- package/lib/commonjs/useGlassPressMotion.js +147 -0
- package/lib/commonjs/useGlassPressMotion.js.map +1 -0
- package/lib/module/GlassSurface.js +354 -0
- package/lib/module/GlassSurface.js.map +1 -0
- package/lib/module/GlassTabBar.js +32 -0
- package/lib/module/GlassTabBar.js.map +1 -0
- package/lib/module/GlassTabLens.js +64 -0
- package/lib/module/GlassTabLens.js.map +1 -0
- package/lib/module/LiquidGlassProvider.js +37 -0
- package/lib/module/LiquidGlassProvider.js.map +1 -0
- package/lib/module/LocalGlassMaterial.js +185 -0
- package/lib/module/LocalGlassMaterial.js.map +1 -0
- package/lib/module/adaptiveLuminance.js +11 -0
- package/lib/module/adaptiveLuminance.js.map +1 -0
- package/lib/module/badgePalette.js +40 -0
- package/lib/module/badgePalette.js.map +1 -0
- package/lib/module/buttonGesturePolicy.js +17 -0
- package/lib/module/buttonGesturePolicy.js.map +1 -0
- package/lib/module/components/AdaptiveLuminance.js +16 -0
- package/lib/module/components/AdaptiveLuminance.js.map +1 -0
- package/lib/module/components/BottomSheet.js +186 -0
- package/lib/module/components/BottomSheet.js.map +1 -0
- package/lib/module/components/Button.js +17 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Card.js +170 -0
- package/lib/module/components/Card.js.map +1 -0
- package/lib/module/components/Checkbox.js +84 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/ControlPressContext.js +4 -0
- package/lib/module/components/ControlPressContext.js.map +1 -0
- package/lib/module/components/Dialog.js +86 -0
- package/lib/module/components/Dialog.js.map +1 -0
- package/lib/module/components/DialogAction.js +88 -0
- package/lib/module/components/DialogAction.js.map +1 -0
- package/lib/module/components/DialogContent.js +20 -0
- package/lib/module/components/DialogContent.js.map +1 -0
- package/lib/module/components/GlassButton.js +93 -0
- package/lib/module/components/GlassButton.js.map +1 -0
- package/lib/module/components/GlassFab.js +37 -0
- package/lib/module/components/GlassFab.js.map +1 -0
- package/lib/module/components/GlassMagnifier.js +99 -0
- package/lib/module/components/GlassMagnifier.js.map +1 -0
- package/lib/module/components/GlassPlayground.js +122 -0
- package/lib/module/components/GlassPlayground.js.map +1 -0
- package/lib/module/components/GlassSlider.js +328 -0
- package/lib/module/components/GlassSlider.js.map +1 -0
- package/lib/module/components/GlassSwitch.js +298 -0
- package/lib/module/components/GlassSwitch.js.map +1 -0
- package/lib/module/components/GlassTabBar.js +351 -0
- package/lib/module/components/GlassTabBar.js.map +1 -0
- package/lib/module/components/Input.js +144 -0
- package/lib/module/components/Input.js.map +1 -0
- package/lib/module/components/ListRow.js +61 -0
- package/lib/module/components/ListRow.js.map +1 -0
- package/lib/module/components/Menu.js +178 -0
- package/lib/module/components/Menu.js.map +1 -0
- package/lib/module/components/NavigationBar.js +14 -0
- package/lib/module/components/NavigationBar.js.map +1 -0
- package/lib/module/components/NumberWheel.js +238 -0
- package/lib/module/components/NumberWheel.js.map +1 -0
- package/lib/module/components/PageFeedList.js +19 -0
- package/lib/module/components/PageFeedList.js.map +1 -0
- package/lib/module/components/PageScaffold.js +114 -0
- package/lib/module/components/PageScaffold.js.map +1 -0
- package/lib/module/components/PreferenceGroup.js +28 -0
- package/lib/module/components/PreferenceGroup.js.map +1 -0
- package/lib/module/components/ProgressIndicator.js +44 -0
- package/lib/module/components/ProgressIndicator.js.map +1 -0
- package/lib/module/components/ProgressiveBlur.js +26 -0
- package/lib/module/components/ProgressiveBlur.js.map +1 -0
- package/lib/module/components/ReferenceSlider.js +268 -0
- package/lib/module/components/ReferenceSlider.js.map +1 -0
- package/lib/module/components/ReferenceTabBar.js +344 -0
- package/lib/module/components/ReferenceTabBar.js.map +1 -0
- package/lib/module/components/SearchBar.js +164 -0
- package/lib/module/components/SearchBar.js.map +1 -0
- package/lib/module/components/SegmentedControl.js +26 -0
- package/lib/module/components/SegmentedControl.js.map +1 -0
- package/lib/module/components/Slider.js +9 -0
- package/lib/module/components/Slider.js.map +1 -0
- package/lib/module/components/Snackbar.js +8 -0
- package/lib/module/components/Snackbar.js.map +1 -0
- package/lib/module/components/SurfaceEnvironmentContext.js +27 -0
- package/lib/module/components/SurfaceEnvironmentContext.js.map +1 -0
- package/lib/module/components/SurfaceGroup.js +33 -0
- package/lib/module/components/SurfaceGroup.js.map +1 -0
- package/lib/module/components/Switch.js +8 -0
- package/lib/module/components/Switch.js.map +1 -0
- package/lib/module/components/Toast.js +74 -0
- package/lib/module/components/Toast.js.map +1 -0
- package/lib/module/components/TopAppBar.js +68 -0
- package/lib/module/components/TopAppBar.js.map +1 -0
- package/lib/module/components/bottomSheetMotion.js +11 -0
- package/lib/module/components/bottomSheetMotion.js.map +1 -0
- package/lib/module/components/glassControlMaterial.js +19 -0
- package/lib/module/components/glassControlMaterial.js.map +1 -0
- package/lib/module/components/menuPosition.js +37 -0
- package/lib/module/components/menuPosition.js.map +1 -0
- package/lib/module/components/pages/FeedPage.js +12 -0
- package/lib/module/components/pages/FeedPage.js.map +1 -0
- package/lib/module/components/pages/PageBenchmarkContext.js +84 -0
- package/lib/module/components/pages/PageBenchmarkContext.js.map +1 -0
- package/lib/module/components/pages/SettingsPage.js +11 -0
- package/lib/module/components/pages/SettingsPage.js.map +1 -0
- package/lib/module/components/pages/SettingsSection.js +8 -0
- package/lib/module/components/pages/SettingsSection.js.map +1 -0
- package/lib/module/components/pages/StaticSettingsPage.js +10 -0
- package/lib/module/components/pages/StaticSettingsPage.js.map +1 -0
- package/lib/module/fallbackKnobGeometry.js +16 -0
- package/lib/module/fallbackKnobGeometry.js.map +1 -0
- package/lib/module/glassController.js +54 -0
- package/lib/module/glassController.js.map +1 -0
- package/lib/module/glassNativeEngine.js +11 -0
- package/lib/module/glassNativeEngine.js.map +1 -0
- package/lib/module/glassRuntime.js +10 -0
- package/lib/module/glassRuntime.js.map +1 -0
- package/lib/module/index.js +80 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/inputPresentation.js +14 -0
- package/lib/module/inputPresentation.js.map +1 -0
- package/lib/module/localGlassTelemetry.js +94 -0
- package/lib/module/localGlassTelemetry.js.map +1 -0
- package/lib/module/motion/MotionProvider.js +11 -0
- package/lib/module/motion/MotionProvider.js.map +1 -0
- package/lib/module/motion/easings.js +64 -0
- package/lib/module/motion/easings.js.map +1 -0
- package/lib/module/motion/folmeSpring.js +21 -0
- package/lib/module/motion/folmeSpring.js.map +1 -0
- package/lib/module/motion/folmeSpringByResponse.js +19 -0
- package/lib/module/motion/folmeSpringByResponse.js.map +1 -0
- package/lib/module/motion/index.js +6 -0
- package/lib/module/motion/index.js.map +1 -0
- package/lib/module/motion/presets.js +98 -0
- package/lib/module/motion/presets.js.map +1 -0
- package/lib/module/nativeGlassViews.js +24 -0
- package/lib/module/nativeGlassViews.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performanceTelemetry.js +19 -0
- package/lib/module/performanceTelemetry.js.map +1 -0
- package/lib/module/pointerEventBridge.js +14 -0
- package/lib/module/pointerEventBridge.js.map +1 -0
- package/lib/module/pointerGeometry.js +9 -0
- package/lib/module/pointerGeometry.js.map +1 -0
- package/lib/module/pressVelocity.js +31 -0
- package/lib/module/pressVelocity.js.map +1 -0
- package/lib/module/primitives/Divider.js +29 -0
- package/lib/module/primitives/Divider.js.map +1 -0
- package/lib/module/primitives/Icon.js +19 -0
- package/lib/module/primitives/Icon.js.map +1 -0
- package/lib/module/primitives/PressIndication.js +22 -0
- package/lib/module/primitives/PressIndication.js.map +1 -0
- package/lib/module/primitives/Pressable.js +25 -0
- package/lib/module/primitives/Pressable.js.map +1 -0
- package/lib/module/primitives/PressableScale.js +28 -0
- package/lib/module/primitives/PressableScale.js.map +1 -0
- package/lib/module/primitives/Surface.js +83 -0
- package/lib/module/primitives/Surface.js.map +1 -0
- package/lib/module/primitives/Text.js +40 -0
- package/lib/module/primitives/Text.js.map +1 -0
- package/lib/module/primitives/index.js +8 -0
- package/lib/module/primitives/index.js.map +1 -0
- package/lib/module/renderer.js +22 -0
- package/lib/module/renderer.js.map +1 -0
- package/lib/module/sliderValue.js +25 -0
- package/lib/module/sliderValue.js.map +1 -0
- package/lib/module/surface/InlineSurface.js +97 -0
- package/lib/module/surface/InlineSurface.js.map +1 -0
- package/lib/module/surface/MaterialProvider.js +74 -0
- package/lib/module/surface/MaterialProvider.js.map +1 -0
- package/lib/module/surface/NativeSurface.js +47 -0
- package/lib/module/surface/NativeSurface.js.map +1 -0
- package/lib/module/surface/PortalLayers.js +292 -0
- package/lib/module/surface/PortalLayers.js.map +1 -0
- package/lib/module/surface/contexts.js +96 -0
- package/lib/module/surface/contexts.js.map +1 -0
- package/lib/module/surface/registry.js +103 -0
- package/lib/module/surface/registry.js.map +1 -0
- package/lib/module/surface/styles.js +31 -0
- package/lib/module/surface/styles.js.map +1 -0
- package/lib/module/surface/types.js +2 -0
- package/lib/module/surface/types.js.map +1 -0
- package/lib/module/surfaceRendererPolicy.js +27 -0
- package/lib/module/surfaceRendererPolicy.js.map +1 -0
- package/lib/module/tabs/GlassTabItem.js +30 -0
- package/lib/module/tabs/GlassTabItem.js.map +1 -0
- package/lib/module/tabs/InlineTabBar.js +829 -0
- package/lib/module/tabs/InlineTabBar.js.map +1 -0
- package/lib/module/tabs/tabConstants.js +19 -0
- package/lib/module/tabs/tabConstants.js.map +1 -0
- package/lib/module/tabs/tabDebug.js +13 -0
- package/lib/module/tabs/tabDebug.js.map +1 -0
- package/lib/module/tabs/tabStyles.js +104 -0
- package/lib/module/tabs/tabStyles.js.map +1 -0
- package/lib/module/tabs/useInlineTabGesture.js +221 -0
- package/lib/module/tabs/useInlineTabGesture.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +32 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/buildTheme.js +153 -0
- package/lib/module/theme/buildTheme.js.map +1 -0
- package/lib/module/theme/glassColors.js +14 -0
- package/lib/module/theme/glassColors.js.map +1 -0
- package/lib/module/theme/index.js +9 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/liquidGlass.js +21 -0
- package/lib/module/theme/liquidGlass.js.map +1 -0
- package/lib/module/theme/presentation.js +11 -0
- package/lib/module/theme/presentation.js.map +1 -0
- package/lib/module/theme/registry.js +13 -0
- package/lib/module/theme/registry.js.map +1 -0
- package/lib/module/theme/selectVariant.js +10 -0
- package/lib/module/theme/selectVariant.js.map +1 -0
- package/lib/module/theme/tokens.js +262 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/wallpaper.js +83 -0
- package/lib/module/theme/wallpaper.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useButtonGesture.js +132 -0
- package/lib/module/useButtonGesture.js.map +1 -0
- package/lib/module/useGlassKnobMotion.js +112 -0
- package/lib/module/useGlassKnobMotion.js.map +1 -0
- package/lib/module/useGlassPressMotion.js +143 -0
- package/lib/module/useGlassPressMotion.js.map +1 -0
- package/lib/types/GlassSurface.d.ts +147 -0
- package/lib/types/GlassTabBar.d.ts +36 -0
- package/lib/types/GlassTabLens.d.ts +11 -0
- package/lib/types/LiquidGlassProvider.d.ts +47 -0
- package/lib/types/LocalGlassMaterial.d.ts +21 -0
- package/lib/types/adaptiveLuminance.d.ts +2 -0
- package/lib/types/badgePalette.d.ts +9 -0
- package/lib/types/buttonGesturePolicy.d.ts +4 -0
- package/lib/types/components/AdaptiveLuminance.d.ts +23 -0
- package/lib/types/components/BottomSheet.d.ts +33 -0
- package/lib/types/components/Button.d.ts +16 -0
- package/lib/types/components/Card.d.ts +25 -0
- package/lib/types/components/Checkbox.d.ts +11 -0
- package/lib/types/components/ControlPressContext.d.ts +9 -0
- package/lib/types/components/Dialog.d.ts +12 -0
- package/lib/types/components/DialogAction.d.ts +4 -0
- package/lib/types/components/DialogContent.d.ts +12 -0
- package/lib/types/components/GlassButton.d.ts +38 -0
- package/lib/types/components/GlassFab.d.ts +15 -0
- package/lib/types/components/GlassMagnifier.d.ts +41 -0
- package/lib/types/components/GlassPlayground.d.ts +12 -0
- package/lib/types/components/GlassSlider.d.ts +48 -0
- package/lib/types/components/GlassSwitch.d.ts +46 -0
- package/lib/types/components/GlassTabBar.d.ts +44 -0
- package/lib/types/components/Input.d.ts +47 -0
- package/lib/types/components/ListRow.d.ts +17 -0
- package/lib/types/components/Menu.d.ts +41 -0
- package/lib/types/components/NavigationBar.d.ts +14 -0
- package/lib/types/components/NumberWheel.d.ts +11 -0
- package/lib/types/components/PageFeedList.d.ts +6 -0
- package/lib/types/components/PageScaffold.d.ts +64 -0
- package/lib/types/components/PreferenceGroup.d.ts +12 -0
- package/lib/types/components/ProgressIndicator.d.ts +9 -0
- package/lib/types/components/ProgressiveBlur.d.ts +12 -0
- package/lib/types/components/ReferenceSlider.d.ts +31 -0
- package/lib/types/components/ReferenceTabBar.d.ts +61 -0
- package/lib/types/components/SearchBar.d.ts +52 -0
- package/lib/types/components/SegmentedControl.d.ts +10 -0
- package/lib/types/components/Slider.d.ts +19 -0
- package/lib/types/components/Snackbar.d.ts +5 -0
- package/lib/types/components/SurfaceEnvironmentContext.d.ts +17 -0
- package/lib/types/components/SurfaceGroup.d.ts +17 -0
- package/lib/types/components/Switch.d.ts +12 -0
- package/lib/types/components/Toast.d.ts +14 -0
- package/lib/types/components/TopAppBar.d.ts +49 -0
- package/lib/types/components/bottomSheetMotion.d.ts +2 -0
- package/lib/types/components/glassControlMaterial.d.ts +3 -0
- package/lib/types/components/menuPosition.d.ts +22 -0
- package/lib/types/components/pages/FeedPage.d.ts +31 -0
- package/lib/types/components/pages/PageBenchmarkContext.d.ts +30 -0
- package/lib/types/components/pages/SettingsPage.d.ts +20 -0
- package/lib/types/components/pages/SettingsSection.d.ts +9 -0
- package/lib/types/components/pages/StaticSettingsPage.d.ts +18 -0
- package/lib/types/fallbackKnobGeometry.d.ts +7 -0
- package/lib/types/glassController.d.ts +20 -0
- package/lib/types/glassNativeEngine.d.ts +5 -0
- package/lib/types/glassRuntime.d.ts +10 -0
- package/lib/types/index.d.ts +124 -0
- package/lib/types/inputPresentation.d.ts +12 -0
- package/lib/types/localGlassTelemetry.d.ts +28 -0
- package/lib/types/motion/MotionProvider.d.ts +7 -0
- package/lib/types/motion/easings.d.ts +33 -0
- package/lib/types/motion/folmeSpring.d.ts +15 -0
- package/lib/types/motion/folmeSpringByResponse.d.ts +14 -0
- package/lib/types/motion/index.d.ts +7 -0
- package/lib/types/motion/presets.d.ts +103 -0
- package/lib/types/nativeGlassViews.d.ts +112 -0
- package/lib/types/performanceTelemetry.d.ts +65 -0
- package/lib/types/pointerEventBridge.d.ts +17 -0
- package/lib/types/pointerGeometry.d.ts +2 -0
- package/lib/types/pressVelocity.d.ts +11 -0
- package/lib/types/primitives/Divider.d.ts +19 -0
- package/lib/types/primitives/Icon.d.ts +29 -0
- package/lib/types/primitives/PressIndication.d.ts +26 -0
- package/lib/types/primitives/Pressable.d.ts +9 -0
- package/lib/types/primitives/PressableScale.d.ts +19 -0
- package/lib/types/primitives/Surface.d.ts +63 -0
- package/lib/types/primitives/Text.d.ts +35 -0
- package/lib/types/primitives/index.d.ts +14 -0
- package/lib/types/renderer.d.ts +32 -0
- package/lib/types/sliderValue.d.ts +2 -0
- package/lib/types/surface/InlineSurface.d.ts +42 -0
- package/lib/types/surface/MaterialProvider.d.ts +46 -0
- package/lib/types/surface/NativeSurface.d.ts +11 -0
- package/lib/types/surface/PortalLayers.d.ts +33 -0
- package/lib/types/surface/contexts.d.ts +66 -0
- package/lib/types/surface/registry.d.ts +6 -0
- package/lib/types/surface/styles.d.ts +74 -0
- package/lib/types/surface/types.d.ts +118 -0
- package/lib/types/surfaceRendererPolicy.d.ts +14 -0
- package/lib/types/tabs/GlassTabItem.d.ts +20 -0
- package/lib/types/tabs/InlineTabBar.d.ts +5 -0
- package/lib/types/tabs/tabConstants.d.ts +34 -0
- package/lib/types/tabs/tabDebug.d.ts +15 -0
- package/lib/types/tabs/tabStyles.d.ts +119 -0
- package/lib/types/tabs/useInlineTabGesture.d.ts +34 -0
- package/lib/types/theme/ThemeProvider.d.ts +26 -0
- package/lib/types/theme/buildTheme.d.ts +6 -0
- package/lib/types/theme/glassColors.d.ts +13 -0
- package/lib/types/theme/index.d.ts +11 -0
- package/lib/types/theme/liquidGlass.d.ts +5 -0
- package/lib/types/theme/presentation.d.ts +3 -0
- package/lib/types/theme/registry.d.ts +7 -0
- package/lib/types/theme/selectVariant.d.ts +10 -0
- package/lib/types/theme/tokens.d.ts +18 -0
- package/lib/types/theme/types.d.ts +305 -0
- package/lib/types/theme/wallpaper.d.ts +32 -0
- package/lib/types/types.d.ts +127 -0
- package/lib/types/useButtonGesture.d.ts +30 -0
- package/lib/types/useGlassKnobMotion.d.ts +40 -0
- package/lib/types/useGlassPressMotion.d.ts +61 -0
- package/licenses/Apache-2.0-Kyant0-Shapes.txt +191 -0
- package/package.json +131 -4
- package/src/GlassSurface.tsx +676 -0
- package/src/GlassTabBar.tsx +106 -0
- package/src/GlassTabLens.tsx +92 -0
- package/src/LiquidGlassProvider.tsx +135 -0
- package/src/LocalGlassMaterial.tsx +256 -0
- package/src/adaptiveLuminance.ts +15 -0
- package/src/badgePalette.ts +54 -0
- package/src/buttonGesturePolicy.ts +15 -0
- package/src/components/AdaptiveLuminance.tsx +40 -0
- package/src/components/BottomSheet.tsx +291 -0
- package/src/components/Button.tsx +30 -0
- package/src/components/Card.tsx +343 -0
- package/src/components/Checkbox.tsx +141 -0
- package/src/components/ControlPressContext.ts +11 -0
- package/src/components/Dialog.tsx +129 -0
- package/src/components/DialogAction.tsx +109 -0
- package/src/components/DialogContent.tsx +52 -0
- package/src/components/GlassButton.tsx +225 -0
- package/src/components/GlassFab.tsx +98 -0
- package/src/components/GlassMagnifier.tsx +178 -0
- package/src/components/GlassPlayground.tsx +190 -0
- package/src/components/GlassSlider.tsx +448 -0
- package/src/components/GlassSwitch.tsx +391 -0
- package/src/components/GlassTabBar.tsx +522 -0
- package/src/components/Input.tsx +277 -0
- package/src/components/ListRow.tsx +124 -0
- package/src/components/Menu.tsx +322 -0
- package/src/components/NavigationBar.tsx +27 -0
- package/src/components/NumberWheel.tsx +344 -0
- package/src/components/PageFeedList.tsx +37 -0
- package/src/components/PageScaffold.tsx +266 -0
- package/src/components/PreferenceGroup.tsx +65 -0
- package/src/components/ProgressIndicator.tsx +63 -0
- package/src/components/ProgressiveBlur.tsx +56 -0
- package/src/components/ReferenceSlider.tsx +364 -0
- package/src/components/ReferenceTabBar.tsx +564 -0
- package/src/components/SearchBar.tsx +340 -0
- package/src/components/SegmentedControl.tsx +45 -0
- package/src/components/Slider.tsx +25 -0
- package/src/components/Snackbar.tsx +10 -0
- package/src/components/SurfaceEnvironmentContext.tsx +46 -0
- package/src/components/SurfaceGroup.tsx +60 -0
- package/src/components/Switch.tsx +18 -0
- package/src/components/Toast.tsx +110 -0
- package/src/components/TopAppBar.tsx +272 -0
- package/src/components/bottomSheetMotion.ts +10 -0
- package/src/components/glassControlMaterial.ts +20 -0
- package/src/components/menuPosition.ts +58 -0
- package/src/components/pages/FeedPage.tsx +96 -0
- package/src/components/pages/PageBenchmarkContext.tsx +105 -0
- package/src/components/pages/SettingsPage.tsx +55 -0
- package/src/components/pages/SettingsSection.tsx +20 -0
- package/src/components/pages/StaticSettingsPage.tsx +50 -0
- package/src/fallbackKnobGeometry.ts +15 -0
- package/src/glassController.ts +70 -0
- package/src/glassNativeEngine.ts +16 -0
- package/src/glassRuntime.ts +11 -0
- package/src/index.ts +199 -0
- package/src/inputPresentation.ts +32 -0
- package/src/localGlassTelemetry.ts +129 -0
- package/src/motion/MotionProvider.tsx +12 -0
- package/src/motion/easings.ts +71 -0
- package/src/motion/folmeSpring.ts +22 -0
- package/src/motion/folmeSpringByResponse.ts +19 -0
- package/src/motion/index.ts +47 -0
- package/src/motion/presets.ts +128 -0
- package/src/nativeGlassViews.ts +144 -0
- package/src/performanceTelemetry.ts +91 -0
- package/src/pointerEventBridge.ts +27 -0
- package/src/pointerGeometry.ts +8 -0
- package/src/pressVelocity.ts +36 -0
- package/src/primitives/Divider.tsx +42 -0
- package/src/primitives/Icon.tsx +44 -0
- package/src/primitives/PressIndication.tsx +43 -0
- package/src/primitives/Pressable.tsx +75 -0
- package/src/primitives/PressableScale.tsx +50 -0
- package/src/primitives/Surface.tsx +171 -0
- package/src/primitives/Text.tsx +80 -0
- package/src/primitives/index.ts +14 -0
- package/src/renderer.ts +70 -0
- package/src/sliderValue.ts +19 -0
- package/src/surface/InlineSurface.tsx +299 -0
- package/src/surface/MaterialProvider.tsx +235 -0
- package/src/surface/NativeSurface.tsx +115 -0
- package/src/surface/PortalLayers.tsx +574 -0
- package/src/surface/contexts.tsx +188 -0
- package/src/surface/registry.ts +109 -0
- package/src/surface/styles.ts +31 -0
- package/src/surface/types.ts +139 -0
- package/src/surfaceRendererPolicy.ts +32 -0
- package/src/tabs/GlassTabItem.tsx +100 -0
- package/src/tabs/InlineTabBar.tsx +1193 -0
- package/src/tabs/tabConstants.ts +35 -0
- package/src/tabs/tabDebug.ts +29 -0
- package/src/tabs/tabStyles.ts +104 -0
- package/src/tabs/useInlineTabGesture.ts +306 -0
- package/src/theme/ThemeProvider.tsx +52 -0
- package/src/theme/buildTheme.ts +160 -0
- package/src/theme/glassColors.ts +13 -0
- package/src/theme/index.ts +34 -0
- package/src/theme/liquidGlass.ts +25 -0
- package/src/theme/presentation.ts +12 -0
- package/src/theme/registry.ts +16 -0
- package/src/theme/selectVariant.ts +12 -0
- package/src/theme/tokens.ts +309 -0
- package/src/theme/types.ts +345 -0
- package/src/theme/wallpaper.ts +94 -0
- package/src/types.ts +95 -0
- package/src/useButtonGesture.ts +134 -0
- package/src/useGlassKnobMotion.ts +155 -0
- package/src/useGlassPressMotion.ts +209 -0
|
@@ -0,0 +1,1125 @@
|
|
|
1
|
+
package expo.modules.liquidglass
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.graphics.BitmapShader
|
|
5
|
+
import android.graphics.Canvas
|
|
6
|
+
import android.graphics.Rect
|
|
7
|
+
import android.graphics.RenderNode
|
|
8
|
+
import android.os.Build
|
|
9
|
+
import android.os.Looper
|
|
10
|
+
import android.view.View
|
|
11
|
+
import android.view.MotionEvent
|
|
12
|
+
import android.view.ViewGroup
|
|
13
|
+
import android.widget.ScrollView
|
|
14
|
+
import io.github.luckylca.liquidglass.backdrop.BackdropRecorder
|
|
15
|
+
import io.github.luckylca.liquidglass.backdrop.StableSceneTexturePolicy
|
|
16
|
+
import io.github.luckylca.liquidglass.backdrop.GlassBackdropCoordinator
|
|
17
|
+
import io.github.luckylca.liquidglass.backdrop.GlassBackdropCoordinatorHost
|
|
18
|
+
import io.github.luckylca.liquidglass.backdrop.GlassBackdropDirtyReason
|
|
19
|
+
import io.github.luckylca.liquidglass.backdrop.FrozenBackdrop
|
|
20
|
+
import io.github.luckylca.liquidglass.backdrop.LiquidGlassBackdropSource
|
|
21
|
+
import io.github.luckylca.liquidglass.backdrop.LiquidGlassBackdropRenderSource
|
|
22
|
+
import io.github.luckylca.liquidglass.telemetry.LiquidGlassPerfTelemetry
|
|
23
|
+
import io.github.luckylca.liquidglass.telemetry.LiquidGlassTrace
|
|
24
|
+
import expo.modules.kotlin.AppContext
|
|
25
|
+
import expo.modules.kotlin.views.ExpoView
|
|
26
|
+
import java.util.IdentityHashMap
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Set to true only while investigating the shared pass. Everything it guards runs per
|
|
30
|
+
* frame, and string concatenation per frame in a release build is real work.
|
|
31
|
+
*/
|
|
32
|
+
private const val DEBUG_SHARED_PASS = false
|
|
33
|
+
private const val DEBUG_SCROLL_WINDOW = false
|
|
34
|
+
|
|
35
|
+
/** Diagnostic switch for the tab-bar investigation; keep false. */
|
|
36
|
+
private const val PASS_FALLTHROUGH = false
|
|
37
|
+
|
|
38
|
+
internal class GlassCaptureView(
|
|
39
|
+
context: Context,
|
|
40
|
+
appContext: AppContext,
|
|
41
|
+
) : ExpoView(context, appContext), LiquidGlassBackdropSource, GlassBackdropCoordinatorHost {
|
|
42
|
+
private val recorder = BackdropRecorder()
|
|
43
|
+
private val sceneTexturePolicy = StableSceneTexturePolicy()
|
|
44
|
+
private val sourceLocation = IntArray(2)
|
|
45
|
+
private val consumerLocation = IntArray(2)
|
|
46
|
+
private val cachedSourceWindowOrigin = IntArray(2)
|
|
47
|
+
private var cachedSourceWindowAtNs = 0L
|
|
48
|
+
private var cachedSourceWindowValid = false
|
|
49
|
+
private val settledTextureInvalidate: () -> Unit = {
|
|
50
|
+
if (!coordinator.isScrollActive && isAttachedToWindow && recorder.hasConsumers) {
|
|
51
|
+
recorder.invalidateConsumers()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
private val consumerBounds = IdentityHashMap<View, Rect>()
|
|
55
|
+
/** Consumers that the current dispatch will actually composite in SharedGlassPass. */
|
|
56
|
+
private val sharedPassEligibleConsumers = java.util.Collections.newSetFromMap(
|
|
57
|
+
IdentityHashMap<View, Boolean>(),
|
|
58
|
+
)
|
|
59
|
+
private var frozenBackdrop: FrozenBackdrop? = null
|
|
60
|
+
private var backdropDirty = true
|
|
61
|
+
private var oneShotCaptured = false
|
|
62
|
+
private var scrollWindowCapturePending = false
|
|
63
|
+
private var scrollWindowCaptureActive = false
|
|
64
|
+
private var scrollWindowBounds: Rect? = null
|
|
65
|
+
private var recordedScrollOffsetY = 0
|
|
66
|
+
private var cachedScrollView: java.lang.ref.WeakReference<ScrollView>? = null
|
|
67
|
+
private var scrollViewScanned = false
|
|
68
|
+
|
|
69
|
+
private var windowWasVisible = false
|
|
70
|
+
private val consumerLayoutListener = View.OnLayoutChangeListener { consumer, _, _, _, _, _, _, _, _ ->
|
|
71
|
+
updateConsumerBounds(consumer)
|
|
72
|
+
}
|
|
73
|
+
private val directChildBounds = IdentityHashMap<View, Rect>()
|
|
74
|
+
private val directChildLayoutListener = View.OnLayoutChangeListener { child, left, top, right, bottom, _, _, _, _ ->
|
|
75
|
+
val next = Rect(left, top, right, bottom)
|
|
76
|
+
val previous = directChildBounds.put(child, next)
|
|
77
|
+
if (previous != next && shouldCapture()) {
|
|
78
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_GEOMETRY)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var providerId: String = "default"
|
|
83
|
+
set(value) {
|
|
84
|
+
if (field == value) return
|
|
85
|
+
if (isAttachedToWindow) {
|
|
86
|
+
GlassRegistry.unregisterProvider(field, this)
|
|
87
|
+
LiquidGlassPerfTelemetry.removeProviderGeometry(field)
|
|
88
|
+
}
|
|
89
|
+
field = value
|
|
90
|
+
if (isAttachedToWindow) {
|
|
91
|
+
GlassRegistry.registerProvider(value, this)
|
|
92
|
+
reportProviderGeometry()
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var underlayProviderId: String? = null
|
|
97
|
+
set(value) {
|
|
98
|
+
if (field == value) return
|
|
99
|
+
field = value
|
|
100
|
+
if (shouldCapture()) coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_REVISION)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Private pass-through sources paint only into their retained recording. */
|
|
104
|
+
var captureOnly: Boolean = false
|
|
105
|
+
set(value) {
|
|
106
|
+
if (field == value) return
|
|
107
|
+
field = value
|
|
108
|
+
invalidate()
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var captureMode: String = "live"
|
|
112
|
+
set(value) {
|
|
113
|
+
if (field == value) return
|
|
114
|
+
field = value
|
|
115
|
+
when (value) {
|
|
116
|
+
"oneShot", "oneShotPassThrough", "livePassThrough" -> {
|
|
117
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
118
|
+
oneShotCaptured = false
|
|
119
|
+
backdropDirty = true
|
|
120
|
+
resetScrollWindow()
|
|
121
|
+
frozenBackdrop?.release()
|
|
122
|
+
frozenBackdrop = null
|
|
123
|
+
updateScrollObservation()
|
|
124
|
+
coordinator.markDirty(GlassBackdropDirtyReason.INITIAL_CAPTURE)
|
|
125
|
+
}
|
|
126
|
+
"frozen" -> {
|
|
127
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
128
|
+
resetScrollWindow()
|
|
129
|
+
backdropDirty = false
|
|
130
|
+
oneShotCaptured = true
|
|
131
|
+
updateScrollObservation()
|
|
132
|
+
}
|
|
133
|
+
"static" -> {
|
|
134
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
135
|
+
resetScrollWindow()
|
|
136
|
+
if (!recorder.hasRecording) coordinator.markDirty(GlassBackdropDirtyReason.INITIAL_CAPTURE)
|
|
137
|
+
updateScrollObservation()
|
|
138
|
+
}
|
|
139
|
+
else -> {
|
|
140
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
141
|
+
resetScrollWindow()
|
|
142
|
+
oneShotCaptured = false
|
|
143
|
+
frozenBackdrop?.release()
|
|
144
|
+
frozenBackdrop = null
|
|
145
|
+
updateScrollObservation()
|
|
146
|
+
if (recorder.hasConsumers) coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_REVISION)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
var snapshotBlurRadiusDp: Float = 0f
|
|
152
|
+
set(value) {
|
|
153
|
+
val next = value.coerceAtLeast(0f)
|
|
154
|
+
if (field == next) return
|
|
155
|
+
field = next
|
|
156
|
+
if (captureMode == "oneShot" || captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") {
|
|
157
|
+
oneShotCaptured = false
|
|
158
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_REVISION)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var sourceRevision: String? = null
|
|
163
|
+
set(value) {
|
|
164
|
+
if (field == value) return
|
|
165
|
+
field = value
|
|
166
|
+
if (captureMode == "oneShot" || captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") oneShotCaptured = false
|
|
167
|
+
if (shouldCapture()) coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_REVISION)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private val coordinator = GlassBackdropCoordinator(
|
|
171
|
+
sourceView = this,
|
|
172
|
+
providerId = { providerId },
|
|
173
|
+
host = this,
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
init {
|
|
177
|
+
// Android ViewGroup skips invalidate()/dispatchDraw() when WILL_NOT_DRAW
|
|
178
|
+
// is true and no child was explicitly invalidated; enable drawing so
|
|
179
|
+
// coordinator.requestBackdropSourceRecord() always executes on route mount.
|
|
180
|
+
setWillNotDraw(false)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
override val hasBackdropConsumers: Boolean
|
|
184
|
+
get() = recorder.hasConsumers
|
|
185
|
+
|
|
186
|
+
fun setDetailedScrollTelemetryEnabled(enabled: Boolean) {
|
|
187
|
+
if (Looper.myLooper() == Looper.getMainLooper()) {
|
|
188
|
+
coordinator.setDetailedScrollTelemetryEnabled(enabled)
|
|
189
|
+
} else {
|
|
190
|
+
post { coordinator.setDetailedScrollTelemetryEnabled(enabled) }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
|
195
|
+
coordinator.onMotionEvent(event)
|
|
196
|
+
return super.dispatchTouchEvent(event)
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
override val canCaptureBackdrop: Boolean
|
|
200
|
+
get() = isAttachedToWindow && shouldCapture() && width > 0 && height > 0
|
|
201
|
+
|
|
202
|
+
override val sourceView: View
|
|
203
|
+
get() = this
|
|
204
|
+
|
|
205
|
+
override fun requestBackdropSourceRecord() {
|
|
206
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
207
|
+
if (tracing) LiquidGlassTrace.beginSection("Provider.requestBackdropSourceRecord")
|
|
208
|
+
try {
|
|
209
|
+
if (tracing) LiquidGlassTrace.counter("${traceProviderId()}.requestSourceRecord", 1L)
|
|
210
|
+
if (!canCaptureBackdrop) {
|
|
211
|
+
coordinator.sourceRecordDeferred()
|
|
212
|
+
return
|
|
213
|
+
}
|
|
214
|
+
backdropDirty = true
|
|
215
|
+
postInvalidateOnAnimation()
|
|
216
|
+
} finally {
|
|
217
|
+
if (tracing) LiquidGlassTrace.endSection()
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
override fun refreshBackdropConsumers() {
|
|
222
|
+
recorder.invalidateConsumers()
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
override fun onBackdropScrollReuseFrame() {
|
|
226
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
227
|
+
if (tracing) LiquidGlassTrace.beginSection("Provider.onBackdropScrollReuseFrame")
|
|
228
|
+
try {
|
|
229
|
+
LiquidGlassPerfTelemetry.routeScrollReuse()
|
|
230
|
+
val scroll = resolveVerticalScrollView()
|
|
231
|
+
if (tracing) {
|
|
232
|
+
LiquidGlassTrace.counter("${traceProviderId()}.scrollY", scroll?.scrollY?.toLong() ?: -1L)
|
|
233
|
+
LiquidGlassTrace.counter("${traceProviderId()}.scrollRangeY", scroll?.let { maxOf(0, (it.getChildAt(0)?.height ?: it.height) - it.height).toLong() } ?: -1L)
|
|
234
|
+
LiquidGlassTrace.counter("${traceProviderId()}.scrollWindowActive", if (scrollWindowCaptureActive) 1L else 0L)
|
|
235
|
+
LiquidGlassTrace.counter("${traceProviderId()}.scrollWindowPending", if (scrollWindowCapturePending) 1L else 0L)
|
|
236
|
+
}
|
|
237
|
+
if (captureMode == "oneShotPassThrough" && scroll != null && consumerBounds.isNotEmpty() && width > 0 && height > 0) {
|
|
238
|
+
val scrollOffsetY = scroll.scrollY
|
|
239
|
+
if (!scrollWindowCaptureActive || shouldRecordScrollWindow(scrollOffsetY)) {
|
|
240
|
+
if (!scrollWindowCaptureActive) recorder.clearConsumerRegions()
|
|
241
|
+
scrollWindowCapturePending = true
|
|
242
|
+
backdropDirty = true
|
|
243
|
+
postInvalidateOnAnimation()
|
|
244
|
+
} else {
|
|
245
|
+
recorder.invalidateConsumers()
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
recorder.invalidateConsumers()
|
|
249
|
+
}
|
|
250
|
+
} finally {
|
|
251
|
+
if (tracing) LiquidGlassTrace.endSection()
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
override fun hasWindowedRecordingOnly(): Boolean = scrollWindowCaptureActive
|
|
256
|
+
|
|
257
|
+
override val contentRenderNode: RenderNode?
|
|
258
|
+
get() = frozenBackdrop?.contentRenderNode ?: recorder.contentNode
|
|
259
|
+
|
|
260
|
+
override val hasRecording: Boolean
|
|
261
|
+
get() = contentRenderNode?.hasDisplayList() == true
|
|
262
|
+
|
|
263
|
+
override val requiresCaptureOnConsumerMovement: Boolean
|
|
264
|
+
get() = false
|
|
265
|
+
|
|
266
|
+
override val recordedOriginX: Int
|
|
267
|
+
get() = recorder.originX
|
|
268
|
+
|
|
269
|
+
override val recordedOriginY: Int
|
|
270
|
+
get() = recorder.originY
|
|
271
|
+
|
|
272
|
+
override fun renderNodeFor(consumer: View): RenderNode? =
|
|
273
|
+
recorder.regionNodeFor(consumer) ?: contentRenderNode
|
|
274
|
+
|
|
275
|
+
override fun renderRevisionFor(consumer: View): Long = recorder.recordingRevision
|
|
276
|
+
|
|
277
|
+
override fun recordedOriginXFor(consumer: View): Int = recorder.recordedOriginXFor(consumer)
|
|
278
|
+
|
|
279
|
+
override fun recordedOriginYFor(consumer: View): Int = recorder.recordedOriginYFor(consumer)
|
|
280
|
+
|
|
281
|
+
override fun contentOriginXFor(consumer: View): Int = recorder.originX
|
|
282
|
+
|
|
283
|
+
override fun contentOriginYFor(consumer: View): Int = recorder.originY
|
|
284
|
+
|
|
285
|
+
private fun allowsSharedSceneTextures(): Boolean = sceneTexturePolicy.allows(
|
|
286
|
+
mode = captureMode,
|
|
287
|
+
revision = recorder.recordingRevision,
|
|
288
|
+
nowNs = System.nanoTime(),
|
|
289
|
+
sourceDirty = backdropDirty || coordinator.hasPendingSourceRerecord,
|
|
290
|
+
sourceMoving = coordinator.isScrollActive,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
override fun contentShaderFor(consumer: View): BitmapShader? {
|
|
294
|
+
if (!allowsSharedSceneTextures() || Build.VERSION.SDK_INT < 33) return null
|
|
295
|
+
if (frozenBackdrop != null) return null
|
|
296
|
+
return recorder.contentTextureShader(settledTextureInvalidate)
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
override fun getCachedSourceWindowOrigin(out: IntArray) {
|
|
300
|
+
val now = System.nanoTime()
|
|
301
|
+
if (cachedSourceWindowValid && now - cachedSourceWindowAtNs < 2_000_000L) {
|
|
302
|
+
out[0] = cachedSourceWindowOrigin[0]
|
|
303
|
+
out[1] = cachedSourceWindowOrigin[1]
|
|
304
|
+
return
|
|
305
|
+
}
|
|
306
|
+
getLocationInWindow(cachedSourceWindowOrigin)
|
|
307
|
+
cachedSourceWindowAtNs = now
|
|
308
|
+
cachedSourceWindowValid = true
|
|
309
|
+
out[0] = cachedSourceWindowOrigin[0]
|
|
310
|
+
out[1] = cachedSourceWindowOrigin[1]
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
override fun referenceBlurredSourceFor(consumer: View, radiusPx: Float): LiquidGlassBackdropRenderSource? {
|
|
314
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
315
|
+
if (tracing) {
|
|
316
|
+
LiquidGlassTrace.counter("referenceBlurProviderCall", 1L)
|
|
317
|
+
LiquidGlassTrace.counter("referenceBlurCaptureModeOneShotPassThrough", if (captureMode == "oneShotPassThrough") 1L else 0L)
|
|
318
|
+
LiquidGlassTrace.counter("referenceBlurCaptureModeHash", captureMode.hashCode().toLong())
|
|
319
|
+
LiquidGlassTrace.counter("referenceBlurScrollWindowActive", if (scrollWindowCaptureActive) 1L else 0L)
|
|
320
|
+
}
|
|
321
|
+
if (Build.VERSION.SDK_INT < 33) return null
|
|
322
|
+
val contentNode = contentRenderNode
|
|
323
|
+
if (tracing) {
|
|
324
|
+
LiquidGlassTrace.counter("referenceBlurContentRecordingReady", if (contentNode?.hasDisplayList() == true) 1L else 0L)
|
|
325
|
+
LiquidGlassTrace.counter("referenceBlurContentWidth", contentNode?.width?.toLong() ?: 0L)
|
|
326
|
+
LiquidGlassTrace.counter("referenceBlurContentHeight", contentNode?.height?.toLong() ?: 0L)
|
|
327
|
+
}
|
|
328
|
+
val density = resources.displayMetrics.density
|
|
329
|
+
val node = recorder.referenceBlurredNode(contentNode, radiusPx, density) ?: return null
|
|
330
|
+
val shader = if (allowsSharedSceneTextures() && frozenBackdrop == null) {
|
|
331
|
+
recorder.referenceBlurredTextureShader(node, radiusPx, settledTextureInvalidate)
|
|
332
|
+
} else {
|
|
333
|
+
null
|
|
334
|
+
}
|
|
335
|
+
// This is a retained scene graph, not a bitmap captured at the old
|
|
336
|
+
// scroll offset. Its child RenderNodes already track native scrolling;
|
|
337
|
+
// shifting the whole source again also moves the stationary underlay.
|
|
338
|
+
// A re-record then resets that extra shift, causing a visible jump.
|
|
339
|
+
// Only the actual recording crop belongs in source coordinates.
|
|
340
|
+
return LiquidGlassBackdropRenderSource(
|
|
341
|
+
node = node,
|
|
342
|
+
originX = recorder.originX,
|
|
343
|
+
originY = recorder.originY,
|
|
344
|
+
revision = recorder.lastReferenceBlurRevision,
|
|
345
|
+
shader = shader,
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
private var debugRegistryTick = 0
|
|
350
|
+
private fun dumpSurfaceRegistry() {
|
|
351
|
+
val sb = StringBuilder("registry n=${consumerBounds.size}")
|
|
352
|
+
for ((view, rect) in consumerBounds) {
|
|
353
|
+
sb.append(" [").append(view.javaClass.simpleName).append(' ')
|
|
354
|
+
sb.append(rect.left).append(',').append(rect.top).append(' ')
|
|
355
|
+
sb.append(rect.width()).append('x').append(rect.height()).append(']')
|
|
356
|
+
}
|
|
357
|
+
if (DEBUG_SHARED_PASS) android.util.Log.i("LiquidGlassRegistry", sb.toString())
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
override fun registerConsumer(consumer: View) {
|
|
361
|
+
val hadRecording = hasRecording
|
|
362
|
+
recorder.register(consumer)
|
|
363
|
+
if (DEBUG_SHARED_PASS) android.util.Log.i(
|
|
364
|
+
"LiquidGlassRegistry",
|
|
365
|
+
"register ${consumer.javaClass.simpleName} id=${consumer.id} lb=${consumer.left},${consumer.top} ${consumer.width}x${consumer.height}",
|
|
366
|
+
)
|
|
367
|
+
if (!consumerBounds.containsKey(consumer)) consumer.addOnLayoutChangeListener(consumerLayoutListener)
|
|
368
|
+
updateConsumerBounds(consumer)
|
|
369
|
+
coordinator.refreshScrollTargets()
|
|
370
|
+
updateScrollObservation()
|
|
371
|
+
if (!hadRecording && captureMode != "frozen") coordinator.markDirty(GlassBackdropDirtyReason.INITIAL_CAPTURE)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
override fun unregisterConsumer(consumer: View) {
|
|
375
|
+
recorder.unregister(consumer)
|
|
376
|
+
consumer.removeOnLayoutChangeListener(consumerLayoutListener)
|
|
377
|
+
consumerBounds.remove(consumer)
|
|
378
|
+
reportProviderGeometry()
|
|
379
|
+
updateScrollObservation()
|
|
380
|
+
if (!recorder.hasConsumers) {
|
|
381
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
382
|
+
if (captureMode != "static") {
|
|
383
|
+
backdropDirty = false
|
|
384
|
+
recorder.release()
|
|
385
|
+
frozenBackdrop?.release()
|
|
386
|
+
frozenBackdrop = null
|
|
387
|
+
LiquidGlassPerfTelemetry.removeProviderGeometry(providerId)
|
|
388
|
+
}
|
|
389
|
+
} else {
|
|
390
|
+
reportProviderGeometry()
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
override fun requestCaptureFrame() {
|
|
395
|
+
if (shouldCapture()) coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_PAINT)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
override fun onConsumerGeometryChanged(consumer: View) {
|
|
399
|
+
updateConsumerBounds(consumer)
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
override fun onConsumerGeometryChanged(consumer: View, relativeX: Int, relativeY: Int) {
|
|
403
|
+
updateConsumerBoundsFromRelative(consumer, relativeX, relativeY)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
override fun onConsumerDirty(consumer: View, reason: GlassBackdropDirtyReason) {
|
|
407
|
+
coordinator.markDirty(reason, consumerAlreadyInvalidated = true)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
fun setCaptureModeImperatively(mode: String) {
|
|
411
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
412
|
+
if (tracing) LiquidGlassTrace.beginSection("Provider.imperativeCaptureMode")
|
|
413
|
+
try {
|
|
414
|
+
if (tracing) {
|
|
415
|
+
LiquidGlassTrace.counter("${traceProviderId()}.imperativeRequestedModeHash", mode.hashCode().toLong())
|
|
416
|
+
LiquidGlassTrace.counter("${traceProviderId()}.imperativeCurrentModeHash", captureMode.hashCode().toLong())
|
|
417
|
+
}
|
|
418
|
+
// Route transition controls target the route host and all its child
|
|
419
|
+
// providers. Keep this explicitly configured source in pass-through
|
|
420
|
+
// mode so its ScrollView always draws through the native view tree.
|
|
421
|
+
if (captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") {
|
|
422
|
+
if (tracing) LiquidGlassTrace.counter("${traceProviderId()}.imperativePreservedPassThrough", 1L)
|
|
423
|
+
return
|
|
424
|
+
}
|
|
425
|
+
if (mode in setOf("live", "static", "oneShot", "oneShotPassThrough", "livePassThrough", "frozen")) captureMode = mode
|
|
426
|
+
} finally {
|
|
427
|
+
if (tracing) LiquidGlassTrace.endSection()
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
fun prepareFrozenBackdropImperatively(blurRadiusDp: Float) {
|
|
432
|
+
if (captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") {
|
|
433
|
+
if (LiquidGlassTrace.isEnabled()) {
|
|
434
|
+
LiquidGlassTrace.counter("${traceProviderId()}.prepareFrozenPreservedPassThrough", 1L)
|
|
435
|
+
}
|
|
436
|
+
return
|
|
437
|
+
}
|
|
438
|
+
if (Build.VERSION.SDK_INT < 31 || !isAttachedToWindow || !recorder.hasRecording) {
|
|
439
|
+
LiquidGlassPerfTelemetry.frozenSnapshotRequested()
|
|
440
|
+
LiquidGlassPerfTelemetry.frozenSnapshotFailed()
|
|
441
|
+
captureMode = "oneShot"
|
|
442
|
+
return
|
|
443
|
+
}
|
|
444
|
+
LiquidGlassPerfTelemetry.frozenSnapshotRequested()
|
|
445
|
+
val next = runCatching { FrozenBackdrop(this, providerId, blurRadiusDp) }
|
|
446
|
+
.onSuccess { LiquidGlassPerfTelemetry.frozenSnapshotBlurRecorded() }
|
|
447
|
+
.onFailure { LiquidGlassPerfTelemetry.frozenSnapshotFailed() }
|
|
448
|
+
.getOrNull()
|
|
449
|
+
if (next == null) {
|
|
450
|
+
captureMode = "oneShot"
|
|
451
|
+
return
|
|
452
|
+
}
|
|
453
|
+
frozenBackdrop?.release()
|
|
454
|
+
frozenBackdrop = next
|
|
455
|
+
// A frozen snapshot is shown as-is; scroll compensation must not shift it.
|
|
456
|
+
backdropDirty = false
|
|
457
|
+
oneShotCaptured = true
|
|
458
|
+
captureMode = "frozen"
|
|
459
|
+
updateConsumerRegions(next.contentRenderNode)
|
|
460
|
+
recorder.invalidateConsumers()
|
|
461
|
+
invalidate()
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
override fun onAttachedToWindow() {
|
|
465
|
+
super.onAttachedToWindow()
|
|
466
|
+
GlassRegistry.registerProvider(providerId, this)
|
|
467
|
+
if (captureMode == "oneShot" || captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") oneShotCaptured = false
|
|
468
|
+
if (captureMode == "frozen" && recorder.hasConsumers && !recorder.hasRecording) captureMode = "oneShot"
|
|
469
|
+
updateScrollObservation()
|
|
470
|
+
coordinator.refreshScrollTargets()
|
|
471
|
+
if (recorder.hasConsumers && shouldCapture() && !recorder.hasRecording) {
|
|
472
|
+
coordinator.markDirty(GlassBackdropDirtyReason.INITIAL_CAPTURE)
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
override fun onDetachedFromWindow() {
|
|
477
|
+
sceneTexturePolicy.reset()
|
|
478
|
+
GlassRegistry.unregisterProvider(providerId, this)
|
|
479
|
+
coordinator.setScrollObservationEnabled(false)
|
|
480
|
+
coordinator.cancel(clearSourceDirties = true)
|
|
481
|
+
frozenBackdrop?.release()
|
|
482
|
+
frozenBackdrop = null
|
|
483
|
+
backdropDirty = false
|
|
484
|
+
oneShotCaptured = false
|
|
485
|
+
LiquidGlassPerfTelemetry.removeProviderGeometry(providerId)
|
|
486
|
+
recorder.release()
|
|
487
|
+
resetScrollWindow()
|
|
488
|
+
super.onDetachedFromWindow()
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
override fun onWindowVisibilityChanged(visibility: Int) {
|
|
492
|
+
super.onWindowVisibilityChanged(visibility)
|
|
493
|
+
val becameVisible = visibility == View.VISIBLE && !windowWasVisible
|
|
494
|
+
windowWasVisible = visibility == View.VISIBLE
|
|
495
|
+
if (becameVisible && isAttachedToWindow && recorder.hasConsumers && shouldCapture()) {
|
|
496
|
+
// Re-record the current source tree when Android restores the app
|
|
497
|
+
// window. Keep the configured capture mode, including pass-through.
|
|
498
|
+
requestBackdropSourceRecord()
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) {
|
|
503
|
+
super.onSizeChanged(width, height, oldWidth, oldHeight)
|
|
504
|
+
if (shouldCapture() && width > 0 && height > 0 &&
|
|
505
|
+
(width != oldWidth || height != oldHeight)
|
|
506
|
+
) {
|
|
507
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_GEOMETRY)
|
|
508
|
+
updateScrollObservation()
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
override fun onDescendantInvalidated(child: View, target: View) {
|
|
513
|
+
if (shouldCapture() && recorder.hasConsumers) {
|
|
514
|
+
LiquidGlassPerfTelemetry.descendantInvalidationReceived()
|
|
515
|
+
if (!recorder.isConsumerSubtree(target, this)) {
|
|
516
|
+
coordinator.markDirty(
|
|
517
|
+
if (captureMode == "live" || captureMode == "livePassThrough") GlassBackdropDirtyReason.SOURCE_STRUCTURE
|
|
518
|
+
else GlassBackdropDirtyReason.SOURCE_PAINT,
|
|
519
|
+
)
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
super.onDescendantInvalidated(child, target)
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
override fun onViewAdded(child: View) {
|
|
526
|
+
super.onViewAdded(child)
|
|
527
|
+
scrollViewScanned = false
|
|
528
|
+
cachedScrollView = null
|
|
529
|
+
directChildBounds[child] = Rect(child.left, child.top, child.right, child.bottom)
|
|
530
|
+
child.addOnLayoutChangeListener(directChildLayoutListener)
|
|
531
|
+
coordinator.refreshScrollTargets()
|
|
532
|
+
if (shouldCapture()) {
|
|
533
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_STRUCTURE)
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
override fun onViewRemoved(child: View) {
|
|
538
|
+
child.removeOnLayoutChangeListener(directChildLayoutListener)
|
|
539
|
+
directChildBounds.remove(child)
|
|
540
|
+
scrollViewScanned = false
|
|
541
|
+
cachedScrollView = null
|
|
542
|
+
super.onViewRemoved(child)
|
|
543
|
+
coordinator.refreshScrollTargets()
|
|
544
|
+
if (shouldCapture()) {
|
|
545
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_STRUCTURE)
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
private var sharedPassLogTick = 0
|
|
550
|
+
|
|
551
|
+
internal fun logSharedPassSkip(reason: String) {
|
|
552
|
+
if (!DEBUG_SHARED_PASS) return
|
|
553
|
+
if (sharedPassLogTick++ % 60 != 0) return
|
|
554
|
+
android.util.Log.i("LiquidGlassShared", "pass " + reason + " id=" + providerId + " consumers=" + consumerBounds.size)
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
private fun sharedPassSurfaceEntries(): List<Pair<GlassSurfaceView, io.github.luckylca.liquidglass.core.SharedGlassEntry>> =
|
|
558
|
+
consumerBounds.keys
|
|
559
|
+
// A pass composites this provider's own recorded scene. Surfaces that sample
|
|
560
|
+
// a *different* provider's scene (the tab bar reads routeScene) would be
|
|
561
|
+
// painted with this provider's empty scene - transparent glass over the bar.
|
|
562
|
+
.filterIsInstance<GlassSurfaceView>()
|
|
563
|
+
.filter { view -> view.glass.provider === this }
|
|
564
|
+
.mapNotNull { view -> view.sharedPassEntry()?.let { entry -> view to entry } }
|
|
565
|
+
.sortedWith(
|
|
566
|
+
compareBy<Pair<GlassSurfaceView, io.github.luckylca.liquidglass.core.SharedGlassEntry>> { it.first.sharedPassZIndex }
|
|
567
|
+
.thenBy { it.first.sharedPassOrder },
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
internal fun sharedPassEntries(): List<io.github.luckylca.liquidglass.core.SharedGlassEntry> =
|
|
571
|
+
sharedPassSurfaceEntries().map { it.second }
|
|
572
|
+
|
|
573
|
+
internal fun ensureSharedPassScene(): Boolean {
|
|
574
|
+
if (recorder.contentNode != null) return true
|
|
575
|
+
if (width <= 0 || height <= 0) return false
|
|
576
|
+
recorder.recordOnly(width, height, drawContent = { target ->
|
|
577
|
+
withConsumersHiddenFromScene { dispatchBackdropContent(target) }
|
|
578
|
+
})
|
|
579
|
+
return recorder.contentNode != null
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
internal fun recordedSceneNode(): android.graphics.RenderNode? = recorder.contentNode
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Hides the surfaces this provider owns from the pass. The flag has to stay up until
|
|
586
|
+
* after the pass has drawn: releasing it right after the tree let the per-surface
|
|
587
|
+
* glass paint over the pass node, so the pass was paid for and never seen.
|
|
588
|
+
*/
|
|
589
|
+
/** The surfaces this provider is about to composite in one pass. */
|
|
590
|
+
internal fun passConsumerViews(): List<android.view.View> = consumerBounds.keys.toList()
|
|
591
|
+
|
|
592
|
+
/** Surfaces whose bounds the last pass node actually covered. */
|
|
593
|
+
internal fun passCoveredViews(): List<android.view.View> {
|
|
594
|
+
val rect = io.github.luckylca.liquidglass.core.SharedGlassPass.lastPassRect
|
|
595
|
+
return sharedPassEligibleConsumers.filter { candidate ->
|
|
596
|
+
if (candidate.width <= 0 || candidate.height <= 0) return@filter false
|
|
597
|
+
val location = IntArray(2)
|
|
598
|
+
candidate.getLocationInWindow(location)
|
|
599
|
+
val left = location[0].toFloat()
|
|
600
|
+
val top = location[1].toFloat()
|
|
601
|
+
left >= rect.left - 1f && top >= rect.top - 1f &&
|
|
602
|
+
left + candidate.width <= rect.right + 1f &&
|
|
603
|
+
top + candidate.height <= rect.bottom + 1f
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/** True when this surface should wait for the provider's pass instead of drawing. */
|
|
608
|
+
internal fun passCovers(view: android.view.View): Boolean =
|
|
609
|
+
sharedPassEligibleConsumers.contains(view)
|
|
610
|
+
|
|
611
|
+
internal fun setPassConsumersHidden(hidden: Boolean, views: Iterable<View> = consumerBounds.keys) {
|
|
612
|
+
if (hidden && SharedGlassPassProbeLog.DEBUG_ENABLED) {
|
|
613
|
+
SharedGlassPassProbeLog.log(
|
|
614
|
+
"hide id=" + providerId + " consumers=" + consumerBounds.keys.joinToString(",") { view ->
|
|
615
|
+
(view as? GlassSurfaceView)?.let { it.providerId + "@" + it.width + "x" + it.height } ?: view.toString()
|
|
616
|
+
},
|
|
617
|
+
)
|
|
618
|
+
}
|
|
619
|
+
for (view in views) {
|
|
620
|
+
(view as? GlassSurfaceView)?.sharedPassHandled = hidden
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
internal fun drawScreenTreeWithPassConsumersHidden(canvas: Canvas) {
|
|
625
|
+
for (view in consumerBounds.keys) {
|
|
626
|
+
(view as? GlassSurfaceView)?.sharedPassHandled = true
|
|
627
|
+
}
|
|
628
|
+
try {
|
|
629
|
+
dispatchPassThroughScreenTree(canvas)
|
|
630
|
+
} finally {
|
|
631
|
+
for (view in consumerBounds.keys) {
|
|
632
|
+
(view as? GlassSurfaceView)?.sharedPassHandled = false
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
private fun sharedPassWanted(): Boolean =
|
|
638
|
+
io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED &&
|
|
639
|
+
// Route-content providers only. A provider whose subtree does not contain the
|
|
640
|
+
// backdrop content (the tab bar's provider, mode "static") records an empty
|
|
641
|
+
// scene, and a pass on top of it paints transparent glass over the bar.
|
|
642
|
+
(captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") &&
|
|
643
|
+
consumerBounds.isNotEmpty() &&
|
|
644
|
+
// During scroll the scene is a windowed recording whose crop origin
|
|
645
|
+
// the per-surface sampling chain carries; the pass's
|
|
646
|
+
// per-shape snapshot chain does not, and the glass showed page content from
|
|
647
|
+
// ~1180px away. Until that chain carries the window origin, the pass yields
|
|
648
|
+
// to per-surface rendering while a scroll window is active.
|
|
649
|
+
!scrollWindowCaptureActive
|
|
650
|
+
|
|
651
|
+
private var pathTick = 0
|
|
652
|
+
|
|
653
|
+
override fun dispatchDraw(canvas: Canvas) {
|
|
654
|
+
io.github.luckylca.liquidglass.core.SharedGlassPass.validateMultiShapeShader()
|
|
655
|
+
if (DEBUG_SHARED_PASS && (pathTick++ < 6 || pathTick % 120 == 0)) {
|
|
656
|
+
android.util.Log.i(
|
|
657
|
+
"LiquidGlassPath",
|
|
658
|
+
"tick=" + pathTick + " id=" + providerId + " mode=" + captureMode +
|
|
659
|
+
" consumers=" + consumerBounds.size +
|
|
660
|
+
" pass=" + io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED +
|
|
661
|
+
" tracing=" + LiquidGlassTrace.isEnabled(),
|
|
662
|
+
)
|
|
663
|
+
}
|
|
664
|
+
if (DEBUG_SHARED_PASS && debugRegistryTick % 60 == 0) {
|
|
665
|
+
android.util.Log.i(
|
|
666
|
+
"LiquidGlassPath",
|
|
667
|
+
"id=" + providerId + " mode=" + captureMode + " consumers=" + consumerBounds.size +
|
|
668
|
+
" pass=" + io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED,
|
|
669
|
+
)
|
|
670
|
+
}
|
|
671
|
+
debugRegistryTick++
|
|
672
|
+
if (DEBUG_SHARED_PASS && debugRegistryTick % 120 == 0) dumpSurfaceRegistry()
|
|
673
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
674
|
+
// The shared glass pass must not depend on tracing being on: it used to sit
|
|
675
|
+
// behind this early return, so the pass only ever ran while a performance
|
|
676
|
+
// capture was active and ordinary use fell back to per-surface rendering.
|
|
677
|
+
if (!tracing && !sharedPassWanted()) {
|
|
678
|
+
dispatchProviderChildren(canvas)
|
|
679
|
+
return
|
|
680
|
+
}
|
|
681
|
+
LiquidGlassTrace.beginSection("Provider.dispatchDraw")
|
|
682
|
+
try {
|
|
683
|
+
LiquidGlassTrace.counter("${traceProviderId()}.dispatchDrawScrollY", currentVerticalScrollOffsetY().toLong())
|
|
684
|
+
LiquidGlassTrace.counter("${traceProviderId()}.dispatchDrawScrollWindowPending", if (scrollWindowCapturePending) 1L else 0L)
|
|
685
|
+
LiquidGlassTrace.counter("${traceProviderId()}.dispatchDrawScrollWindowActive", if (scrollWindowCaptureActive) 1L else 0L)
|
|
686
|
+
LiquidGlassTrace.counter("${traceProviderId()}.dispatchDrawHasRecording", if (recorder.hasRecording) 1L else 0L)
|
|
687
|
+
LiquidGlassTrace.counter("${traceProviderId()}.dispatchDrawChildren", childCount.toLong())
|
|
688
|
+
dispatchProviderChildren(canvas)
|
|
689
|
+
} finally {
|
|
690
|
+
LiquidGlassTrace.endSection()
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
private fun dispatchProviderChildren(canvas: Canvas) {
|
|
695
|
+
sharedPassEligibleConsumers.clear()
|
|
696
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
697
|
+
if (tracing) {
|
|
698
|
+
val prefix = traceProviderId()
|
|
699
|
+
LiquidGlassTrace.counter("$prefix.drawCaptureModeHash", captureMode.hashCode().toLong())
|
|
700
|
+
LiquidGlassTrace.counter("$prefix.drawHasConsumers", if (recorder.hasConsumers) 1L else 0L)
|
|
701
|
+
LiquidGlassTrace.counter("$prefix.drawBackdropDirty", if (backdropDirty) 1L else 0L)
|
|
702
|
+
}
|
|
703
|
+
LiquidGlassPerfTelemetry.routeDraw()
|
|
704
|
+
// Clear the previous frame's suppression first: if this frame does not run a
|
|
705
|
+
// pass, the surfaces must draw normally.
|
|
706
|
+
if (SharedGlassPassProbeLog.DEBUG_ENABLED) {
|
|
707
|
+
SharedGlassPassProbeLog.tick(
|
|
708
|
+
"provider",
|
|
709
|
+
providerId,
|
|
710
|
+
"mode=" + captureMode + " consumers=" + consumerBounds.size +
|
|
711
|
+
" children=" + childCount + " pass=" +
|
|
712
|
+
io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED,
|
|
713
|
+
)
|
|
714
|
+
}
|
|
715
|
+
setPassConsumersHidden(false)
|
|
716
|
+
if (captureOnly && captureMode == "frozen") return
|
|
717
|
+
// The pass lives inside the oneShotPassThrough branch below: it must run after
|
|
718
|
+
// the normal recording bookkeeping (regions, blurred sources), not instead of
|
|
719
|
+
// it. Short-circuiting here starved every consumer that samples this scene.
|
|
720
|
+
if (!recorder.hasConsumers) {
|
|
721
|
+
if (tracing) LiquidGlassTrace.counter("${traceProviderId()}.drawPath", 0L)
|
|
722
|
+
LiquidGlassPerfTelemetry.routeTreeTraversal()
|
|
723
|
+
if (!captureOnly) super.dispatchDraw(canvas)
|
|
724
|
+
return
|
|
725
|
+
}
|
|
726
|
+
if (captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") {
|
|
727
|
+
if (tracing) LiquidGlassTrace.counter("${traceProviderId()}.drawPath", 1L)
|
|
728
|
+
// Settle-time full re-record is requested by the coordinator via
|
|
729
|
+
// hasWindowedRecordingOnly(); the provider is invalidated through the
|
|
730
|
+
// normal source-record path.
|
|
731
|
+
val recordScrollWindow = scrollWindowCapturePending && coordinator.isScrollActive &&
|
|
732
|
+
!coordinator.hasPendingSourceRerecord
|
|
733
|
+
val shouldRecord = shouldCapture() &&
|
|
734
|
+
(captureMode == "livePassThrough" || recordScrollWindow || backdropDirty || !recorder.hasRecording || coordinator.shouldRecordSourceNow)
|
|
735
|
+
if (shouldRecord && canvas.isHardwareAccelerated && width > 0 && height > 0) {
|
|
736
|
+
backdropDirty = false
|
|
737
|
+
val didRecord = if (recordScrollWindow) {
|
|
738
|
+
val bounds = calculateScrollCaptureBounds()
|
|
739
|
+
val traceRecord = tracingForProvider()
|
|
740
|
+
if (traceRecord) LiquidGlassTrace.beginSection("Provider.recordWindowAndDispatchTree")
|
|
741
|
+
val recordStartedNs = if (traceRecord) android.os.SystemClock.elapsedRealtimeNanos() else 0L
|
|
742
|
+
try {
|
|
743
|
+
recorder.recordWindow(width, height, bounds) { target ->
|
|
744
|
+
withConsumersHiddenFromScene { dispatchBackdropContent(target) }
|
|
745
|
+
}.also { recorded ->
|
|
746
|
+
if (recorded) {
|
|
747
|
+
scrollWindowBounds = bounds
|
|
748
|
+
recordedScrollOffsetY = currentVerticalScrollOffsetY()
|
|
749
|
+
if (DEBUG_SCROLL_WINDOW) android.util.Log.i(
|
|
750
|
+
"GlassScrollWindow",
|
|
751
|
+
"record id=" + providerId + " origin=" + recorder.originX + "," + recorder.originY +
|
|
752
|
+
" bounds=" + bounds + " scrollY=" + recordedScrollOffsetY,
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
} finally {
|
|
757
|
+
if (traceRecord) {
|
|
758
|
+
LiquidGlassTrace.counter("${traceProviderId()}.recordWindowElapsedNs", android.os.SystemClock.elapsedRealtimeNanos() - recordStartedNs)
|
|
759
|
+
LiquidGlassTrace.endSection()
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
} else {
|
|
763
|
+
resetScrollWindow()
|
|
764
|
+
if (DEBUG_SCROLL_WINDOW) android.util.Log.i(
|
|
765
|
+
"GlassScrollWindow",
|
|
766
|
+
"full-record id=" + providerId + " scrollY=" + currentVerticalScrollOffsetY(),
|
|
767
|
+
)
|
|
768
|
+
recorder.recordOnly(width, height, drawContent = { target ->
|
|
769
|
+
withConsumersHiddenFromScene { dispatchBackdropContent(target) }
|
|
770
|
+
})
|
|
771
|
+
true
|
|
772
|
+
}
|
|
773
|
+
if (didRecord) {
|
|
774
|
+
scrollWindowCapturePending = false
|
|
775
|
+
scrollWindowCaptureActive = recordScrollWindow
|
|
776
|
+
if (!recordScrollWindow) {
|
|
777
|
+
resetScrollWindow()
|
|
778
|
+
recordedScrollOffsetY = currentVerticalScrollOffsetY()
|
|
779
|
+
}
|
|
780
|
+
} else {
|
|
781
|
+
backdropDirty = true
|
|
782
|
+
}
|
|
783
|
+
if (recorder.hasRecording) {
|
|
784
|
+
oneShotCaptured = true
|
|
785
|
+
coordinator.sourceRecordCompleted()
|
|
786
|
+
if (!scrollWindowCaptureActive) contentRenderNode?.let(::updateConsumerRegions)
|
|
787
|
+
// recordOnly() already schedules Consumer redraws. Window
|
|
788
|
+
// records do not, so only those need an explicit invalidate.
|
|
789
|
+
if (recordScrollWindow) recorder.invalidateConsumers()
|
|
790
|
+
if (!recordScrollWindow) {
|
|
791
|
+
LiquidGlassPerfTelemetry.routeRenderNodeRecord()
|
|
792
|
+
LiquidGlassPerfTelemetry.routeTreeTraversal()
|
|
793
|
+
}
|
|
794
|
+
LiquidGlassPerfTelemetry.backdropCapture(
|
|
795
|
+
providerId = providerId,
|
|
796
|
+
width = width,
|
|
797
|
+
height = height,
|
|
798
|
+
capturedPixelArea = consumerBounds.values.sumOf {
|
|
799
|
+
it.width().coerceAtLeast(0).toLong() * it.height().coerceAtLeast(0)
|
|
800
|
+
},
|
|
801
|
+
mode = if (scrollWindowCaptureActive) "oneShot-pass-through-scroll-window" else "oneShot-pass-through",
|
|
802
|
+
)
|
|
803
|
+
} else {
|
|
804
|
+
backdropDirty = true
|
|
805
|
+
coordinator.sourceRecordDeferred()
|
|
806
|
+
}
|
|
807
|
+
} else if (shouldRecord) {
|
|
808
|
+
coordinator.sourceRecordDeferred()
|
|
809
|
+
}
|
|
810
|
+
// A tab's accent row is sampled by its lens but never belongs in
|
|
811
|
+
// the visible or ancestor scene (otherwise it ghosts through the
|
|
812
|
+
// translucent shell while pressed).
|
|
813
|
+
if (captureOnly) return
|
|
814
|
+
// Keep the normal RN ScrollView draw path on screen. The Glass
|
|
815
|
+
// consumer samples the separately retained one-shot RenderNode.
|
|
816
|
+
LiquidGlassPerfTelemetry.routeTreeTraversal()
|
|
817
|
+
if (sharedPassWanted()) {
|
|
818
|
+
val sharedEntries = sharedPassSurfaceEntries()
|
|
819
|
+
val sharedShapes = sharedEntries.map { it.second }
|
|
820
|
+
if (sharedShapes.size >= io.github.luckylca.liquidglass.core.SharedGlassPass.MIN_SHAPES &&
|
|
821
|
+
recorder.hasRecording
|
|
822
|
+
) {
|
|
823
|
+
sharedEntries.forEach { (surface, _) -> sharedPassEligibleConsumers.add(surface) }
|
|
824
|
+
setPassConsumersHidden(true, sharedPassEligibleConsumers)
|
|
825
|
+
dispatchPassThroughScreenTree(canvas)
|
|
826
|
+
val sharedDrawn = io.github.luckylca.liquidglass.core.SharedGlassPass.draw(
|
|
827
|
+
canvas,
|
|
828
|
+
width,
|
|
829
|
+
height,
|
|
830
|
+
recorder.contentNode,
|
|
831
|
+
sharedShapes,
|
|
832
|
+
recorder.originX,
|
|
833
|
+
recorder.originY,
|
|
834
|
+
if (scrollWindowCaptureActive)
|
|
835
|
+
currentVerticalScrollOffsetY() - recordedScrollOffsetY
|
|
836
|
+
else 0,
|
|
837
|
+
)
|
|
838
|
+
if (sharedDrawn) {
|
|
839
|
+
PassSurfaceSuppression.arm(passCoveredViews())
|
|
840
|
+
if (DEBUG_SHARED_PASS) android.util.Log.i(
|
|
841
|
+
"LiquidGlassShared",
|
|
842
|
+
"oneShot id=" + providerId + " consumers=" + consumerBounds.size +
|
|
843
|
+
" shapes=" + sharedShapes.size + " drawn=true",
|
|
844
|
+
)
|
|
845
|
+
return
|
|
846
|
+
}
|
|
847
|
+
// Rare (first-time shader link failure). Redraw with consumers
|
|
848
|
+
// visible rather than leave a frame without glass.
|
|
849
|
+
sharedPassEligibleConsumers.clear()
|
|
850
|
+
setPassConsumersHidden(false)
|
|
851
|
+
dispatchPassThroughScreenTree(canvas)
|
|
852
|
+
return
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
dispatchPassThroughScreenTree(canvas)
|
|
856
|
+
return
|
|
857
|
+
}
|
|
858
|
+
if (tracing) LiquidGlassTrace.counter("${traceProviderId()}.drawPath", 2L)
|
|
859
|
+
val shouldRecord = shouldCapture() &&
|
|
860
|
+
(backdropDirty || !recorder.hasRecording || coordinator.shouldRecordSourceNow)
|
|
861
|
+
if (shouldRecord) {
|
|
862
|
+
backdropDirty = false
|
|
863
|
+
if (captureMode == "oneShot") oneShotCaptured = true
|
|
864
|
+
}
|
|
865
|
+
// Use the React portal's explicit z-index and child order before assigning
|
|
866
|
+
// slots: the consumer registry itself is an unordered identity map.
|
|
867
|
+
val sharedShapes = sharedPassSurfaceEntries().map { it.second }
|
|
868
|
+
val useSharedPass = io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED && sharedShapes.size >= io.github.luckylca.liquidglass.core.SharedGlassPass.MIN_SHAPES
|
|
869
|
+
if (io.github.luckylca.liquidglass.core.SharedGlassPass.ENABLED) {
|
|
870
|
+
if (DEBUG_SHARED_PASS) {
|
|
871
|
+
android.util.Log.i("LiquidGlassShared", "drawShared id=" + providerId + " consumers=" + consumerBounds.size + " shapes=" + sharedShapes.size)
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
val sceneContent: (Canvas) -> Unit = if (useSharedPass) {
|
|
875
|
+
{ target -> withConsumersHiddenFromScene { dispatchBackdropContent(target) } }
|
|
876
|
+
} else {
|
|
877
|
+
::dispatchBackdropContent
|
|
878
|
+
}
|
|
879
|
+
// When the shared pass paints, the scene must be recorded but not drawn: the
|
|
880
|
+
// pass composites the recorded scene and the glass together. Drawing the
|
|
881
|
+
// scene separately as well painted every translucent pixel twice, which is
|
|
882
|
+
// what put a visible rectangular tone shift around the shapes.
|
|
883
|
+
val shared = if (useSharedPass) {
|
|
884
|
+
recorder.recordOnly(width, height, drawContent = sceneContent)
|
|
885
|
+
true
|
|
886
|
+
} else {
|
|
887
|
+
recorder.drawShared(canvas, width, height, shouldRecord, sceneContent)
|
|
888
|
+
}
|
|
889
|
+
if (useSharedPass) {
|
|
890
|
+
io.github.luckylca.liquidglass.core.SharedGlassPass.draw(canvas, width, height, recorder.contentNode, sharedShapes)
|
|
891
|
+
}
|
|
892
|
+
if (shared && shouldRecord) {
|
|
893
|
+
coordinator.sourceRecordCompleted()
|
|
894
|
+
if (captureMode == "oneShot" && snapshotBlurRadiusDp > 0f) {
|
|
895
|
+
LiquidGlassPerfTelemetry.frozenSnapshotRequested()
|
|
896
|
+
frozenBackdrop?.release()
|
|
897
|
+
frozenBackdrop = runCatching { FrozenBackdrop(this, providerId, snapshotBlurRadiusDp) }
|
|
898
|
+
.onSuccess { LiquidGlassPerfTelemetry.frozenSnapshotBlurRecorded() }
|
|
899
|
+
.onFailure { LiquidGlassPerfTelemetry.frozenSnapshotFailed() }
|
|
900
|
+
.getOrNull()
|
|
901
|
+
}
|
|
902
|
+
contentRenderNode?.let(::updateConsumerRegions)
|
|
903
|
+
LiquidGlassPerfTelemetry.backdropCapture(
|
|
904
|
+
providerId = providerId,
|
|
905
|
+
width = width,
|
|
906
|
+
height = height,
|
|
907
|
+
capturedPixelArea = consumerBounds.values.sumOf { it.width().coerceAtLeast(0).toLong() * it.height().coerceAtLeast(0) },
|
|
908
|
+
mode = if (captureMode == "live") "render-node-region-slices" else captureMode,
|
|
909
|
+
)
|
|
910
|
+
} else if (shouldRecord) {
|
|
911
|
+
backdropDirty = true
|
|
912
|
+
coordinator.sourceRecordDeferred()
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
private fun dispatchBackdropContent(canvas: Canvas) {
|
|
917
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
918
|
+
if (tracing) LiquidGlassTrace.beginSection("Provider.captureTreeTraversal")
|
|
919
|
+
try {
|
|
920
|
+
underlayProviderId?.let(GlassRegistry::provider)?.takeIf { it !== this }?.let { underlay ->
|
|
921
|
+
underlay.contentRenderNode?.takeIf { it.hasDisplayList() }?.let { node ->
|
|
922
|
+
val saved = canvas.save()
|
|
923
|
+
val underlayView = underlay.sourceView
|
|
924
|
+
if (underlayView.isAttachedToWindow && isAttachedToWindow) {
|
|
925
|
+
val underlayLoc = IntArray(2)
|
|
926
|
+
val selfLoc = IntArray(2)
|
|
927
|
+
underlayView.getLocationInWindow(underlayLoc)
|
|
928
|
+
getLocationInWindow(selfLoc)
|
|
929
|
+
canvas.translate(
|
|
930
|
+
(underlayLoc[0] + underlay.recordedOriginX - selfLoc[0] - recordedOriginX).toFloat(),
|
|
931
|
+
(underlayLoc[1] + underlay.recordedOriginY - selfLoc[1] - recordedOriginY).toFloat(),
|
|
932
|
+
)
|
|
933
|
+
}
|
|
934
|
+
canvas.drawRenderNode(node)
|
|
935
|
+
canvas.restoreToCount(saved)
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
super.dispatchDraw(canvas)
|
|
939
|
+
} finally {
|
|
940
|
+
if (tracing) LiquidGlassTrace.endSection()
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
internal fun dispatchPassThroughScreenTree(canvas: Canvas) {
|
|
945
|
+
val tracing = LiquidGlassTrace.isEnabled()
|
|
946
|
+
if (tracing) LiquidGlassTrace.beginSection("Provider.screenTreeTraversal")
|
|
947
|
+
try {
|
|
948
|
+
super.dispatchDraw(canvas)
|
|
949
|
+
} finally {
|
|
950
|
+
if (tracing) LiquidGlassTrace.endSection()
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
private fun shouldCapture(): Boolean = when (captureMode) {
|
|
955
|
+
"live", "static", "livePassThrough" -> true
|
|
956
|
+
"oneShot" -> !oneShotCaptured
|
|
957
|
+
// Pass-through keeps the visible route on the normal View drawing path,
|
|
958
|
+
// while remaining eligible for a source rerecord when the coordinator
|
|
959
|
+
// receives an explicit structure, geometry, or revision dirty. Ordinary
|
|
960
|
+
// descendant paint invalidations stay paint-only in the coordinator.
|
|
961
|
+
"oneShotPassThrough" -> true
|
|
962
|
+
else -> false
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
private fun updateConsumerBounds(consumer: View) {
|
|
966
|
+
if (width <= 0 || height <= 0 || consumer.width <= 0 || consumer.height <= 0) return
|
|
967
|
+
getLocationInWindow(sourceLocation)
|
|
968
|
+
consumer.getLocationInWindow(consumerLocation)
|
|
969
|
+
val left = consumerLocation[0] - sourceLocation[0]
|
|
970
|
+
val top = consumerLocation[1] - sourceLocation[1]
|
|
971
|
+
updateConsumerBoundsFromRelative(consumer, left, top, fromLayoutResize = true)
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
private fun updateConsumerBoundsFromRelative(
|
|
975
|
+
consumer: View,
|
|
976
|
+
left: Int,
|
|
977
|
+
top: Int,
|
|
978
|
+
fromLayoutResize: Boolean = false,
|
|
979
|
+
) {
|
|
980
|
+
if (width <= 0 || height <= 0 || consumer.width <= 0 || consumer.height <= 0) return
|
|
981
|
+
val nextLeft = left.coerceIn(0, width)
|
|
982
|
+
val nextTop = top.coerceIn(0, height)
|
|
983
|
+
val nextRight = (left + consumer.width).coerceIn(0, width)
|
|
984
|
+
val nextBottom = (top + consumer.height).coerceIn(0, height)
|
|
985
|
+
val previous = consumerBounds[consumer]
|
|
986
|
+
if (previous != null &&
|
|
987
|
+
previous.left == nextLeft &&
|
|
988
|
+
previous.top == nextTop &&
|
|
989
|
+
previous.right == nextRight &&
|
|
990
|
+
previous.bottom == nextBottom
|
|
991
|
+
) {
|
|
992
|
+
return
|
|
993
|
+
}
|
|
994
|
+
val sizeChanged = previous == null ||
|
|
995
|
+
previous.width() != (nextRight - nextLeft) ||
|
|
996
|
+
previous.height() != (nextBottom - nextTop)
|
|
997
|
+
val next = previous ?: Rect().also { consumerBounds[consumer] = it }
|
|
998
|
+
next.set(nextLeft, nextTop, nextRight, nextBottom)
|
|
999
|
+
if (DEBUG_SHARED_PASS) android.util.Log.i(
|
|
1000
|
+
"LiquidGlassRegistry",
|
|
1001
|
+
"bounds id=${consumer.id} ${next.left},${next.top} ${next.width()}x${next.height()} n=${consumerBounds.size} " +
|
|
1002
|
+
"surfaceProvider=${(consumer as? GlassSurfaceView)?.providerId} thisProvider=$providerId",
|
|
1003
|
+
)
|
|
1004
|
+
if (fromLayoutResize || previous == null) {
|
|
1005
|
+
reportProviderGeometry()
|
|
1006
|
+
}
|
|
1007
|
+
if (scrollWindowCaptureActive) {
|
|
1008
|
+
val bounds = scrollWindowBounds
|
|
1009
|
+
if (sizeChanged || bounds == null || next.top < bounds.top || next.bottom > bounds.bottom) {
|
|
1010
|
+
resetScrollWindow()
|
|
1011
|
+
recorder.clearConsumerRegions()
|
|
1012
|
+
coordinator.markDirty(GlassBackdropDirtyReason.SOURCE_GEOMETRY)
|
|
1013
|
+
}
|
|
1014
|
+
} else if (sizeChanged && fromLayoutResize) {
|
|
1015
|
+
if (recorder.hasRecording) contentRenderNode?.let(::updateConsumerRegions)
|
|
1016
|
+
coordinator.markDirty(GlassBackdropDirtyReason.CONSUMER_GEOMETRY)
|
|
1017
|
+
} else {
|
|
1018
|
+
recorder.dropConsumerRegion(consumer)
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
private fun updateConsumerRegions(source: RenderNode) {
|
|
1023
|
+
if (consumerBounds.isEmpty()) return
|
|
1024
|
+
recorder.updateConsumerRegions(consumerBounds, source, width, height)
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
private fun calculateScrollCaptureBounds(): Rect {
|
|
1028
|
+
val bounds = Rect()
|
|
1029
|
+
consumerBounds.values.forEach { consumer ->
|
|
1030
|
+
if (consumer.width() <= 0 || consumer.height() <= 0) return@forEach
|
|
1031
|
+
if (bounds.isEmpty) bounds.set(consumer) else bounds.union(consumer)
|
|
1032
|
+
}
|
|
1033
|
+
if (bounds.isEmpty) return Rect(0, 0, width, height)
|
|
1034
|
+
val margin = (224f * resources.displayMetrics.density).toInt()
|
|
1035
|
+
bounds.set(
|
|
1036
|
+
0,
|
|
1037
|
+
(bounds.top - margin).coerceAtLeast(0),
|
|
1038
|
+
width,
|
|
1039
|
+
(bounds.bottom + margin).coerceAtMost(height),
|
|
1040
|
+
)
|
|
1041
|
+
return bounds
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
private fun shouldRecordScrollWindow(scrollOffsetY: Int): Boolean {
|
|
1045
|
+
if (!recorder.hasRecording) return true
|
|
1046
|
+
val bounds = scrollWindowBounds ?: return true
|
|
1047
|
+
if (coordinator.hasPendingSourceRerecord) return false
|
|
1048
|
+
val deltaY = scrollOffsetY - recordedScrollOffsetY
|
|
1049
|
+
val opticalMargin = (48f * resources.displayMetrics.density).toInt()
|
|
1050
|
+
for (consumer in consumerBounds.values) {
|
|
1051
|
+
val neededTop = (consumer.top - opticalMargin).coerceAtLeast(0) + deltaY
|
|
1052
|
+
val neededBottom = (consumer.bottom + opticalMargin).coerceAtMost(height) + deltaY
|
|
1053
|
+
if (neededTop < bounds.top || neededBottom > bounds.bottom) return true
|
|
1054
|
+
}
|
|
1055
|
+
return false
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
private fun resolveVerticalScrollView(): ScrollView? {
|
|
1059
|
+
val cached = cachedScrollView?.get()
|
|
1060
|
+
if (cached != null && cached.isAttachedToWindow) return cached
|
|
1061
|
+
if (scrollViewScanned && cached != null && !cached.isAttachedToWindow) {
|
|
1062
|
+
scrollViewScanned = false
|
|
1063
|
+
cachedScrollView = null
|
|
1064
|
+
}
|
|
1065
|
+
if (scrollViewScanned && cached != null) return cached
|
|
1066
|
+
val found = findVerticalScrollView(this)
|
|
1067
|
+
cachedScrollView = found?.let { java.lang.ref.WeakReference(it) }
|
|
1068
|
+
scrollViewScanned = true
|
|
1069
|
+
return found
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
private fun currentVerticalScrollOffsetY(): Int = resolveVerticalScrollView()?.scrollY ?: 0
|
|
1073
|
+
|
|
1074
|
+
private fun findVerticalScrollView(view: View): ScrollView? {
|
|
1075
|
+
if (view !== this && view is ScrollView) return view
|
|
1076
|
+
if (view is ViewGroup) {
|
|
1077
|
+
for (index in 0 until view.childCount) {
|
|
1078
|
+
findVerticalScrollView(view.getChildAt(index))?.let { return it }
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
return null
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
private fun resetScrollWindow() {
|
|
1085
|
+
scrollWindowCapturePending = false
|
|
1086
|
+
scrollWindowCaptureActive = false
|
|
1087
|
+
scrollWindowBounds = null
|
|
1088
|
+
// Keep the offset only for deciding when the capture window needs to be
|
|
1089
|
+
// refreshed. It must never translate a retained scene's sampling origin.
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
private fun reportProviderGeometry() {
|
|
1093
|
+
LiquidGlassPerfTelemetry.updateProviderGeometry(providerId, width, height, consumerBounds.values)
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* A glass surface must never sample its own content. With content placed
|
|
1098
|
+
* above the glass the visible copy lives in the overlay, so suppressing the
|
|
1099
|
+
* consumer for the duration of the scene record removes only the invisible
|
|
1100
|
+
* measuring copy - and stops the refraction from duplicating text.
|
|
1101
|
+
*/
|
|
1102
|
+
private inline fun withConsumersHiddenFromScene(block: () -> Unit) {
|
|
1103
|
+
for (key in consumerBounds.keys) {
|
|
1104
|
+
(key as? GlassSurfaceView)?.sharedPassHandled = true
|
|
1105
|
+
}
|
|
1106
|
+
try {
|
|
1107
|
+
block()
|
|
1108
|
+
} finally {
|
|
1109
|
+
for (key in consumerBounds.keys) {
|
|
1110
|
+
(key as? GlassSurfaceView)?.sharedPassHandled = false
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
private fun traceProviderId(): String = LiquidGlassTrace.safe(providerId)
|
|
1116
|
+
|
|
1117
|
+
private fun tracingForProvider(): Boolean = LiquidGlassTrace.isEnabled()
|
|
1118
|
+
|
|
1119
|
+
private fun updateScrollObservation() {
|
|
1120
|
+
coordinator.setScrollObservationEnabled(
|
|
1121
|
+
recorder.hasConsumers && (captureMode == "live" || captureMode == "oneShotPassThrough" || captureMode == "livePassThrough") && isAttachedToWindow,
|
|
1122
|
+
)
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
}
|