百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

AnimatedSvgView

> 编程语言
开源

适用于 Android 的动画 SVG 绘图

2.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 Android 的动画 SVG 绘图

AnimatedSvgView

适用于 Android 的动画 SVG 绘图

使用方式

获取 SVG 路径数据并将其添加到字符串数组中:

…

将每条路径的颜色添加到整型数组中:

xml
<color name="google_red">#EA4335</color>
<color name="google_yellow">#FBBC05</color>
<color name="google_blue">#4285F4</color>
<color name="google_green">#34A853</color>

<integer-array name="google_glyph_colors">
  <item>@android:color/white</item>
  <item>@color/google_red</item>
  <item>@color/google_yellow</item>
  <item>@color/google_blue</item>
  <item>@color/google_green</item>
</integer-array>

将视图添加到布局中:

xml
<com.jaredrummler.android.widget.AnimatedSvgView
    android:id="@+id/animated_svg_view"
    android:layout_width="180dp"
    android:layout_height="180dp"
    android:layout_gravity="center"
    android:layout_marginBottom="25dp"
    app:animatedSvgFillColors="@array/google_glyph_colors"
    app:animatedSvgGlyphStrings="@array/google_glyph_strings"
    app:animatedSvgFillStart="1200"
    app:animatedSvgFillTime="1000"
    app:animatedSvgImageSizeX="400"
    app:animatedSvgImageSizeY="400"
    app:animatedSvgTraceTime="2000"
    app:animatedSvgTraceTimePerGlyph="1000"/>

播放动画:

java
AnimatedSvgView svgView = (AnimatedSvgView) findViewById(R.id.animated_svg_view);
svgView.start();

您还可以动态设置 SVG 字形和颜色(请参阅 示例)。

下载

下载 最新的 AAR 或通过 Gradle 进行下载:

groovy
compile 'com.jaredrummler:animated-svg-view:1.0.6'

或 Maven:

xml
<dependency>
  <groupId>com.jaredrummler</groupId>
  <artifactId>animated-svg-view</artifactId>
  <version>1.0.6</version>
  <type>aar</type>
</dependency>

致谢

AnimatedMuzeiLogoView 由 Roman Nurik 创建 oak-animatedsvgview 由 WillowTree, Inc. 提供

被虱

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaandroidanimationpath-tracersvg

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言