Not sure what it is called in mobile apps... but how you alert a user after button click?

AppDev01AppDev01 Member ✭✭✭

Hi All,

I am Not sure what it is called in mobile apps... but how you alert a user after button click? That the process has been completed.
I think I would like for the after click action to give the user a message that a process is complete and then take them back to the application
start page so they have a sense the something happened after they clicked the button.

So for example the user press the button save this record.

I would like a message to come up saying saving record...and then return to the application's welcome page.

Is this possible?

Best Answer

  • AppDev01AppDev01 ✭✭✭
    Accepted Answer

    Hi All,

    I ended up using await DisplayAlert ("Some Message") I found that after asking this question... Is there a reason not to use this as I see that you all mentioned other items.

    Thanks for all the feedback.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    You could notify them any way you like. Turn a graphic green. Take away the Save button since clearly you've just saved.

    I would like a message to come up saying saving record

    So a popup.
    rg.plugins.popups is a great nuget package for popups that a large number of us.

    Just FYI: What you've described as a process is more 1990's winforms than modern mobile UI expectations.

    Usually you'd see an ActivityIndicator while work is being done.
    Then when the work is done, the UI should update according to the new state.
    For example, as I mentioned you wouldn't see the Save button since there is no longer something to save.

  • LandLuLandLu Member, Xamarin Team Xamurai

    @AppDev01 Usually if we want to notify user, we could use Azure Notification Hubs to send a remote notification to the client. After user click the notificaiton, system will open the corresponding app.
    Refer to this documentation for more details: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/push-notifications/azure

  • JohnHardmanJohnHardman GBUniversity mod
    edited January 4

    @AppDev01 said:
    I would like a message to come up saying saving record...and then return to the application's welcome page.
    Is this possible?

    @ClintStLaurent is correct - normally you'd use an ActivityIndicator whilst the work is being done and then show a different UI state once it is complete (such as hiding or disabling the Save button). However, if you really want to show a message to say something is complete, you can either use a Toast that goes away after a defined period, or a popup that needs user acknowledgement before it closes, or some other combination. There are pros and cons to each. It may even be configurable, so that if the user has particular accessibility requirements then a popup is used, and if they don't a toast is used. There is no one, single answer for all scenarios.

    If you decide to use Toasts, you could try the "Toasts.Forms.Plugin" NuGet from Adam Pedley. I use that in particular scenarios.

    For popups, you could use rg.plugins.popups (as per @ClintStLaurent 's post).

    These are not the only options, but start with these.

  • NMackayNMackay GBInsider, University mod

    You can use Rg.Plugins for toasts too.

  • AppDev01AppDev01 Member ✭✭✭
    Accepted Answer

    Hi All,

    I ended up using await DisplayAlert ("Some Message") I found that after asking this question... Is there a reason not to use this as I see that you all mentioned other items.

    Thanks for all the feedback.

  • JohnHardmanJohnHardman GBUniversity mod

    @NMackay said:
    You can use Rg.Plugins for toasts too.

    True. That came under my "These are not the only options, but start with these" catch-all :-)

  • JohnHardmanJohnHardman GBUniversity mod

    @AppDev01 said:
    I ended up using await DisplayAlert ("Some Message") I found that after asking this question... Is there a reason not to use this as I see that you all mentioned other items.

    As your app grows and as you fine-tune how you want it to look and behave, you are likely to out-grow what DisplayAlert is capable of doing. That might be changing colors and fonts to improve the appearance, adding timeouts so that the alert automatically closes after a certain period, adding images or other views into the alert, etc.

  • NMackayNMackay GBInsider, University mod

    @JohnHardman said:

    @NMackay said:
    You can use Rg.Plugins for toasts too.

    True. That came under my "These are not the only options, but start with these" catch-all :-)

    B) This was the 1st project we used Rg.Plugins for toasts but it seems to handle it well, the latest version allows transparent gesture pass-through to the parent (iOS and Android only) so it's worth a look if your already using that library and you want to reduce nugets.

  • JohnHardmanJohnHardman GBUniversity mod

    @NMackay said:
    This was the 1st project we used Rg.Plugins for toasts but it seems to handle it well, the latest version allows transparent gesture pass-through to the parent (iOS and Android only) so it's worth a look if your already using that library and you want to reduce nugets.

    Yes, it's on my to-do list to migrate existing stuff to Rg.Plugins . Admittedly, quite a long way down the to-do list, but I'll get there eventually :-)

  • AppDev01AppDev01 Member ✭✭✭

    Thanks all.

Sign In or Register to comment.