How to indicate a button was pushed

RonNYCRonNYC Member ✭✭✭
edited March 3 in Xamarin.Android

I could change the text size or background color (the text is already bold) but....do I need a timer to change it back?

I ask because sometimes when the button push sets off long-running code, the interface looks as if nothing happened.

I've tried using a Toast message but I needed several of them, one after the other. And even then the Toast message often appeared after the code the button push initiated was completed.

I've even used this for a Toast message:

RunOnUiThread(() => Toast.MakeText(this, "Working...", ToastLength.Long).Show());

BUT that sometimes displays the message, sometimes not, but if it does display that happens when the work is done.

Only two buttons can initiate potentially long code operations, perhaps taking several seconds.

I've tried btnXXX.Enabled = false;

But that doesn't seem to work, either. Repeated clicks before the work is done results in new work.

I would like to disable the button until work is done; indicate on the UI that the code is working; and perhaps change the button's look, even briefly to acknowledge it has been clicked.

Sign In or Register to comment.