Repository navigation
v1.0.0
The first stable release. The public API is now frozen under semantic versioning.
Added
- Liquid glass:
GlassStyle(BlurView.glass, Composeglass()). On every API level it adds a rim highlight, gloss and edge shading. On API 33+ it also refracts and disperses color at the rim, using an AGSLRuntimeShaderchained after the blur, so it costs no main-thread time. - Progressive blur:
BlurGradient(BlurView.gradient, Composegradient), with presetsTopToBottom,BottomToTop,LeftToRightandRightToLeft. - Multi-layer blur: blur surfaces drawn earlier now appear in the blur of the ones drawn after them, so stacked glass panels show each other.
ViewCapture.capturegained anownerparameter for this. blur-showcase: a Compose app that demonstrates the three effects and theBlurViewanimation API. Itsautoplaymode makes recordings repeatable.scripts/record-demo.ps1: records the README screenshots and GIFs fromblur-showcaseon an emulator or device.- License: released under the Apache License 2.0. Every Kotlin, Gradle and XML source file carries the license header.
./gradlew spotlessApplyadds it to new files, andspotlessCheck(run in CI) fails if one is missing. - Publishing: Maven Central publishing for the 8 library modules under
io.github.mrsluffy, each with a sources jar, a Dokka javadoc jar and signed artifacts. - API docs: generated with Dokka (
./gradlew dokkaHtmlMultiModule). - API check: public API snapshots (
api/*.api), checked by./gradlew check. - CI: GitHub Actions runs lint, unit tests, the API check and device tests on API 29 and 34. Pushing a
v*tag runs the publish workflow. - Timing switch for device tests: the instrumentation argument
timingAssertions=falseturns off frame-rate checks for emulators without GPU acceleration. CI sets it. Correctness checks always run.
Fixed
-
GLES threading: the GLES backend now runs every GL call on one thread that it owns.
BlurViewcreates the backend on a background thread and renders on the main thread, and moving the EGL context between those threads was unreliable. On the Android emulator, a test reproduced three faults:- the first render on the second thread failed with GL_INVALID_VALUE;
- the GL objects broke once the creating thread exited;
- the main thread paid about 300 ms of one-time GL setup on its first frame, which dropped frames at the start of a GLES animation.
initialize,renderandreleasestill block until their work is done, and the hand-off allocates nothing per frame.GlesThreadingTestcovers all three faults. -
API 29 lint error:
RenderEffectBackendFactory, which must be safe to load on API 29 and 30, referenced the API 31 backend class. It now owns theIDconstant itself and uses an explicitSDK_INTbranch.
Changed
RenderEffectBlurBackend.IDis now defined asRenderEffectBackendFactory.ID. The value,"render-effect", is unchanged.
Install
implementation("io.github.mrsluffy:blur-view:1.0.0") // Android Views
implementation("io.github.mrsluffy:blur-compose:1.0.0") // Jetpack Composeblur-showcase-v1.0.0.apk is the demo app (a debug build; Android 10+).