0

Is there a way to set a progress indicator inside a button (preferably using the native Material Button from Material Components - Android)? There is a video on the website showing exactly what I need, but there's nothing in the documentation about it. Here is a screenshot of the same. Wanted to use it on a login button.

I also though of using a CircularProgressDrawable, which I've used before on a chip (as a chip icon), but in case of a button, I don't think there's a way to centre an icon horizontally on a button (my button width matches parent).

If anyone knows how to do this via either of the two ways, I'd be thankful.

unc0ded
  • 111
  • 7
  • 1
    Is [this](https://stackoverflow.com/questions/38890587/how-to-set-circular-progressbar-inside-button-in-android/38891651) helpful? – tomerpacific Jun 06 '20 at 14:22
  • Well I have looked at solutions like these, but I'd still prefer replacing my text with the loading icon on click (like the video shown). It looks as if there should be an implementation already available if they've showcased it, and frankly it would fit better into my app's design scheme. Thanks anyway – unc0ded Jun 07 '20 at 11:07

0 Answers0