UGrokItApi.UgiUiUtil Class Reference

Overview

UgiUiUtil provides some UI utilities, espcially useful forn Xamarin.Forms apps.

Class Methods

static void HideUI (object o)
 Hide an alert More...
 
static void UpdateAlert (object o, string message)
 Update an alert More...
 
static void UpdateAlertTitle (object o, string title)
 Update an alert title More...
 
static object ShowOk (string title, string message, string okButtonTitle="", Action okDelegate=null)
 Show an alert dialog with ok button More...
 
static object ShowOkCancel (string title, string message, Action okDelegate, string okButtonTitle="", string cancelButtonTitle="", Action cancelDelegate=null)
 Show an alert dialog with ok and cancel buttons More...
 
static object Show3ButtonAlert (string title, string message, string button1Title, string button2Title, string cancelButtonTitle, Action button1Delegate, Action button2Delegate, Action cancelDelegate)
 Show an alert with three buttons More...
 
static object ShowChoices (string[] choices, int initialSelectedIndex, string title, string message, string actionButtonTitle, bool canCancel, Action< int, string > actionDelegate, Action< int, string, Action > confirmationDelegate=null, Action cancelDelegate=null)
 Show UI to choose from a list of choices More...
 
static object ShowMenu (string title, Action cancelDelegate, params MenuTitleAndHandler[] items)
 In a Xamarin.Forms ap, use UgiForms.ShowMenu More...
 
static void ShowToast (string title, string message, double interval=2.0)
 Show a toast More...
 
static object ShowTextInput (string title, string message, string actionButtonTitle, string initialText, bool allowAutoCorrection, string switchText, bool switchInitialState, Action< string, bool > actionDelegate, Action cancelDelegate=null, ShowTextInputShouldEnableForTextDelegate shouldEnableForTextDelegate=null)
 Input a text string from the user More...
 
static void ShowWaiting (string message, Action cancelDelegate=null)
 Show a waiting alert More...
 
static void UpdateWaiting (string message)
 Updat the message in a waiting alert More...
 
static void HideWaiting ()
 Hide the waiting alert More...
 
static void StopInventoryWithCompletionShowWaiting (Action del)
 Stop inventory, displaying a waiting message More...
 
static void StartDisconnectedAlert (Action cancelDelegate)
 Start displaying a "please connect the grokker" alert if the Grokker is not connected More...
 
static void StopDisconnectedAlert ()
 Stop displaying the disconnected dialog More...
 
static object ShowInventoryError (UgiInventory.InventoryResults result, Action del=null)
 Show an error dialog for an inventory error More...
 
static string GetInventoryErrorMessage (UgiInventory.InventoryResults result)
 Get a string describing an inventory error More...
 
static string GetTagAccessErrorMessage (UgiInventory.TagAccessReturnValues result)
 Get a string describing a tag access error More...
 
static object ShowVersionAlert (string title=null, bool showExtraInfo=false)
 Show an alert with information about the app and about the Grokker More...
 

Instance Methods

delegate bool ShowTextInputShouldEnableForTextDelegate (String value)
 Delegate for determining whether to enable the action button within ShowTextInput More...
 

Properties

static int NULL_COLOR [get]
 The NULL color More...
 
static bool UseUGrokItStyleAlerts [get, set]
 Gets or sets whether U Grok It style alerts are used. More...
 
static bool IsDisconnectedAlertActive [get]
 See if the disconnected alert is active. More...
 

Structures

class  MenuTitleAndHandler
 Object passed to ShowMenu More...
 
class  RunnableHelper
 

Instance Method Documentation

◆ HideUI()

static void UGrokItApi.UgiUiUtil.HideUI ( object  o)
inlinestatic

Hide an alert

Parameters
oToken for alert to hide

◆ UpdateAlert()

static void UGrokItApi.UgiUiUtil.UpdateAlert ( object  o,
string  message 
)
inlinestatic

Update an alert

Parameters
oToken for the alert
messageText for the body of the alert

