expo-android-glass-view 1.0.0 → 1.0.2
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.2 — 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **1.0.1 crashed on Android when a menu opened or closed** (`UnsupportedOperationException:
|
|
8
|
+
Only CornerBasedShape is supported in lens effects`): it handed the menu's drop-shaped
|
|
9
|
+
silhouette to the glass lens, which only accepts rounded rectangles. The glass is drawn
|
|
10
|
+
exactly as in 1.0.0 again. The drop shadow is now a separate layer behind it, with the
|
|
11
|
+
same position, size, scale and fade, so it stays visible without touching the glass.
|
|
12
|
+
Do not use 1.0.1.
|
|
13
|
+
|
|
14
|
+
### Compatibility
|
|
15
|
+
|
|
16
|
+
- Rebuild the Android app or development client; this is a native change.
|
|
17
|
+
|
|
18
|
+
## 1.0.1 — 2026-10-18
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `AndroidGlassMenu` now draws its drop shadow. The menu's animation layer clipped everything
|
|
23
|
+
inside it to the menu's shape, including the shadow, so `shadow` and `shadowOpacity` had no
|
|
24
|
+
visible effect. The glass surface now clips itself and the animation layer only scales and
|
|
25
|
+
fades, so the shadow shows around the menu and follows its opening animation.
|
|
26
|
+
|
|
27
|
+
### Compatibility
|
|
28
|
+
|
|
29
|
+
- Rebuild the Android app or development client; this is a native change. iOS and web are
|
|
30
|
+
unchanged.
|
|
31
|
+
|
|
3
32
|
## 1.0.0 — 2026-09-21
|
|
4
33
|
|
|
5
34
|
### Changed
|
|
@@ -36,7 +36,9 @@ import expo.modules.androidglassview.backdrop.effects.lens
|
|
|
36
36
|
import expo.modules.androidglassview.backdrop.effects.vibrancy
|
|
37
37
|
import expo.modules.androidglassview.backdrop.highlight.Highlight
|
|
38
38
|
import expo.modules.androidglassview.backdrop.isRenderEffectSupported
|
|
39
|
+
import expo.modules.androidglassview.backdrop.internal.ShapeProvider
|
|
39
40
|
import expo.modules.androidglassview.backdrop.shadow.Shadow
|
|
41
|
+
import expo.modules.androidglassview.backdrop.shadow.ShadowElement
|
|
40
42
|
import expo.modules.kotlin.AppContext
|
|
41
43
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
42
44
|
import org.json.JSONArray
|
|
@@ -334,12 +336,27 @@ class AndroidGlassMenuPanel(context: Context, appContext: AppContext) : GlassHos
|
|
|
334
336
|
val localRadius = radius / effectScale
|
|
335
337
|
val shape = RoundedCornerShape(localRadius.coerceAtLeast(0f).dp)
|
|
336
338
|
val silhouette = if (neck > .001f) MenuDropShape(localRadius.dp, neck) else shape
|
|
337
|
-
|
|
339
|
+
val placement = Modifier.offset {
|
|
338
340
|
IntOffset(with(density) { (x + width * (1f - stretchX) + dragX * 7f * (1f - verticalPull).coerceAtLeast(0f)).dp.toPx() }.roundToInt(),
|
|
339
341
|
with(density) { (y + dragY * 8f).dp.toPx() }.roundToInt())
|
|
340
342
|
}
|
|
341
343
|
.requiredSize((if(fixedLayer) layoutWidth else width).coerceAtLeast(1f).dp,
|
|
342
344
|
(if(fixedLayer) layoutHeight else height).coerceAtLeast(1f).dp)
|
|
345
|
+
val dropShadow: () -> Shadow? = {
|
|
346
|
+
if (!shadowEnabled) null else menuGlass.dropShadow.let { base ->
|
|
347
|
+
shadowOpacity?.let { base.copy(color = base.color.copy(alpha = it)) } ?: base
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// The drop shadow is its own layer behind the glass. The glass layer below is
|
|
351
|
+
// clipped to the menu silhouette, so a shadow drawn inside it was cut off and
|
|
352
|
+
// never visible. This layer takes the same position, size, scale and fade, and
|
|
353
|
+
// ShadowNode masks the shape's interior, so only the outside is shaded.
|
|
354
|
+
Box(placement.graphicsLayer {
|
|
355
|
+
transformOrigin = TransformOrigin(0f,0f)
|
|
356
|
+
this.scaleX = surfaceScaleX; this.scaleY = surfaceScaleY
|
|
357
|
+
this.alpha = overallAlpha
|
|
358
|
+
}.then(ShadowElement(ShapeProvider { silhouette }, dropShadow)))
|
|
359
|
+
Box(placement
|
|
343
360
|
.drawBackdrop(backdrop = backdrop, shape = { shape }, clipToShape = false, layerBlock = {
|
|
344
361
|
transformOrigin = TransformOrigin(0f,0f)
|
|
345
362
|
this.scaleX = surfaceScaleX; this.scaleY = surfaceScaleY
|
|
@@ -347,11 +364,7 @@ class AndroidGlassMenuPanel(context: Context, appContext: AppContext) : GlassHos
|
|
|
347
364
|
}, effects = {
|
|
348
365
|
glassEffects(menuGlass, effectScale, material, press)
|
|
349
366
|
}, highlight = { menuGlass.rim.copy(alpha = menuGlass.rim.alpha + press * .25f) },
|
|
350
|
-
shadow =
|
|
351
|
-
if (!shadowEnabled) null else menuGlass.dropShadow.let { base ->
|
|
352
|
-
shadowOpacity?.let { base.copy(color = base.color.copy(alpha = it)) } ?: base
|
|
353
|
-
}
|
|
354
|
-
},
|
|
367
|
+
shadow = null,
|
|
355
368
|
onDrawSurface = { glassSurface(menuGlass, effectsSupported) }
|
|
356
369
|
)
|
|
357
370
|
.then(scrubbing)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-android-glass-view",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Liquid Glass views, buttons, sliders and toggles for React Native on Android (Jetpack Compose, powered by Kyant0/AndroidLiquidGlass)",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"bugs": {
|
|
28
28
|
"url": "https://github.com/kagantemizkan/expo-android-glass-view/issues"
|
|
29
29
|
},
|
|
30
|
-
"author": "
|
|
30
|
+
"author": "Kağan Temizkan <info@sailatlas.app> (https://sailatlas.app)",
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"homepage": "https://github.com/kagantemizkan/expo-android-glass-view#readme",
|
|
33
33
|
"dependencies": {},
|