Android-推荐一个TextView实现动画效果的库(HTextView)

Android开发中,我们可能会遇到实现某个TextView实现动画效果。关于这种需求,我给小伙们推荐推荐HTextView开源库,希望能小伙伴们提高开发效率。

HTextView

这是一块帮大家实现TextView动画效果的库。更多详细信息请查看开源库的文档

HTextView引入

写博客的时候,最新的版本是0.1.6。小伙伴们使用的时候,可以看看有没有更新版本。引入基础模块:

implementation "com.hanks:htextview-base:0.1.6" 

下面的可以按需引入:

implementation "com.hanks:htextview-fade:0.1.6"       
implementation "com.hanks:htextview-line:0.1.6"       
implementation "com.hanks:htextview-rainbow:0.1.6"     
implementation "com.hanks:htextview-typer:0.1.6"     
implementation "com.hanks:htextview-scale:0.1.6"       
implementation "com.hanks:htextview-evaporate:0.1.6"   
implementation "com.hanks:htextview-fall:0.1.6" 

line使用以及效果

<com.hanks.htextview.line.LineTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:paddingRight="10dp"
    android:text="This is LineTextView\nToday is Monday"
    android:textSize="16sp"
    app:animationDuration="3000"
    app:lineColor="#1367bc"
    app:lineWidth="4dp"/>

fade使用以及效果

<com.hanks.htextview.fade.FadeTextView
    android:layout_width="240dp"
    android:layout_height="150dp"
    android:gravity="left"
    android:letterSpacing="0.08"
    android:lineSpacingMultiplier="1.3"
    android:text="This is FadeTextView"
    android:textColor="#fff"
    android:textSize="20sp"
    app:animationDuration="1500"/>

typer使用以及效果

<com.hanks.htextview.typer.TyperTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="this is init sentence."
    app:charIncrease="3"
    app:typerSpeed="80"/>

rainbow使用以及效果

<com.hanks.htextview.rainbow.RainbowTextView
    android:layout_width="120dp"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:text="this is init sentence"
    android:textSize="20sp"
    app:colorSpace="150dp"
    app:colorSpeed="4dp"/>

scale使用以及效果

<com.hanks.htextview.scale.ScaleTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="this is init sentence"
    android:textSize="16sp"/>

evaporate使用以及效果

<com.hanks.htextview.evaporate.EvaporateTextView
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:gravity="center"
    android:paddingTop="8dp"
    android:text="this is init sentence"
    android:textSize="20sp"/>

fall使用以及效果

<com.hanks.htextview.fall.FallTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="20dp"
    android:text="this is init sentence"
    android:textSize="16sp"/>

感觉给TextView加动画效果还是很棒的,有机会的话可以在项目中使用到。



 具体特效查看官方github  GitHub - hanks-zyh/HTextView: Animation effects to text, not really textview

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值