◆ UpdateAlertTitle()

static void UGrokItApi.UgiUiUtil.UpdateAlertTitle ( object  o,
string  title 
)
inlinestatic

Update an alert title

Parameters
oToken for the alert
titleNew title for the alert

◆ ShowOk()

static object UGrokItApi.UgiUiUtil.ShowOk ( string  title,
string  message,
string  okButtonTitle = "",
Action  okDelegate = null 
)
inlinestatic

Show an alert dialog with ok button

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
okButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
okDelegateCode to execute for "ok"

◆ ShowOkCancel()

static object UGrokItApi.UgiUiUtil.ShowOkCancel ( string  title,
string  message,
Action  okDelegate,
string  okButtonTitle = "",
string  cancelButtonTitle = "",
Action  cancelDelegate = null 
)
inlinestatic

Show an alert dialog with ok and cancel buttons

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
okDelegateCode to execute for "ok"
okButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
cancelButtonTitleText for the "cancel" button, or "" for the defualt, or null for no cancel button
cancelDelegateCode to execute for "cancel"

◆ Show3ButtonAlert()

static object UGrokItApi.UgiUiUtil.Show3ButtonAlert ( string  title,
string  message,
string  button1Title,
string  button2Title,
string  cancelButtonTitle,
Action  button1Delegate,
Action  button2Delegate,
Action  cancelDelegate 
)
inlinestatic

Show an alert with three buttons

Returns
Token for the alert dialog
Parameters
titleTitle for the alert
messageText for the body of the alert
button1TitleText for button 1
button2TitleText for button 1
cancelButtonTitleText for the "cancel" button, or "" for the defualt, or nil for no cancel button
button1DelegateCode to execute for button 1
button2DelegateCode to execute for button 2
cancelDelegateCode to execute for "cancel"

◆ ShowChoices()

static object UGrokItApi.UgiUiUtil.ShowChoices ( string []  choices,
int  initialSelectedIndex,
string  title,
string  message,
string  actionButtonTitle,
bool  canCancel,
Action< int, string >  actionDelegate,
Action< int, string, Action >  confirmationDelegate = null,
Action  cancelDelegate = null 
)
inlinestatic

Show UI to choose from a list of choices

Returns
Token for the UI
Parameters
choicesChoices to choose from
initialSelectedIndexChoice to select initially
titleTitle for the alert
messageMessage for the alert
actionButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
canCanceltrue if the user can cancel
actionDelegateCode to execute if the user makes a choice
confirmationDelegateCode to execute to confirm the choice, or null of no confirmation
cancelDelegateCode to execute for "cancel"

◆ ShowMenu()

static object UGrokItApi.UgiUiUtil.ShowMenu ( string  title,
Action  cancelDelegate,
params MenuTitleAndHandler []  items 
)
inlinestatic

In a Xamarin.Forms ap, use UgiForms.ShowMenu

Returns
Token for the UI
Parameters
titleTitle for the menu
cancelDelegateCode to execute for "cancel"
itemsItems for the menu

◆ ShowToast()

static void UGrokItApi.UgiUiUtil.ShowToast ( string  title,
string  message,
double  interval = 2.0 
)
inlinestatic

Show a toast

Parameters
titleTitle for the toast
messageText for the body of the toast
intervalTime to display the toast

◆ ShowTextInputShouldEnableForTextDelegate()

delegate bool UGrokItApi.UgiUiUtil.ShowTextInputShouldEnableForTextDelegate ( String  value)

Delegate for determining whether to enable the action button within ShowTextInput

Returns
true to enable the action button
Parameters
valueText the user has input

◆ ShowTextInput()

static object UGrokItApi.UgiUiUtil.ShowTextInput ( string  title,
string  message,
string  actionButtonTitle,
string  initialText,
bool  allowAutoCorrection,
string  switchText,
bool  switchInitialState,
Action< string, bool >  actionDelegate,
Action  cancelDelegate = null,
ShowTextInputShouldEnableForTextDelegate  shouldEnableForTextDelegate = null 
)
inlinestatic

