项目作者: danielceinos

项目描述 :
Animated Number Text View Library
高级语言: Kotlin
项目地址: git://github.com/danielceinos/FSAnimatedTextView.git
创建时间: 2018-02-02T16:50:51Z
项目社区:https://github.com/danielceinos/FSAnimatedTextView

开源协议:MIT License

下载


FSAnimatedTextView

License
Version



Requirements

  • minAndroidSdk: 16

Installation

Add to your gradle.build:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }
  1. dependencies {
  2. compile 'com.github.danielceinos:FSAnimatedTextView:1.0.5'
  3. }

Use

Options

  1. <attr name="textSize" format="dimension"></attr>
  2. <attr name="textColor" format="color"></attr>
  3. <attr name="duration" format="integer"></attr>
  4. <attr name="leftDrawable" format="reference"></attr>
  5. <attr name="leftDrawableHeight" format="dimension"></attr>
  6. <attr name="leftDrawableWidth" format="dimension"></attr>
  7. <attr name="leftDrawableSize" format="dimension"></attr>
  8. <attr name="leftDrawableTint" format="color"></attr>
  9. <attr name="colorFeedback" format="boolean"></attr>

Example

  1. <com.fireshield.animatedtextview.FSAnimatedTV
  2. android:id="@+id/tv_retweet"
  3. android:layout_width="wrap_content"
  4. android:layout_height="wrap_content"
  5. android:layout_marginLeft="6dp"
  6. android:layout_weight="1"
  7. app:colorFeedback="true"
  8. app:duration="200"
  9. app:leftDrawable="@drawable/ic_cached"
  10. app:leftDrawableSize="20dp"
  11. app:leftDrawableTint="#FFF"
  12. app:textColor="#FFF"
  13. app:textSize="16sp"
  14. ></com.fireshield.animatedtextview.FSAnimatedTV>
  1. findViewById<FSAnimatedTV>(R.id.tv_number).setNum(1337)
  1. findViewById<FSAnimatedTV>(R.id.tv_number).setText("hey!")
  1. findViewById<FSAnimatedTV>(R.id.tv_like).increment(1)
  1. findViewById<FSAnimatedTV>(R.id.tv_like).decrement(6)