@luckylca/react-native-liquid-glass 0.2.0 → 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/README.md +20 -33
- package/README.zh-CN.md +20 -33
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/android/build.gradle +4 -4
- package/android/src/main/java/expo/modules/{newhuliquidglass → liquidglass}/EffectiveScrollInputBridge.kt +2 -2
- package/android/src/main/java/expo/modules/{newhuliquidglass/ExpoGlassProviderCoreView.kt → liquidglass/GlassCaptureView.kt} +39 -39
- package/android/src/main/java/expo/modules/{newhuliquidglass/CoreLiquidGlassRegistry.kt → liquidglass/GlassRegistry.kt} +7 -7
- package/android/src/main/java/expo/modules/{newhuliquidglass/ExpoGlassSurfaceCoreView.kt → liquidglass/GlassSurfaceView.kt} +17 -17
- package/android/src/main/java/expo/modules/liquidglass/LiquidGlassModule.kt +205 -0
- package/android/src/main/java/expo/modules/{localglass/ExpoLocalGlassEngineModule.kt → liquidglass/LocalMaterialView.kt} +24 -27
- package/android/src/main/java/expo/modules/{newhuliquidglass → liquidglass}/PassSurfaceSuppression.kt +1 -1
- package/android/src/main/java/expo/modules/{newhuliquidglass → liquidglass}/SharedGlassPassProbeLog.kt +1 -1
- package/android/src/main/java/expo/modules/{newhuliquidglass → liquidglass}/SharedGlassPassWiring.kt +3 -3
- package/android-core/build.gradle +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/BackdropRecorder.kt +4 -4
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/FrozenBackdrop.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/GlassBackdropCoordinator.kt +5 -5
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/GlassBackdropSourceHandle.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/GlassScrollSource.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/GlassViewController.kt +119 -722
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/LiquidGlassProviderLayout.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/LiquidGlassView.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/ReferenceSourceWindowPolicy.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/StableSceneTexturePolicy.kt +1 -1
- 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/{com/newhu → io/github/luckylca}/liquidglass/backdrop/internal/ReferenceTabSampling.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/backdrop/internal/SharedSceneCapture.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassCapabilities.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassEngine.kt +7 -7
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassMaterial.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassMath.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassOpticalInsets.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassRenderTier.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassShapePacker.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassSurfaceState.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/GlassUniforms.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/LiquidGlassShaders.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/SharedGlassPass.kt +6 -6
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/geometry/G2RoundedRectangle.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/geometry/ReferenceG2MaskTexture.kt +1 -1
- package/android-core/src/main/java/io/github/luckylca/liquidglass/core/shader/HeightFieldGlassShader.kt +7 -0
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/ReferenceBackdropBlurShader.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/ReferenceGaussianDiscBackdropBlur.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/ReferenceGlassUniforms.kt +4 -4
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/ReferenceParityGlassShader.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/ReferenceParityMultiShapeShader.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/core/shader/SdfScaleLensShader.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassHardwareLayerExperiment.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassMaterial.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassRenderer.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassRuntimeShader.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassShader.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/local/LocalGlassView.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/motion/GlassMotionDriver.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/motion/GlassMotionState.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/motion/PointerVelocityTracker.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/motion/SpringSpec.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/G2Corner.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/GlassMaterial.kt +3 -3
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/GlassOpticsShader.kt +3 -3
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/GlassParityProbe.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/GlassShapeGeometry.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/GlassUniformBinder.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/PixelDiff.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/optics/ReferenceOptics.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/rendering/GlassSurfaceHost.kt +17 -17
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/rendering/GlassSurfaceRenderer.kt +9 -9
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/rendering/RetainedBackdropLayer.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/scheduler/GlassFrameScheduler.kt +2 -2
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/telemetry/EffectiveScrollFpsProbe.kt +13 -13
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/telemetry/GlassTelemetry.kt +1 -1
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/telemetry/LiquidGlassPerfTelemetry.kt +13 -13
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/telemetry/LiquidGlassTrace.kt +3 -3
- package/android-core/src/main/java/{com/newhu → io/github/luckylca}/liquidglass/telemetry/LocalGlassTelemetry.kt +1 -1
- package/docs/architecture.md +61 -0
- package/docs/migration-0.3.md +19 -0
- package/docs/publishing.md +29 -7
- package/expo-module.config.json +4 -4
- package/lib/commonjs/GlassSurface.js +157 -585
- package/lib/commonjs/GlassSurface.js.map +1 -1
- package/lib/commonjs/GlassTabBar.js +18 -957
- package/lib/commonjs/GlassTabBar.js.map +1 -1
- package/lib/commonjs/LocalGlassMaterial.js +3 -9
- package/lib/commonjs/LocalGlassMaterial.js.map +1 -1
- package/lib/commonjs/glassController.js +3 -7
- package/lib/commonjs/glassController.js.map +1 -1
- package/lib/commonjs/glassRuntime.js +7 -19
- package/lib/commonjs/glassRuntime.js.map +1 -1
- package/lib/commonjs/localGlassTelemetry.js +4 -13
- package/lib/commonjs/localGlassTelemetry.js.map +1 -1
- package/lib/commonjs/nativeGlassViews.js +8 -11
- package/lib/commonjs/nativeGlassViews.js.map +1 -1
- package/lib/commonjs/performanceTelemetry.js +2 -6
- package/lib/commonjs/performanceTelemetry.js.map +1 -1
- 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/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/buildTheme.js +1 -1
- package/lib/commonjs/theme/buildTheme.js.map +1 -1
- package/lib/module/GlassSurface.js +135 -563
- package/lib/module/GlassSurface.js.map +1 -1
- package/lib/module/GlassTabBar.js +18 -925
- package/lib/module/GlassTabBar.js.map +1 -1
- package/lib/module/LocalGlassMaterial.js +5 -11
- package/lib/module/LocalGlassMaterial.js.map +1 -1
- package/lib/module/glassController.js +3 -7
- package/lib/module/glassController.js.map +1 -1
- package/lib/module/glassRuntime.js +7 -19
- package/lib/module/glassRuntime.js.map +1 -1
- package/lib/module/localGlassTelemetry.js +4 -13
- package/lib/module/localGlassTelemetry.js.map +1 -1
- package/lib/module/nativeGlassViews.js +7 -10
- package/lib/module/nativeGlassViews.js.map +1 -1
- package/lib/module/performanceTelemetry.js +2 -6
- package/lib/module/performanceTelemetry.js.map +1 -1
- 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/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/buildTheme.js +1 -1
- package/lib/module/theme/buildTheme.js.map +1 -1
- package/lib/types/GlassSurface.d.ts +17 -86
- package/lib/types/GlassTabBar.d.ts +1 -0
- package/lib/types/glassNativeEngine.d.ts +1 -1
- package/lib/types/glassRuntime.d.ts +5 -2
- package/lib/types/localGlassTelemetry.d.ts +2 -2
- package/lib/types/nativeGlassViews.d.ts +2 -4
- 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/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/package.json +6 -14
- package/src/GlassSurface.tsx +227 -1337
- package/src/GlassTabBar.tsx +43 -1241
- package/src/LocalGlassMaterial.tsx +5 -11
- package/src/glassController.ts +3 -7
- package/src/glassRuntime.ts +9 -26
- package/src/localGlassTelemetry.ts +6 -15
- package/src/nativeGlassViews.ts +7 -10
- package/src/performanceTelemetry.ts +2 -6
- 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/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/buildTheme.ts +1 -1
- package/android/src/main/java/expo/modules/localglass/ExpoLocalGlassModule.kt +0 -341
- package/android/src/main/java/expo/modules/localglass/LocalGlassShader.kt +0 -59
- package/android/src/main/java/expo/modules/newhuliquidglass/ExpoGlassCoreModule.kt +0 -226
- package/android-core/src/main/java/com/newhu/liquidglass/backdrop/internal/GlassViewRenderer.kt +0 -1459
- package/android-core/src/main/java/com/newhu/liquidglass/core/shader/HeightFieldGlassShader.kt +0 -7
- package/android-core/src/main/java/com/newhu/liquidglass/rendering/GlassEngineSelection.kt +0 -30
- package/patches/liquid-glass-kit+1.0.0.patch +0 -2015
- package/patches/liquid-glass-kit-invalidation-coalescing.diff +0 -249
- package/patches/liquid-glass-kit-native-infra.diff +0 -624
- package/scripts/apply-legacy-patches.mjs +0 -116
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
package
|
|
1
|
+
package io.github.luckylca.liquidglass.telemetry
|
|
2
2
|
|
|
3
3
|
import android.graphics.Rect
|
|
4
4
|
import android.os.Build
|
|
5
5
|
import android.os.Trace
|
|
6
|
-
import
|
|
6
|
+
import io.github.luckylca.liquidglass.backdrop.GlassBackdropDirtyReason
|
|
7
7
|
import java.util.concurrent.atomic.AtomicLong
|
|
8
8
|
import java.util.concurrent.ConcurrentHashMap
|
|
9
9
|
|
|
@@ -273,12 +273,12 @@ object LiquidGlassPerfTelemetry {
|
|
|
273
273
|
if (viewCounters != null) recordOffset(viewCounters, uptimeMs, touchActive)
|
|
274
274
|
if (Build.VERSION.SDK_INT >= 29) {
|
|
275
275
|
val traceId = providerId.replace(Regex("[^A-Za-z0-9_.-]"), "_")
|
|
276
|
-
Trace.setCounter("
|
|
277
|
-
Trace.setCounter("
|
|
276
|
+
Trace.setCounter("LiquidGlass.Scroll.$traceId.X", offsetX.toLong())
|
|
277
|
+
Trace.setCounter("LiquidGlass.Scroll.$traceId.Y", offsetY.toLong())
|
|
278
278
|
if (viewKey != null) {
|
|
279
279
|
val viewTraceId = "${traceSafe(providerId)}.${traceSafe(viewKey)}"
|
|
280
|
-
Trace.setCounter("
|
|
281
|
-
Trace.setCounter("
|
|
280
|
+
Trace.setCounter("LiquidGlass.ScrollView.$viewTraceId.X", offsetX.toLong())
|
|
281
|
+
Trace.setCounter("LiquidGlass.ScrollView.$viewTraceId.Y", offsetY.toLong())
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
}
|
|
@@ -301,7 +301,7 @@ object LiquidGlassPerfTelemetry {
|
|
|
301
301
|
else counters.dragFrameRepeatedOffsetCount.incrementAndGet()
|
|
302
302
|
}
|
|
303
303
|
if (Build.VERSION.SDK_INT >= 29) {
|
|
304
|
-
Trace.setCounter("
|
|
304
|
+
Trace.setCounter("LiquidGlass.ScrollFrame.${providerId.replace(Regex("[^A-Za-z0-9_.-]"), "_")}.changed", if (offsetChanged) 1L else 0L)
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
@@ -330,7 +330,7 @@ object LiquidGlassPerfTelemetry {
|
|
|
330
330
|
}
|
|
331
331
|
if (Build.VERSION.SDK_INT >= 29) {
|
|
332
332
|
val traceId = "${traceSafe(providerId)}.${traceSafe(viewKey)}"
|
|
333
|
-
Trace.setCounter("
|
|
333
|
+
Trace.setCounter("LiquidGlass.ScrollFrameView.$traceId.changed", if (offsetChanged) 1L else 0L)
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
|
|
@@ -363,11 +363,11 @@ object LiquidGlassPerfTelemetry {
|
|
|
363
363
|
) {
|
|
364
364
|
if (Build.VERSION.SDK_INT < 29) return
|
|
365
365
|
val traceId = "${traceSafe(providerId)}.${traceSafe(viewKey ?: "noTarget")}"
|
|
366
|
-
Trace.setCounter("
|
|
367
|
-
Trace.setCounter("
|
|
368
|
-
Trace.setCounter("
|
|
369
|
-
Trace.setCounter("
|
|
370
|
-
Trace.setCounter("
|
|
366
|
+
Trace.setCounter("LiquidGlass.ScrollTouch.$traceId.action", action.toLong())
|
|
367
|
+
Trace.setCounter("LiquidGlass.ScrollTouch.$traceId.eventTimeMs", eventTimeMs)
|
|
368
|
+
Trace.setCounter("LiquidGlass.ScrollTouch.$traceId.dispatchUptimeMs", dispatchUptimeMs)
|
|
369
|
+
Trace.setCounter("LiquidGlass.ScrollTouch.$traceId.x", rawX.toLong())
|
|
370
|
+
Trace.setCounter("LiquidGlass.ScrollTouch.$traceId.y", rawY.toLong())
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
private fun scrollViewCounterKey(providerId: String, viewKey: String): String = "$providerId|$viewKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package
|
|
1
|
+
package io.github.luckylca.liquidglass.telemetry
|
|
2
2
|
|
|
3
3
|
import android.os.Build
|
|
4
4
|
import android.os.Trace
|
|
@@ -15,7 +15,7 @@ public object LiquidGlassTrace {
|
|
|
15
15
|
public fun isEnabled(): Boolean = detailedEnabled && Build.VERSION.SDK_INT >= 29 && Trace.isEnabled()
|
|
16
16
|
|
|
17
17
|
public fun beginSection(name: String) {
|
|
18
|
-
Trace.beginSection("
|
|
18
|
+
Trace.beginSection("LiquidGlass#$name")
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
public fun endSection() {
|
|
@@ -23,7 +23,7 @@ public object LiquidGlassTrace {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
public fun counter(name: String, value: Long) {
|
|
26
|
-
if (isEnabled()) Trace.setCounter("
|
|
26
|
+
if (isEnabled()) Trace.setCounter("LiquidGlass.$name", value)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public fun safe(value: String): String = value.replace(Regex("[^A-Za-z0-9_.-]"), "_")
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Renderer architecture / 渲染架构
|
|
2
|
+
|
|
3
|
+
The library ships one Android renderer. `LiquidGlassProvider` and the public controls use it automatically; applications do not select an engine.
|
|
4
|
+
|
|
5
|
+
本库只有一条正式 Android 原生渲染路径。应用使用 `LiquidGlassProvider` 和公开组件即可,不需要选择引擎。
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
flowchart TD
|
|
9
|
+
Controls[Public components] --> Surface[GlassSurface]
|
|
10
|
+
Surface --> Host[Surface provider and portal registry]
|
|
11
|
+
Host --> Bridge[LiquidGlass Expo module]
|
|
12
|
+
Bridge --> Capture[GlassCaptureView: scene recording]
|
|
13
|
+
Bridge --> View[GlassSurfaceView: native surface]
|
|
14
|
+
View --> Controller[GlassViewController]
|
|
15
|
+
Controller --> Motion[GlassSurfaceHost: native motion]
|
|
16
|
+
Controller --> Sampling[SurfaceFrameBuilder: source coordinates]
|
|
17
|
+
Sampling --> Reference[GlassViewRenderer: reference-parity optics]
|
|
18
|
+
Sampling --> Optics[GlassSurfaceRenderer: other optical models]
|
|
19
|
+
Capture --> Sampling
|
|
20
|
+
Bridge --> Local[LocalMaterialView: procedural material]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Source map
|
|
24
|
+
|
|
25
|
+
| Responsibility | Entry point |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Component API and surface placement | `src/GlassSurface.tsx` |
|
|
28
|
+
| Theme, route and scroll contexts | `src/surface/contexts.tsx` |
|
|
29
|
+
| Stable capture host and registries | `src/surface/MaterialProvider.tsx`, `registry.ts` |
|
|
30
|
+
| Portal grouping and native draw order | `src/surface/PortalLayers.tsx` |
|
|
31
|
+
| In-flow native surfaces and foreground transforms | `src/surface/InlineSurface.tsx` |
|
|
32
|
+
| Native view properties and direct pointer/value delivery | `src/nativeGlassViews.ts`, `src/surface/NativeSurface.tsx` |
|
|
33
|
+
| Floating navigation | `src/GlassTabBar.tsx`, `src/components/ReferenceTabBar.tsx` |
|
|
34
|
+
| Custom inline navigation and gestures | `src/tabs/InlineTabBar.tsx`, `useInlineTabGesture.ts` |
|
|
35
|
+
| Expo module and view registration | `android/src/main/java/expo/modules/liquidglass/LiquidGlassModule.kt` |
|
|
36
|
+
| Native scene/consumer registry | `android/src/main/java/expo/modules/liquidglass/GlassRegistry.kt` |
|
|
37
|
+
| Native lifecycle and configuration | `android-core/src/main/java/io/github/luckylca/liquidglass/backdrop/GlassViewController.kt` |
|
|
38
|
+
| Sampling coordinates and frame parameters | `backdrop/SurfaceFrameBuilder.kt` |
|
|
39
|
+
| Press, drag and release transforms | `backdrop/SurfaceInteraction.kt` |
|
|
40
|
+
| Cached effects and platform tiers | `backdrop/internal/GlassViewRenderer.kt` |
|
|
41
|
+
| Reference optical uniforms, shadows and highlights | `backdrop/internal/ReferenceParityPasses.kt` |
|
|
42
|
+
|
|
43
|
+
The native paths in the last four rows are relative to `android-core/src/main/java/io/github/luckylca/liquidglass/`.
|
|
44
|
+
|
|
45
|
+
The controller dispatches the requested optical model to the reference-parity or height-field/SDF drawing code. They share recording coordinates and native motion; they are optical models within the same renderer, not selectable production engines.
|
|
46
|
+
|
|
47
|
+
## Live optics and local materials
|
|
48
|
+
|
|
49
|
+
Live glass records the actual background scene and samples it for blur, refraction, dispersion and lighting. A surface never captures itself. Recording modes and provider coordinates remain explicit, and inactive pages retain their native view trees while drawing is suspended.
|
|
50
|
+
|
|
51
|
+
`LocalMaterialView` is a procedural material view registered by the same Expo module. It does not record or refract the page. Components use it where a local material is requested; it is not an alternate scene renderer. iOS and Web use the Skia/local material fallbacks. Android selects the available shader, blur or scrim tier from the platform capabilities.
|
|
52
|
+
|
|
53
|
+
实时玻璃采样真实背景,保留模糊、折射、色散和光照。`LocalMaterialView` 是同一个 Expo 模块提供的本地材质视图,不负责背景录制,也不是另一套场景引擎。Android 按系统能力选择光学、模糊或基础材质;iOS 和 Web 使用 Skia / 本地材质回退。
|
|
54
|
+
|
|
55
|
+
## Contributing safely
|
|
56
|
+
|
|
57
|
+
Sampling geometry and interaction transforms have one owner each. Keep the native foreground container boundaries, recording origins, travelling-lens translations and capture modes consistent when changing one of these modules. The split helpers operate on their host's existing state on the UI thread; they do not add frame callbacks or move work to JS.
|
|
58
|
+
|
|
59
|
+
Run the JS tests, native unit tests and a packed consumer build. For renderer or gesture changes, compare screenshots and real-device interaction states as well as FrameTimeline presentation. See [the example guide](../example/README.md) and [measurement notes](demo.md).
|
|
60
|
+
|
|
61
|
+
For an existing 0.2 installation, see [migration to 0.3](migration-0.3.md). A native rebuild is required after upgrading.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Upgrading to 0.3 / 升级至 0.3
|
|
2
|
+
|
|
3
|
+
Version 0.3 bundles its complete native renderer and registers one Expo module, `LiquidGlass`. Public components keep their existing usage.
|
|
4
|
+
|
|
5
|
+
1. Upgrade `@luckylca/react-native-liquid-glass`.
|
|
6
|
+
2. Remove the old `liquid-glass-patch .` command from your application's scripts.
|
|
7
|
+
3. Remove `liquid-glass-kit` if it was installed only for this library.
|
|
8
|
+
4. Keep `@luckylca/react-native-liquid-glass` in the Expo plugin list and rebuild the native application.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @luckylca/react-native-liquid-glass@^0.3.0
|
|
12
|
+
npx expo run:android
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The old renderer-selection switches are retired. The deprecated runtime getters report `core`; setters accept only that value. Android capabilities choose the available material tier automatically.
|
|
16
|
+
|
|
17
|
+
Native source packages now use `io.github.luckylca.liquidglass`; Expo adapter sources use `expo.modules.liquidglass`. Applications importing the public React Native API need no namespace changes.
|
|
18
|
+
|
|
19
|
+
0.3 已内置完整原生引擎,并合并为一个 Expo 模块。升级包后,从应用脚本中删除旧补丁命令;若 `liquid-glass-kit` 仅供本库使用,也可删除该依赖。保留本库 Expo 插件并重新构建原生应用。普通组件的导入和使用方式保持不变。
|
package/docs/publishing.md
CHANGED
|
@@ -4,7 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
The npm package name is `@luckylca/react-native-liquid-glass`; the GitHub repository is `luckylca/react-native-liquid-glass`. Publish it from the npm account that owns the `@luckylca` scope.
|
|
6
6
|
|
|
7
|
-
The source version is `0.
|
|
7
|
+
The source version is `0.3.0`, the license is `MIT`, and `publishConfig` targets `https://registry.npmjs.org/` with public access. Check the registry for existing versions before each release.
|
|
8
|
+
|
|
9
|
+
## GitHub Actions trusted publishing / GitHub 可信发布
|
|
10
|
+
|
|
11
|
+
The `Publish to npm` workflow uses GitHub's OIDC identity to publish without a stored npm token or a local CLI login. Configure the package's **Settings → Trusted Publisher → GitHub Actions** connection on npm once:
|
|
12
|
+
|
|
13
|
+
| Field | Value |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Organization or user | `luckylca` |
|
|
16
|
+
| Repository | `react-native-liquid-glass` |
|
|
17
|
+
| Workflow filename | `publish.yml` |
|
|
18
|
+
| Environment | Leave empty |
|
|
19
|
+
| Allowed actions | `npm stage publish`; optionally allow `npm publish` for direct releases |
|
|
20
|
+
|
|
21
|
+
The account owner must save this connection and complete any verification npm requests. The workflow does not change account authentication settings.
|
|
22
|
+
|
|
23
|
+
Then open **Actions → Publish to npm → Run workflow**, select the intended release ref, enter the version from its `package.json` and keep **dry_run** enabled for a validation run. After that succeeds, run the same ref/version with **dry_run** disabled. The default **publication_mode: staged** uploads the checked archive for the owner to approve under npm **Settings → Staged Packages**, including npm's two-factor verification. The version becomes public only after approval. Choose **direct** only when the connection explicitly allows `npm publish`.
|
|
24
|
+
|
|
25
|
+
The workflow checks package identity and version, runs TypeScript and JS tests, builds an archive and submits that exact archive. It retains the archive and its integrity in the run results. It does not run on ordinary pushes or automatically publish future commits. A staged version reserves its version number, so inspect the existing stage before retrying an upload.
|
|
26
|
+
|
|
27
|
+
首次由账号所有者在 npm 包设置中添加上表的 GitHub Actions 可信发布连接,并完成 npm 要求的验证。之后由 GitHub 工作流使用 OIDC 身份上传,无需本机 CLI 登录或保存 npm token。先在 **Actions → Publish to npm** 中选择发布版本对应的 ref,填写版本号并保留 **dry_run** 完成预演;预演通过后,对同一个 ref 和版本关闭 **dry_run**。默认的 **staged** 模式先上传已检查的安装包,再由账号所有者在 npm **Settings → Staged Packages** 中完成两步验证并批准,批准后版本才会公开。只有连接已允许 `npm publish` 时,才选择 **direct** 直接发布。暂存也会占用版本号,重试前应先核对已有暂存记录。普通推送不会触发发布。
|
|
28
|
+
|
|
29
|
+
See [npm's trusted publishing guide](https://docs.npmjs.com/trusted-publishers) for provider requirements and connection permissions.
|
|
8
30
|
|
|
9
31
|
## 1. Validate and create the archive
|
|
10
32
|
|
|
@@ -16,7 +38,7 @@ npm run check:release
|
|
|
16
38
|
npm pack
|
|
17
39
|
```
|
|
18
40
|
|
|
19
|
-
`check:release` runs TypeScript, unit tests and an archive preview. `prepack` builds CommonJS, ESM and declarations; `npm pack` then produces `luckylca-react-native-liquid-glass-0.
|
|
41
|
+
`check:release` runs TypeScript, unit tests and an archive preview. `prepack` builds CommonJS, ESM and declarations; `npm pack` then produces `luckylca-react-native-liquid-glass-0.3.0.tgz` using the final package name and version.
|
|
20
42
|
|
|
21
43
|
Inspect the archive before publishing: it should contain source, generated entry points, declarations, LICENSE and documentation. It must exclude node_modules, native build output, APKs and local captures. For this package, the `files` allowlist defines the published contents.
|
|
22
44
|
|
|
@@ -44,8 +66,8 @@ Use your own npm account and complete its browser / two-factor prompts. Do not p
|
|
|
44
66
|
After confirming the final npm name, choose a version that has not been published under that name, rebuild the archive and publish it:
|
|
45
67
|
|
|
46
68
|
```sh
|
|
47
|
-
npm publish ./luckylca-react-native-liquid-glass-0.
|
|
48
|
-
npm view @luckylca/react-native-liquid-glass@0.
|
|
69
|
+
npm publish ./luckylca-react-native-liquid-glass-0.3.0.tgz --access public --registry=https://registry.npmjs.org/
|
|
70
|
+
npm view @luckylca/react-native-liquid-glass@0.3.0 version license dist.integrity --registry=https://registry.npmjs.org/
|
|
49
71
|
```
|
|
50
72
|
|
|
51
73
|
Replace the archive and package names if the npm name changes. A registry name and version identify one immutable release; subsequent releases need a new version. Commit version and lockfile changes, and publish only an archive built from the intended release commit.
|
|
@@ -54,7 +76,7 @@ Replace the archive and package names if the npm name changes. A registry name a
|
|
|
54
76
|
|
|
55
77
|
npm 包名为 `@luckylca/react-native-liquid-glass`,GitHub 仓库为 `luckylca/react-native-liquid-glass`。使用拥有 `@luckylca` scope 的 npm 账号发布,每次发布前先查询 registry 中的现有版本。
|
|
56
78
|
|
|
57
|
-
当前版本为 `0.
|
|
79
|
+
当前版本为 `0.3.0`,采用 MIT。已移除阻止发布的 `private` 配置,并指定官方 npm registry 和 public 访问方式。
|
|
58
80
|
|
|
59
81
|
1. 在组件仓库运行 `npm ci`、`npm run check:release`、`npm pack`,生成 `.tgz` 安装包。
|
|
60
82
|
2. 将安装包安装到示例项目,运行示例类型检查;原生改动还需构建验证。
|
|
@@ -66,11 +88,11 @@ npm 包名为 `@luckylca/react-native-liquid-glass`,GitHub 仓库为 `luckylca
|
|
|
66
88
|
|
|
67
89
|
## Liquid Glass package contents
|
|
68
90
|
|
|
69
|
-
The archive
|
|
91
|
+
The archive includes the Android adapter, native engine, Expo config plugin and module registration. Install the package and its native peers, add the Expo plugin and rebuild the application. Performance and QA tools stay in the repository.
|
|
70
92
|
|
|
71
93
|
## Dependency validation / 依赖验证
|
|
72
94
|
|
|
73
|
-
The peer ranges accept React Native 0.81–0.85, Reanimated 4.1–4.3, Worklets 0.5–0.8 and Skia 2.x. These ranges must still be combined according to the animation packages' compatibility requirements; see the README table.
|
|
95
|
+
The peer ranges accept React Native 0.81–0.85, Reanimated 4.1–4.3, Worklets 0.5–0.8 and Skia 2.x. These ranges must still be combined according to the animation packages' compatibility requirements; see the README table.
|
|
74
96
|
|
|
75
97
|
Release preparation checked two combinations:
|
|
76
98
|
|
package/expo-module.config.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"platforms": [
|
|
2
|
+
"platforms": [
|
|
3
|
+
"android"
|
|
4
|
+
],
|
|
3
5
|
"android": {
|
|
4
6
|
"modules": [
|
|
5
|
-
"expo.modules.
|
|
6
|
-
"expo.modules.localglass.ExpoLocalGlassEngineModule",
|
|
7
|
-
"expo.modules.newhuliquidglass.ExpoGlassCoreModule"
|
|
7
|
+
"expo.modules.liquidglass.LiquidGlassModule"
|
|
8
8
|
]
|
|
9
9
|
}
|
|
10
10
|
}
|