0

構築しようとしているアプリケーションの一部としてゲージ/メーター/ダイヤル アニメーションを作成しようとしています。

私がやろうとしているのは、センサーを介して取得した加速度値をゲージに表示することです。センサーから値を正常に取得できるようになりましたが、それらをアニメーション化されたゲージ/ダイヤルとして表示する方法がわかりません。

フレームごとのアニメーションとトゥイーンのアニメーションを見てきましたが、コードからの入力に基づいてアニメーションを変更するためにそれらを使用できないように見えるため、私のニーズには合いません。

ゲージの画像と針の画像を表示し、値に応じて針の画像の回転を変更して、アニメーションに見えるようにする必要がありますが、これを行う方法がわかりません。

私がやろうとしていることをする方法はありますか?より良い/代替方法はありますか?


私は標準の Android SDK と Eclipse を使用しており、Android v2.2 以降のデバイスをサポートしようとしています。

4

1 に答える 1

0

Hi Ayos Draw the background, a solid color is best, then draw you indicator in a different color (black). When you get a new value, test to see if its different and if it is draw the indicator in the background color (erase it). Then draw the new indicator. You will need to figure out a way of scaling your raw data and making it in to degrees to draw the indicator. Its best if your difference test allows you to not change the indicator if the change does not move the indicator less that a degree or two. If you use an image or pattern for the background then you have a big job in erasing the indicator. You might have to redraw the background every time, that takes a lot of processing time and the gauge may look jumpy. Cliff

于 2012-10-14T22:57:23.123 に答える