Class: UgiUiUtil

UgiUiUtil()

UI utilities

Constructor

new UgiUiUtil()

Source:

Members

(static, readonly) useUGrokItStyleAlerts :Boolean

true if U Grok It style alert dialogs are being used
Type:
  • Boolean
Source:

Methods

(static) hideUI(o)

Dismiss a UI component shown with one of the showXXX methods
Parameters:
Name Type Description
o The UI dialog to dismiss
Source:

(static) hideWaiting()

Hide "waiting" alert
Source:

(static) setUseUGrokItStyleAlerts(b)

Android - Set whether U Grok It style alert dialogs should be used Has no effect on iOS
Parameters:
Name Type Description
b true if U Grok It style alert dialogs are being used
Source:

(static) show3ButtonAlert(title, message, button1Title, button2Title, cancelButtonTitle, button1Completion, button2Completion, cancelCompletion)

Show an alert with three buttons
Parameters:
Name Type Description
title Title for the alert
message Text for the body of the alert
button1Title Text for button 1
button2Title Text for button 2
cancelButtonTitle Text for the "cancel" button, or "" for the default, or nil for no cancel button
button1Completion Function to execute for button 1
button2Completion Function to execute for button 2
cancelCompletion Function to execute for "cancel"
Source:
Returns:
The alert

(static) showChoices(choices, initialSelectedIndex, title, actionButtonTitle, canCancel, actionCompletion, confirmationCompletion, cancelCompletion)

Show UI to choose from a list of choices
Parameters:
Name Type Description
choices Choices to choose from
initialSelectedIndex Choice to select initially
title Title for the alert
actionButtonTitle Text for the "ok" button, or "" for the default, or nil for no ok button
canCancel true if the user can cancel
actionCompletion Function to execute for "ok" - called with (int index, String name)
confirmationCompletion Function to execute before "ok" - called with (int index, String name), return boolean
cancelCompletion Function to execute for "cancel"
Source:
Returns:
The alert

(static) showInventoryError(result, completion)

Show an alert with a message about an inventory error
Parameters:
Name Type Description
result The error - UgiInventoryDelegate.InventoryCompletedReturnValues.XXX
completion Function to execute when the alert is completed (optional)
Source:

(static) showMenu(title, cancelCompletion, firstTitle, firstHandler)

Show a menu of possible actions.
Parameters:
Name Type Description
title Title for the menu
cancelCompletion Function to execute for "cancel"
firstTitle Title of first menu item
firstHandler Handler for the first menu item (followed by more title, handler pairs)
Source:
Returns:
The alert

(static) showOk(title, message, completion, okButtonTitle)

Show an alert dialog with an ok button
Parameters:
Name Type Description
title Title for the alert
message Text for the body of the alert
completion Function to execute for "ok" (optional)
okButtonTitle Text for the "ok" button, or "" for the default, or null for no ok button (optional)
Source:
Returns:
The alert dialog (for updateAlert or hideUI)

(static) showOkCancel(title, message, okButtonTitle, cancelButtonTitle, completion, cancelCompletion)

Show an alert dialog with ok and cancel buttons
Parameters:
Name Type Description
title Title for the alert
message Text for the body of the alert
okButtonTitle Text for the "ok" button, or "" for the default, or null for no ok button
cancelButtonTitle Text for the "cancel" button, or "" for the default, or null for no cancel button
completion Function to execute for "ok"
cancelCompletion Function to execute for "cancel" (optional)
Source:
Returns:
The alert dialog (for updateAlert or hideUI)

(static) showTagAccessError(title, result, completion)

Show an alert with a message about a tag access error
Parameters:
Name Type Description
title Title for the alert
result The error - UgiInventory.TagAccessReturnValues.XXX
completion Function to execute when the alert is completed (optional)
Source:

(static) showTextInput(title, message, actionButtonTitle, initialText, allowAutoCorrection, actionCompletion, cancelCompletion)

Input a text string from the user
Parameters:
Name Type Description
title Title for the alert
message Message for the alert
actionButtonTitle Text for the "ok" button, or "" for the default, or nil for no ok button
initialText Initial text
allowAutoCorrection YES to allow auto correct
actionCompletion Function to execute for "ok" - called with (String text)
cancelCompletion Function to execute for "cancel"
Source:
Returns:
The alert

(static) showToast(title, message, interval)

Show a "toast" (a temporary message)
Parameters:
Name Type Description
title Title for the toast
message Text for the body of the toast
interval Duration to display the toast
Source:

(static) showVersionAlert(title, showExtraInfo)

Show an alert with version information
Parameters:
Name Type Description
title Title fot the alert (or null to use the app name and version)
showExtraInfo true to display additional (debugging) info
Source:

(static) showWaiting(message, completion)

Show "waiting" alert, call completion if cancelled
Parameters:
Name Type Description
message Text for the body of the alert
completion Block to execute for "cancel" (or null if cancel is not an option)
Source:

(static) startDisconnectedAlert(cancelCompletion)

Show an alert if the Grokker is not connected
Parameters:
Name Type Description
cancelCompletion Function to execute if the user cancels
Source:

(static) startStatusImage(img, displayVersionInfoOnTouch)

Set the 'src' attribute on am node according to the connection and battery state. The should,be 32x32
Parameters:
Name Type Description
img node
displayVersionInfoOnTouch true to display the viersion alert when touched
Source:
Returns:
Token to pass to UgiUiUtil.stopStatusImage

(static) stopDisconnectedAlert()

Stop showing the disconnected alert
Source:

(static) stopInventoryWithCompletionShowWaiting(completion)

Call stop inventory while displaying a waiting dialog
Parameters:
Name Type Description
completion Function to run after inventory is stopped
Source:

(static) stopStatusImage(obj)

Stop a UgiUiUtil.startStatusImage call
Parameters:
Name Type Description
obj Value retuned by UgiUiUtil.startStatusImage()
Source:

(static) stringToHexString(s)

Convert a string to a hex string
Parameters:
Name Type Description
s String to cenvert
Source:
Returns:
hex string

(static) updateAlert(o, message)

Update the message in an alert dialog
Parameters:
Name Type Description
o The UI dialog to update
message Text for the body of the alert dialog
Source:

(static) updateAlertTitle(o, title)

Update the title in an alert dialog
Parameters:
Name Type Description
o The UI dialog to update
title New title for the alert dialog
Source:

(static) updateWaiting(message)

Update the "waiting" alert
Parameters:
Name Type Description
message New message
Source: