I am writing the application Aqua Balance . Helps control the amount of water you drink. It is necessary to animate the filling of the bottle when you press the button to drink, draw the amount of water you have drunk as a percentage of the size of the bottle. Now I have 10 pictures there, and they change each other. It suited me until I added the settings to the application (at the moment you can only drink 2 liters, with no choice). After adding the setting, the volume changes, and it is not correct to use old pictures.
Question: tell me in what way it is better to implement it, where to dig, what to read?
I did this, found the size of the bottle ( view.getHeight();
view.getWidth();
), and drew a rectangle as a percentage. But this is not entirely successful, because The size was only after the click, and when it is first opened it does not draw, and it is also necessary to delete and draw again each time, both the bottle and the water, which leads to rubbing up the tips on the buttons.
Thank you in advance.