Giter Site home page Giter Site logo

countingtextview's Introduction

Animated Counting TextView

Animated counting textview component for Android. With countingtextview you can enumerate a textview with given start and end values. You can play with duration of the animation and the interpolator which is playing the counting animation.

Image

#How to?

After importing library to your project add a countingtextview to your XML layout.

####XML definition <com.uguratar.countingtextview.countingTextView android:id="@+id/countingText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textIsSelectable="false" android:textSize="22sp" android:textStyle="bold"/>

After adding your countingtextview you can use the methods to animate your textview with the values of your choice.

private countingTextView points;


points = (countingTextView) findViewById(R.id.countingText);
//Animate from 0 to 250
points.animateText(0,250);
//Animate from 0 to 1233 in 2 seconds
points.animateFromZero(1233,2000);
//Animate from 0 to 7233 in 1.2 seconds
points.animateFromZero(7233);
//set end value and play animation from zero
points.setEndValue(3422);
points.animateFromZerotoCurrentValue();
//set start end value and play animation in 5 seconds
points.setStartValue(-1000);
points.setEndValue(3444);
points.animateText(5000);
//change interpolator and animate from 0 to 2233 in 10 seconds
points.setInterpolator(new LinearInterpolator());
points.animateFromZero(7233, 10000);

####Note: animation sequencing is not implemented yet, so the library can't play animations in order. So you should use one of the methods above to animate your textview.

Feel free to contribute by sending a PR, creating an issue or tweeting me @uuratar.

And thanks for the inspiration; http://stackoverflow.com/a/24389011/3399234

Android Arsenal

countingtextview's People

Contributors

uguratar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.