Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - need a number flip animation

I'm developing an Android application to read "electric meters". The user enters the counter - the application calculates the consumption and sends it to a server.

The representation of the counter should look like a old electricity meters old electricity meter

I've already integrated the counter-numbers as images. I will have an animation that if the user enters a number (keyboard) then the relevant section begins to rotate to the correct number position.

For example: The user enters the number 5 for the first digit, then rotate the digit from 0-5. The animated numbers flip to the correct position. How can I do this? Any idea? thank u!!!

like image 720
Kollisionskurs Avatar asked Nov 18 '11 11:11

Kollisionskurs


2 Answers

There is a custom view which I've created for a custom application. Initially, i also tried searching for this type of view but couldn't found any. So created one of my own.

You can see the code here: https://github.com/Vinayrraj/Android-FlipDigitView

Also this video might help you: http://youtu.be/d6-M2nN2Gzg

enter image description here

like image 183
Vinay Avatar answered Sep 30 '22 23:09

Vinay


You can take a look to Ticker, an Android text view with scrolling text change animation:

Ticker

Ticker is a simple Android UI component for displaying scrolling text. Think about how an odometer scrolls when going from one number to the next, that is similar to what Ticker does. The Ticker handles smooth animations between strings and also string resizing (e.g. animate from "9999" to "10000").

like image 39
David Miguel Avatar answered Oct 01 '22 00:10

David Miguel