Input a text string from the user

Returns
Token for the UI
Parameters
titleTitle for the alert
messageMessage for the alert
actionButtonTitleText for the "ok" button, or "" for the defualt, or null for no ok button
initialTextInitial text
allowAutoCorrectiontrue to allow auto-correction
switchTexttext for radio button, or null for no radio button
switchInitialStateinitial state for radio button
actionDelegateCode to execute for "ok"
cancelDelegateCode to execute for "cancel"
shouldEnableForTextDelegateCode to determine if the action button should be enabled

◆ ShowWaiting()

static void UGrokItApi.UgiUiUtil.ShowWaiting ( string  message,
Action  cancelDelegate = null 
)
inlinestatic

Show a waiting alert

Parameters
messageMessage
cancelDelegateCode to execute if the user cancels. If null then no cancel button is shown

◆ UpdateWaiting()

static void UGrokItApi.UgiUiUtil.UpdateWaiting ( string  message)
inlinestatic

Updat the message in a waiting alert

Parameters
messageNew message

◆ HideWaiting()

static void UGrokItApi.UgiUiUtil.HideWaiting ( )
inlinestatic

Hide the waiting alert

◆ StopInventoryWithCompletionShowWaiting()

static void UGrokItApi.UgiUiUtil.StopInventoryWithCompletionShowWaiting ( Action  del)
inlinestatic

Stop inventory, displaying a waiting message

Parameters
delCode to execute after inventory is stopped

◆ StartDisconnectedAlert()

static void UGrokItApi.UgiUiUtil.StartDisconnectedAlert ( Action  cancelDelegate)
inlinestatic

Start displaying a "please connect the grokker" alert if the Grokker is not connected

Parameters
cancelDelegateCode to execute if the user cancels

◆ StopDisconnectedAlert()

static void UGrokItApi.UgiUiUtil.StopDisconnectedAlert ( )
inlinestatic

Stop displaying the disconnected dialog

◆ ShowInventoryError()

static object UGrokItApi.UgiUiUtil.ShowInventoryError ( UgiInventory.InventoryResults  result,
Action  del = null 
)
inlinestatic

Show an error dialog for an inventory error

Parameters
resultThe inventory error
delDelegate to call after alert
Returns
Token for the UI

◆ GetInventoryErrorMessage()

static string UGrokItApi.UgiUiUtil.GetInventoryErrorMessage ( UgiInventory.InventoryResults  result)
inlinestatic

Get a string describing an inventory error

Returns
The inventory error message.
Parameters
resultThe inventory error

◆ GetTagAccessErrorMessage()

static string UGrokItApi.UgiUiUtil.GetTagAccessErrorMessage ( UgiInventory.TagAccessReturnValues  result)
inlinestatic

Get a string describing a tag access error

Returns
The tag access error message.
Parameters
resultThe tag taccess error

◆ ShowVersionAlert()

static object UGrokItApi.UgiUiUtil.ShowVersionAlert ( string  title = null,
bool  showExtraInfo = false 
)
inlinestatic

Show an alert with information about the app and about the Grokker

Returns
Token for the UI
Parameters
titleTitle for the alert, or null to use the app'sname and version
showExtraInfotrue to show debugging information

Property Documentation

◆ NULL_COLOR

int UGrokItApi.UgiUiUtil.NULL_COLOR
staticget

The NULL color

The NULL color

◆ UseUGrokItStyleAlerts

bool UGrokItApi.UgiUiUtil.UseUGrokItStyleAlerts
staticgetset

Gets or sets whether U Grok It style alerts are used.

true if U Grok It style alerts are used

◆ IsDisconnectedAlertActive

bool UGrokItApi.UgiUiUtil.IsDisconnectedAlertActive
staticget

See if the disconnected alert is active.

true if disconnected alert is active; otherwise, false.