The first alpha version of Android Jetpack Compose...
# feed
k
The first alpha version of Android Jetpack Compose Liquid Glass library is released. It is relatively high performance. Check for details: https://github.com/Kyant0/AndroidLiquidGlass
K 9
๐Ÿ“ฑ 3
๐Ÿ‘ 5
๐Ÿš€ 18
Here's another demo
k
this is done with runtime shaders right ? Any chance you could export this to Desktop target as well ?
โž• 3
s
I would like a Compose Multiplatform lib, too. Just in case we need to adopt that design on iOS and macOS. ๐Ÿ˜„
Nice to see that you added configuration parameters to make it more readable than the original. I hope Apple provides something similar, because what they showed us in the keynote was barely readable.
I am confused about the project licenseโ€ฆ do these extra license headers mean itโ€™s not entirely Apache licensed? ๐Ÿค” https://github.com/Kyant0/AndroidLiquidGlass/blob/master/liquid-glass/src/main/java/com/kyant/liquidglass/LiquidGlassShaders.kt
k
apache 2 license allows for repurposing this into Multiplatform and desktop target with a quick reference to original author
Copy code
// This file belongs to Kyant. You must not use it without permission
as long as attribution is there, we should be able to ignore these comments and convert AGSL to SkSL with multiplatform expect/actuals this will be a superset of chris bane's haze and give us an even better-than-ios Liquid Glass with all the knobs and configurations on ALL PLATFORMS !! sick ๐Ÿง‘โ€๐ŸŒพ
a
Permission implies that permission must be asked. Not a quick reference.
โž• 2
k
Oh, I forgot to delete these lines
๐Ÿ‘ 1
๐Ÿ™‚ 4
๐Ÿ‘๐Ÿพ 1
u
Awesome ! Please do it kmp ๐Ÿ™
โž• 5
z
Looks very fun, would also love to try this with Compose Multiplatform ๐Ÿ˜‰
๐Ÿ‘ 1
k
halfway through implementation/porting I realised we need system permissions (
Screen Recording
) for each desktop platform like macOS to reuse IOSurface buffers and streaming them into a metal-backed skia texture Windows requires UWP capture APIs or Desktop Duplication APIs, each with its own quirks and security models. Linux is easier, but even then you're dealing with X11 vs Wayland fragmentation. so requesting for system screen recording permissions just to get a true liquid glass effect sounds insane - I'm giving up, we will never have a multiplatform liquid glass probably ๐Ÿ‘Œ
๐Ÿ‘€ 2
s
Why does Windows require such strange permissions for this effect? ๐Ÿค”
k
i m not that sure about windows, but OSX almost def needs it. Its a hairy quest
s
Isnโ€™t it possible to achieve these effects with low level SKIA?
k
yes u need JNI bridges for each platform as well, because skia(skiko) has no access to pixels behind window on desktop skiko might need patch to expose skiko metal context's device/queue internal vars or something similar. I'm exploring around forking skiko to get macos working its tough on some platforms because of the sandbox, we need transparent window to get pixels behind window from the desktop.... with a strategy like:
CGDisplayStream + IOSurface โ†’ Metal texture โ†’ Skia Image
on macos for example
๐Ÿ‘€ 1
s
Hmmโ€ฆ you can set a Compose Window to be transparent AFAIK. That doesnโ€™t need extra permissions.
a
But you need access to pixels data to write a shader
๐Ÿ‘€ 1
s
Because this effect is way more than just adding a effect to the pixels behind? ๐Ÿค” I think I got it now.
a
In order to blur the background you need access to the background pixels yes. Or in order to do any shader. Transparency is the odd one out here which can be achieved by setting the alpha of the pixels โ€œownedโ€ by the app Adding an effect to the pixels behind only works of you can actually access those pixels behind
s
Ok, got it. Liquid glass is more than a alpha, because we also have this fraction of light thingy going on.
That effect happening at the borders.
Itโ€™s so afwul, what is Apple even thinking? ๐Ÿ‘€
I find it totally distracting. But in case we need to adopt it Iโ€™m thankful for this lib.
If it becomes some kind of requirement for macOS Apps in the future I think SKIA or the JVM / Swing will provide a way to access the pixels for the purpose of achieving such effects. At least on macOS.
Iโ€™m also curious if users will have the option to turn if off. That will be interesting to see once the stable iOS version releases.