pushinbr / pam-native-lottie
Native Lottie animations for PAM Native: lottie-android and lottie-ios behind one host view, paused off-screen, with a bounded composition cache.
Package info
github.com/push-in/pam-native-lottie
Language:Kotlin
Type:pam-native-plugin
pkg:composer/pushinbr/pam-native-lottie
Requires
- php: ^8.5
- pushinbr/pam-native: ^1.53.1
Requires (Dev)
- pushinbr/pam-native-plugin-kit: ^0.2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Native Lottie (Bodymovin) animations for PAM Native, the equivalent of lottie-react-native.
lottie-android 6.6 and lottie-ios 4.5 behind one host view, lottie.view, driven from PHP or a template tag.
Install · Quick example · Platforms · Resources · Docs · Issues
Install
Inside a PAM Native project, add only this capability:
pam composer require pushinbr/pam-native-lottie pam doctor --fix
The plugin registers the <Lottie> template tag and the lottie.view native view. New to PAM? Create a project with pam init my-app --template native (see the PAM Native overview).
Quick example
use Pam\Native\Lottie\Lottie; Lottie::url('https://cdn.example.com/party/lottie.json') ->size(116) ->playing($visible) // RN ref.resume() / ref.pause() ->fallback('🎉');
The same view as a template tag (registered by LottiePluginProvider):
<Lottie :uri="$emoji['lottieUrl']" size="116" :playing="$visible" fallback="🎉" label="Animated emoji" /> <Lottie src="assets/lottie/success.json" size="64" :loop="false" />
More: examples/EmojiTile.php (a picker tile that animates only the first rows) and the full method and attribute table in docs/lottie.md.
Platform support
| Platform | Support | Notes |
|---|---|---|
| Android | API 24+ | lottie-android 6.6.0, RenderMode.HARDWARE |
| iOS | 15.0+ | lottie-ios 4.5 via lottie-spm, QuartzCore, UIKit |
| PAM Native | 1.0.0 to < 2.0.0 | From pam-native.plugin.json; PHP 8.5+ |
Permissions and requirements
No runtime permissions. Remote animations need network access; file:// and asset:// (app bundle / Android assets) sources work offline.
Resource rules
- Frames only while the view is attached, visible and
playing; reduced motion shows the first frame. - One process-wide composition cache (32 entries / 12 MiB, LRU, trimmed on memory pressure); concurrent requests for a URL share a single download; parsing off the main thread.
- Android renders with
RenderMode.HARDWARE(asrenderMode="HARDWARE"in RN). - Animate only what is on screen: in grids, pass
playingonly for the first visible tiles.
Tests
pam composer test # php tests/run.php
iOS checks (core harness, Simulator behavior): docs/ios-validation.md.
Docs
- Lottie API and template reference
- iOS validation checklist
- PAM Native overview
- Changelog
- Report an issue
Part of the PAM ecosystem
PAM runs PHP natively on servers, desktops and phones. This repository is one piece of it.
| PAM | PAM Desktop | PAM Native | Ecosystem |
|---|---|---|---|
| the runtime and CLI | native desktop apps in PHP | native Android and iOS apps in PHP | every official package and plugin |
Docs: push-in.github.io/pam-docs · Issues
Apache License 2.0 · Made in Brazil by Pushin