Implementing Feature

Single Button Alert Dialog

A single button dialog with the give title, message and button text is displayed.

private void ShowAlertDialogWithSingleButton ()
{
    NPBinding.UI.ShowAlertDialogWithSingleButton(TITLE, MESSAGE, BUTTON_TEXT, (string _buttonPressed)=>{
        Debug.Log("Alert dialog closed");
        Debug.Log("ButtonPressed=" + _buttonPressed);
    });
}

Multiple Button Alert Dialog

This shows a multiple button dialog with the given TITLE, MESSAGE and BUTTON_ARRAY_TEXT. Optionally can provide a callback method to trigger once alert dismisses.

private void ShowAlertDialogWithMultipleButtons ()
{
    string m_title = "Title";
    string m_message = "message";
    string[] m_buttonsArray = new string[] { "Ok", "Cancel"};

    NPBinding.UI.ShowAlertDialogWithMultipleButtons(m_title, m_message, m_buttonsArray, MultipleButtonsAlertClosed); 
}

//Callback gets the button pressed.
private void MultipleButtonsAlertClosed (string _buttonPressed)
{
    Debug.Log("Alert dialog closed");
    Debug.Log("ButtonPressed=" + _buttonPressed);
}


Prompt Dialogs

This provides options to show prompt dialogs with text fields which can be used for login screens or other user input screens. Callback can provide the information user entered.

Place holder text is also possible.

Single Text Field Prompt Dialog - Plain Text & Secured Text
Plain Text
 private void ShowPlainTextPromptDialog ()
    {
        NPBinding.UI.ShowSingleFieldPromptDialogWithPlainText(TITLE, MESSAGE, PLACE_HOLDER_TEXT, BUTTON_ARRAY_TEXT, SingleFieldPromptDialogClosed);
    }
Secured Text
private void ShowSecuredTextPromptDialog ()
{
    NPBinding.UI.ShowSingleFieldPromptDialogWithSecuredText(TITLE, MESSAGE, PLACE_HOLDER_TEXT, BUTTON_ARRAY_TEXT, SingleFieldPromptDialogClosed);
}
Callback implementation
private void SingleFieldPromptDialogClosed (string _buttonPressed, string _input)
{
  Debug.Log("Single field prompt dialog closed");
  Debug.Log("ButtonPressed=" + _buttonPressed);
  Debug.Log("InputText=" + _input);
}
Login Prompt

Login prompt can be used for log-in forms.

private void ShowLoginPromptDialog ()
{
    NPBinding.UI.ShowLoginPromptDialog(TITLE, MESSAGE, USERNAME_PLACE_HOLDER_TEXT, PASSWORD_PLACE_HOLDER_TEXT, BUTTON_ARRAY_TEXT, LoginPromptDialogClosed);
}

//Callbacks
private void LoginPromptDialogClosed (string _buttonPressed, string _username, string _password)
{
    Debug.Log("Login prompt dialog closed");
    Debug.Log("ButtonPressed=" + _buttonPressed);
    Debug.Log("UserName=" + _username);
    Debug.Log("Password=" + _password);
}


Toast

Toast is available only on android currently considering the native platforms design rules. Its possible to choose among short or longer time toasts.


private void ShowShortDurationToast ()
{
    NPBinding.UI.ShowToast (m_message, eToastMessageLength.SHORT);
}

private void ShowLongDurationToast ()
{
    NPBinding.UI.ShowToast (m_message, eToastMessageLength.LONG);
}

results matching ""

    No results matching ""