Hello everyone, this question may be simple for many of you, but I can't think very well about it, maybe I need some sleep
I have a panel and inside it is a centered label with a value ranging from 0 to 255 depending on the touch on the panel.
Ok, it's already working to touch the panel and show the value on the label, values from 0 to 255.
My question is as follows.
When the user drops his finger on the panel.
Case Activity.ACTION_UP
I need to go from the current value to the maximum value which is 255, but this speed should be based on an animation time.
An example:
At this point I am doing the following, when the user drops the panel finger I simply go from the current value to 255. If the user is at 50 I jump from 50 to 255.
I would like to do something like go from 50 to 255 at (x ms time)
I want to show the user something like (in 2000ms for example, 50 to 255 in 2000ms)
50
51
52
...
255
and not simply jump from 50 to 255.
How can I make this calculation based on an animation time?
make a counter, which adds values in an int up to 255 in a time interval X.
Any tips are welcome, I'm very bad at math.
Thanks.
I have a panel and inside it is a centered label with a value ranging from 0 to 255 depending on the touch on the panel.
Ok, it's already working to touch the panel and show the value on the label, values from 0 to 255.
My question is as follows.
When the user drops his finger on the panel.
Case Activity.ACTION_UP
I need to go from the current value to the maximum value which is 255, but this speed should be based on an animation time.
An example:
At this point I am doing the following, when the user drops the panel finger I simply go from the current value to 255. If the user is at 50 I jump from 50 to 255.
I would like to do something like go from 50 to 255 at (x ms time)
I want to show the user something like (in 2000ms for example, 50 to 255 in 2000ms)
50
51
52
...
255
and not simply jump from 50 to 255.
How can I make this calculation based on an animation time?
make a counter, which adds values in an int up to 255 in a time interval X.
Any tips are welcome, I'm very bad at math.
Thanks.