I want to make a button with a progress bar around it and so that when you press this progress bar, it starts moving when it reaches the end (5 seconds) - the onClick method is executed.

Button example:

enter image description here

In theory, I thought of doing this:

The button itself is an ImageButton to shove a ImageButton in it and somehow start the animation of the gif when pressed. But I am not strong in graphics and in my understanding, to make such a gif is sooo hard;)

Tell me how to do this?

  • one
    You can use a ready-made solution - katso
  • If the task is to make just such a button with smooth animation and beautiful shadows. 1 - layer static image of the button with transparent shadows. It can be done in inkspace without any problems, of course, the programmer is a little long :), but nothing is possible. 2 - layer below the animated strip below the picture. I would draw a strip on canvas through drawable. - Evgeny Karavashkin
  • The task is not exactly the same, or rather not the exact same button to do) But the essence is almost the same, there is a picture - a round button, and around it you need to add a green bar, which will be gray if you do nothing, and when the user holds the button, the bar will start crawl-fill and when it reaches the end - the onClick button will execute. - researcher
  • There is a similar button on the css style . You can twist under him. - Dasur

0