[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7379":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":14,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":21,"defaultBranch":22,"hasWiki":20,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":27,"discoverSource":28},7379,"SVGAPlayer-Android","svga\u002FSVGAPlayer-Android","svga","Similar to Lottie. Render After Effects \u002F Animate CC (Flash) animations natively on Android and iOS, Web.  使用 SVGAPlayer 在 Android、iOS、Web中播放 After Effects \u002F Animate CC (Flash) 动画。","http:\u002F\u002Fsvga.io",null,"Kotlin",3270,509,4,54,0,2,30.12,"Apache License 2.0",true,false,"master",[],"2026-06-12 02:01:38","# Archived\n本仓库已经停止维护，你仍然继续阅读源码及创建分叉，但本仓库不会继续更新，也不会回答任何 issue。\n\nThis repo has stopped maintenance, you can still continue to read the source code and create forks, but this repo will not continue to be updated, nor will it answer any issues.\n\n# SVGAPlayer\n\n[简体中文](.\u002Freadme.zh.md)\n\n## 支持本项目\n\n1. 轻点 GitHub Star，让更多人看到该项目。\n\n## Introduce\n\nSVGAPlayer is a light-weight animation renderer. You use [tools](http:\u002F\u002Fsvga.io\u002Fdesigner.html) to export `svga` file from `Adobe Animate CC` or `Adobe After Effects`, and then use SVGAPlayer to render animation on mobile application.\n\n`SVGAPlayer-Android` render animation natively via Android Canvas Library, brings you a high-performance, low-cost animation experience.\n\nIf wonder more information, go to this [website](http:\u002F\u002Fsvga.io\u002F).\n\n## Usage\n\nHere introduce `SVGAPlayer-Android` usage. Wonder exporting usage? Click [here](http:\u002F\u002Fsvga.io\u002Fdesigner.html).\n\n### Install Via Gradle\n\nWe host aar file on JitPack, your need to add `JitPack.io` repo `build.gradle`\n\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https:\u002F\u002Fjitpack.io' }\n    }\n}\n```\n\nThen, add dependency to app `build.gradle`.\n\n```\ncompile 'com.github.yyued:SVGAPlayer-Android:latest'\n```\n\n[![](https:\u002F\u002Fjitpack.io\u002Fv\u002Fyyued\u002FSVGAPlayer-Android.svg)](https:\u002F\u002Fjitpack.io\u002F#yyued\u002FSVGAPlayer-Android)\n\n### Static Parser Support\nPerser#shareParser should be init(context) in Application or other Activity.\nOtherwise it will report an error:\n`Log.e(\"SVGAParser\", \"在配置 SVGAParser context 前, 无法解析 SVGA 文件。\")`\n\n\n### Matte Support\nHead on over to [Dynamic · Matte Layer](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-%C2%B7-Matte-Layer)\n\n### Proguard-rules\n\n```\n-keep class com.squareup.wire.** { *; }\n-keep class com.opensource.svgaplayer.proto.** { *; }\n```\n\n### Locate files\n\nSVGAPlayer could load svga file from Android `assets` directory or remote server.\n\n### Using XML\n\nYou may use `layout.xml` to add a `SVGAImageView`.\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"utf-8\"?>\n\u003CRelativeLayout xmlns:android=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres\u002Fandroid\"\n    xmlns:app=\"http:\u002F\u002Fschemas.android.com\u002Fapk\u002Fres-auto\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    \u003Ccom.opensource.svgaplayer.SVGAImageView\n        android:layout_height=\"match_parent\"\n        android:layout_width=\"match_parent\"\n        app:source=\"posche.svga\"\n        app:autoPlay=\"true\"\n        android:background=\"#000\" \u002F>\n\n\u003C\u002FRelativeLayout>\n```\n\nThe following attributes is allowable:\n\n#### source: String\n\nThe svga file path, provide a path relative to Android assets directory, or provide a http url.\n\n#### autoPlay: Boolean\n\nDefaults to `true`.\n\nAfter animation parsed, plays animation automatically.\n\n#### loopCount: Int\n\nDefaults to `0`.\n\nHow many times should animation loops. `0` means Infinity Loop.\n\n#### ~~clearsAfterStop: Boolean~~\n\nDefaults to `false`.When the animation is finished, whether to clear the canvas and the internal data of SVGAVideoEntity.\nIt is no longer recommended. Developers can control resource release through clearAfterDetached, or manually control resource release through SVGAVideoEntity#clear\n\n#### clearsAfterDetached: Boolean\n\nDefaults to `false`.Clears canvas and the internal data of SVGAVideoEntity after SVGAImageView detached.\n\n#### fillMode: String\n\nDefaults to `Forward`. Could be `Forward`, `Backward`, `Clear`.\n\n`Forward` means animation will pause on last frame after finished.\n\n`Backward` means animation will pause on first frame after finished.\n\n`Clear` after the animation is played, all the canvas content is cleared, but it is only the canvas and does not involve the internal data of SVGAVideoEntity.\n\n### Using code\n\nYou may use code to add `SVGAImageView` either.\n\n#### Create a `SVGAImageView` instance.\n\n```kotlin\nSVGAImageView imageView = new SVGAImageView(this);\n```\n\n#### Declare a static Parser instance.\n\n```kotlin\nparser = SVGAParser.shareParser()\n```\n\n#### Init parser instance \n\nYou should initialize the parser instance with context before usage.\n```\nSVGAParser.shareParser().init(this);\n```\n\nOtherwise it will report an error:\n`Log.e(\"SVGAParser\", \"在配置 SVGAParser context 前, 无法解析 SVGA 文件。\")`\n\nYou can also create `SVGAParser` instance by yourself.\n\n#### Create a `SVGAParser` instance, parse from assets like this.\n\n```kotlin\nparser = new SVGAParser(this);\n\u002F\u002F The third parameter is a default parameter, which is null by default. If this method is set, the audio parsing and playback will not be processed internally. The audio File instance will be sent back to the developer through PlayCallback, and the developer will control the audio playback and playback. stop\nparser.decodeFromAssets(\"posche.svga\", object : SVGAParser.ParseCompletion {\n    \u002F\u002F ...\n}, object : SVGAParser.PlayCallback {\n    \u002F\u002F The default is null, can not be set\n})\n```\n\n#### Create a `SVGAParser` instance, parse from remote server like this.\n\n```kotlin\nparser = new SVGAParser(this);\n\u002F\u002F The third parameter is a default parameter, which is null by default. If this method is set, the audio parsing and playback will not be processed internally. The audio File instance will be sent back to the developer through PlayCallback, and the developer will control the audio playback and playback. stop\nparser.decodeFromURL(new URL(\"https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGA-Samples\u002Fblob\u002Fmaster\u002Fposche.svga?raw=true\"), new SVGAParser.ParseCompletion() {\n    \u002F\u002F ...\n}, object : SVGAParser.PlayCallback {\n    \u002F\u002F The default is null, can not be set\n})\n```\n\n#### Create a `SVGADrawable` instance then set to `SVGAImageView`, play it as you want.\n\n```kotlin\nparser = new SVGAParser(this);\nparser.decodeFromURL(..., new SVGAParser.ParseCompletion() {\n    @Override\n    public void onComplete(@NotNull SVGAVideoEntity videoItem) {\n        SVGADrawable drawable = new SVGADrawable(videoItem);\n        imageView.setImageDrawable(drawable);\n        imageView.startAnimation();\n    }\n    @Override\n    public void onError() {\n\n    }\n});\n```\n\n### Cache\n\n`SVGAParser` will not manage any cache, you need to setup cacher by yourself.\n\n#### Setup HttpResponseCache\n\n`SVGAParser` depends on `URLConnection`, `URLConnection` uses `HttpResponseCache` to cache things.\n\nAdd codes to `Application.java:onCreate` to setup cacher.\n\n```kotlin\nval cacheDir = File(context.applicationContext.cacheDir, \"http\")\nHttpResponseCache.install(cacheDir, 1024 * 1024 * 128)\n```\n\n### SVGALogger\nUpdated the internal log output, which can be managed and controlled through SVGALogger. It is not activated by default. Developers can also implement the ILogger interface to capture and collect logs externally to facilitate troubleshooting\nSet whether the log is enabled through the `setLogEnabled` method\nInject a custom ILogger implementation class through the `injectSVGALoggerImp` method\n\n\n```kotlin\n\n\u002F\u002F By default, SVGA will not output any log, so you need to manually set it to true\nSVGALogger.setLogEnabled(true)\n\n\u002F\u002F If you want to collect the output log of SVGA, you can obtain it in the following way\nSVGALogger.injectSVGALoggerImp(object: ILogger {\n\u002F\u002F Implement related interfaces to receive log\n})\n```\n\n### SVGASoundManager\nAdded SVGASoundManager to control SVGA audio, you need to manually call the init method to initialize, otherwise follow the default audio loading logic.\nIn addition, through SVGASoundManager#setVolume, you can control the volume of SVGA playback. The range is [0f, 1f]. By default, the volume of all SVGA playbacks is controlled.\nAnd this method can set a second default parameter: SVGAVideoEntity, which means that only the current SVGA volume is controlled, and the volume of other SVGAs remains unchanged.\n\n```kotlin\n\u002F\u002F Initialize the audio manager for easy management of audio playback\n\u002F\u002F If it is not initialized, the audio will be loaded in the original way by default\nSVGASoundManager.init()\n\n\u002F\u002F Release audio resources\nSVGASoundManager.release()\n\n\u002F**\n* Set the volume level, entity is null by default\n* When entity is null, it controls the volume of all audio loaded through SVGASoundManager, which includes the currently playing audio and subsequent loaded audio\n* When entity is not null, only the SVGA audio volume of the instance is controlled, and the others are not affected\n* \n* @param volume The value range is [0f, 1f]\n* @param entity That is, the instance of SVGAParser callback\n*\u002F\nSVGASoundManager.setVolume(volume, entity)\n```\n\n## Features\n\nHere are many feature samples.\n\n* [Replace an element with Bitmap.](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-Image)\n* [Add text above an element.](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-Text)\n* [Add static layout text above an element.](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-Text-Layout)\n* [Hides an element dynamicaly.](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-Hidden)\n* [Use a custom drawer for element.](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FDynamic-Drawer)\n\n## APIs\n\nHead on over to [https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FAPIs](https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fwiki\u002FAPIs)\n\n## CHANGELOG\n\nHead on over to [CHANGELOG](.\u002FCHANGELOG.md)\n\n## Credits\n\n### Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyyued\u002FSVGAPlayer-Android\u002Fgraphs\u002Fcontributors\">\u003Cimg src=\"https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android\u002Fcontributors.svg?width=890&button=false\" \u002F>\u003C\u002Fa>\n\n### Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android#backer)]\n\n\u003Ca href=\"https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android#backers\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android\u002Fbackers.svg?width=890\">\u003C\u002Fa>\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android#sponsor)]\n\n\u003Ca href=\"https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android\u002Fsponsor\u002F0\u002Fwebsite\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fopencollective.com\u002FSVGAPlayer-Android\u002Fsponsor\u002F0\u002Favatar.svg\">\u003C\u002Fa>\n\n","SVGAPlayer-Android 是一个轻量级的动画渲染库，用于在 Android 平台上原生渲染由 Adobe Animate CC 或 Adobe After Effects 导出的 SVGA 格式动画。其核心功能包括通过 Android Canvas 库进行高性能、低成本的动画渲染，并支持静态解析器初始化、遮罩层以及 Proguard 规则配置等技术特性。适用于需要在移动应用中展示复杂动画效果但又希望保持良好性能和较低资源消耗的场景。尽管该项目已停止维护，但其源码仍然开放供开发者参考和使用。","2026-06-11 03:12:02","top_language"]