HTextView:非常炫酷的 TextView 效果

HTextView:非常炫酷的 TextView 效果_第1张图片 

作者  食梦兽  关注
2015.12.25 23:08  字数 211  阅读 1924 评论 12

这是一款非常炫酷的TextView,绝对给你惊喜。

Github地址:https://github.com/hanks-zyh/HTextView

先放几张效果图:

Default : Scale:


EvaporateText:


Fall:


fall.gif

Line:


Sparkle:


Anvil:


再说怎样使用:

在Module的build.gradle#dependencies添加

compile 'hanks.xyz:htextview-library:0.1.2'

在布局文件的根节点中添加命名空间:

xmlns:htext="http://schemas.android.com/apk/res-auto"

布局文件中添加HTextView:

<com.hanks.htextview.HTextView
       android:id="@+id/htext"
       android:layout_width="match_parent"
       android:layout_height="100dp"
       android:background="#000000"
       android:gravity="center"
       android:textColor="#FFFFFF"
       android:textSize="30sp"
       htext:animateType="anvil"
       />

在java代码中使用:

hTextView = (HTextView) findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.LINE);
hTextView.animateText("new simple string"); // animate

Note:仅支持sdk版本15以上。

即,在Module的build.gradle#defaultConfig#minSdkVersion值为15

defaultConfig {
        ...
        minSdkVersion 15
       ...
    }

你可能感兴趣的:(HTextView:非常炫酷的 TextView 效果)