0

I am using an array of MaterialButtons in an application. When one of the buttons is clicked, an asynchronous operation triggers. I want to disable all the buttons while the operation is still running so that no further clicks trigger concurrent operations. I know how to disable and re-enable the buttons depending on this operation, but while the operation runs, I want to highlight the button that triggered the operation (while still maintaining it disabled).

What is the best approach to accomplish this? The default behavior of the buttons is to become grey when disabled. Do I need to define custom xml styles that can be swapped when a button gets clicked? I wonder if there is a simpler solution.

JsMartinez
  • 321
  • 1
  • 5
  • 16
  • can you describe with code ? what you have tried ? – Elango Jul 30 '22 at 04:16
  • So far I haven't tried anything since I don't know what is the best approach. As I mentioned, I can disable all the buttons when one of them is clicked, and re-enable them once the async operation is complete. But when buttons are disabled, they show as grey. I would like to leave the button that was click in a highlighted state, but still disabled. – JsMartinez Jul 30 '22 at 04:22
  • check this out https://stackoverflow.com/a/29784211/12709358 and https://stackoverflow.com/a/14684584/12709358 – Elango Jul 30 '22 at 04:37

0 Answers0