Repository navigation
feat: slots, bezier paths, asset resolver and state machine parity with dotlottie-rs - #149
Merged
Merged
Conversation
cpal 0.16 (pulled in by rodio 0.21) replaced oboe with AAudio, which the NDK only ships for API 26+, so libdotlottie_player.so no longer linked at API 21. Each ABI now links a static libaaudio.a generated from the NDK's AAudio.h: every entry point forwards to the real libaaudio.so through dlopen/dlsym on first use. On Android 8+ calls reach the system library; on older devices they return AAUDIO_ERROR_UNAVAILABLE and rodio reports no output device, so the animation plays silently instead of the library failing to load.
Bump deps/dotlottie-rs from v0.1.60 to 02a61130 (main after #623). This brings rodio 0.21 with the audio-wav, audio-flac, audio-ogg and audio-m4a features, the audio volume left-channel fix, typed bezier path slot setters and the state machine forward-compat fixes. Enable the four decoder features in the Gradle plugin defaults, the dotlottieRust block and make/android.mk, rebuild all four ABIs, and bump the version to 0.18.0.
Bring the Kotlin API up to the dotlottie-rs C API at 02a61130: - getSlotIds, getSlotType, getSlot, getSlots, setSlot, resetSlot and resetSlots - setBezierPathSlot - an AssetResolver for assets the player cannot load itself, set through Config.Builder or the DotLottieAnimation composable - stateMachineStatus and getStateMachine All of them are available on the views, the drawable and the Compose controller. No native rebuild: the JNI bridge links the same libdotlottie_player.so (dotlottie-rs 02a61130, ThorVG v1.1.3).
|
DotLottieDrawable.loopCount had no setter, so DotLottieAnimation.setLoopCount() only wrote a field and never reached the player.
Bump deps/dotlottie-rs to 1fd64fec (LottieFiles/dotlottie-rs#625), which adds these three to the C API, and rebuild all four ABIs. ThorVG is unchanged at v1.1.3. Wrap them as stateMachineOverrideCurrentState, stateMachineResetInput and stateMachineGetInputs on the views, the drawable and the Compose controller.
LottieFiles/dotlottie-rs#625 was squash-merged. The tree is identical to 1fd64fec, which the libraries were built from.
Applying a config reset the theme whenever no theme was set, and resetting the theme discards slot overrides and theme data. So setLoop, setLoopCount, setPlayMode and every other config setter wiped the slots. Only set or reset the theme when it differs from the active one.
JSONObject.optString returns the string "null" for a JSON null, so animation names, initial themes and the other optional manifest fields came back as "null".
# Conflicts: # dotlottie/src/main/cpp/version.txt # dotlottie/src/main/jniLibs/arm64-v8a/libdotlottie_player.so # dotlottie/src/main/jniLibs/armeabi-v7a/libdotlottie_player.so # dotlottie/src/main/jniLibs/x86/libdotlottie_player.so # dotlottie/src/main/jniLibs/x86_64/libdotlottie_player.so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #148. Wraps the parts of the dotlottie-rs C API that Kotlin could not reach, and moves the core to dotlottie-rs
main(e5356051).Core
deps/dotlottie-rsbumped from02a61130toe5356051(feat: state machine override, input reset and input listing in the C API dotlottie-rs#625, which adds state machine override, input reset and input listing to the C API). All four ABIs are rebuilt.ce12cdd0e).1fd64fec, the PR commit before the squash merge. Its tree is identical toe5356051.New API (on
DotLottieAnimation,DotLottieGLAnimation,DotLottieDrawableandDotLottieController)getSlotIds(),getSlotType(id),getSlot(id),getSlots(),setSlot(id, json),resetSlot(id),resetSlots().setBezierPathSlot(id, vertices, closed, inTangents?, outTangents?): replaces the geometry of a path slot. Null tangents mean straight segments.stateMachineOverrideCurrentState(state, immediate),stateMachineResetInput(key),stateMachineGetInputs(),stateMachineStatus()andgetStateMachine(id).AssetResolver: supplies bytes for assets the player cannot load itself, such as an image referenced by a remote URL. Set it withConfig.Builder.assetResolver()or theassetResolverparameter of theDotLottieAnimationcomposable.Fixes
DotLottieAnimation.setLoopCount()did nothing:DotLottieDrawable.loopCounthad no setter, so the value never reached the player.setLoop,setLoopCount,setPlayModeand every other config setter cleared the slots. The theme is now only set or reset when it differs from the active one. Found by running the React Native wrapper on an emulator.namecame back as the string"null".JSONObject.optStringreturns that for a JSON null.Asset resolver notes
nativeDestroy.Tests
PlayerParityInstrumentedTestinsamplecovers the new calls and the three fixes. 10 of 10 pass on an API 35 arm64 emulator against the rebuilt libraries../gradlew :dotlottie:assembleReleasebuilds all four ABIs.Counterparts: LottieFiles/dotlottie-web#997, LottieFiles/dotlottie-ios#155.