Electricity meter-like view - Android

2019-08-23 09:30发布

问题:

I am trying to include a widget / view in my Android app that displays a number and when the number is incremented, the new number slides into view as if each digit was on a rolling dial. In the UK (at least), electricity meters work in this way. Examples would be:

See app image of https://play.google.com/store/apps/details?id=ie.esb.app.android

See screenshots of http://www.appszoom.com/android_applications/lifestyle/using-the-power-meter-in-tokyo_vvfi.html

A Google image search for "android electricity meter view" also brings up some similar results.

On iOS, the Nike+ FuelBand app shows their fuel points on the same dial:

I'm not even sure I know what to call those things. I am told that they were originally called a "Digital Clock", but that is obviously not a good thing to search for. Does Android code exist for one somewhere already?

Otherwise I think I could create one by sliding Fragments in and out of view, perhaps using a ViewPager. Would this be a good way to go about this problem?

回答1:

Actually, I call it DigitalView, using ScrollView as every bit to implement slide effect.