Android Tutorial [B4X] [XUI] Msgbox

Discussion in 'Tutorials & Examples' started by Erel, Oct 19, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    XUI library v1.4 adds support for asynchronous msgbox dialogs.

    The API is simple:

    [​IMG]

    Code:
    xui.MsgboxAsync("Hello""World")
    The dialog is not a modal dialog. The code will not stop.
    MsgboxAsync and Msgbox2Async return an object that can be used as the sender filter parameter in a Wait For call.
    To wait for the dialog to being dismissed:
    Code:
    Wait For (xui.MsgboxAsync("Hello""World")) Msgbox_Result (Result As Int)
    Msgbox2Async provides more options:
    [​IMG] [​IMG] [​IMG]
    Code:
    Dim icon As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "warning.png"60dip60dipTrue)
    Dim sf As Object = xui.Msgbox2Async("Delete file?""Title""Yes""Cancel""No", icon)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Positive Then
       
    Log("Deleted!!!")
    End If
    You can pass Null instead of the image.
    You can pass "" (empty string) to remove buttons.

    Note that the icon parameter is not used in B4i.
     
  2. ivan.tellez

    ivan.tellez Active Member Licensed User

    This is really usefull, iths a great Native replacement for Corwin42's Material dialogs in B4A But cross platform.

    Can you please add more dialogs similar to te ones on Corwins42 lib?

    Specialy Progress dialog to replace ProgressDialogShow, and iHUD And and imputdialog, to avoid custom dialogs

    Thanks
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    It is very simple to make custom dialogs in B4A and B4i. Making generic cross platform dialogs is more complicated.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice