com.ugrokit.api.UgiUiUtil Class Reference

Overview


UgiUiUtil is a collection of static UI utilities for showing alert dialogs.

It is used by UgiDefaultConfigurationUi to show UI for configuration

Static Public Member Functions

static int getThemeColorToUse ()
 Color for the currently active UgiUiActivity. More...
 
static int getTextColorOnThemeColorToUse ()
 Color for the currently active UgiUiActivity. More...
 
static int getButtonColorToUse ()
 Color for the currently active UgiUiActivity. More...
 
static int getButtonPressedColorToUse ()
 Color for the currently active UgiUiActivity. More...
 
static int getTextColorOnBackgroundToUse ()
 Color for the currently active UgiUiActivity. More...
 
static View traverseSubviews (View v, TraverseSubviewsCallback callback)
 Traverse all subviews of the given view. More...
 
static Activity getParentActivity (View view)
 Get the parent activity for a view. More...
 
static int lightenColor (int color, double degree)
 Make a color lighter. More...
 
static int darkenColor (int color, double degree)
 Make a color darker. More...
 
static double getColorLuminance (int color)
 Get the perceived luminance of a color. More...
 
static String colorToString (int color)
 Get a string description of a color (mostl;y for debugging) More...
 
static int modifyColorToBeSufficientlyDarkForText (int textColor, int backgroundColor)
 Modify a color to be sufficiently dark (or light) to appear on the given background color. More...
 
static boolean getUseUGrokItStyleAlerts ()
 Get whether U Grok It style alert dialogs are being used. More...
 
static void setUseUGrokItStyleAlerts (boolean b)
 Set whether U Grok It style alert dialogs should be used. More...
 
static Object showCustomAlert (Context context, String title, View view, boolean cancelable, boolean showCloseButton, Runnable closeCompletion)
 
Show an alert with a custom view More...
 
static void hideUI (Object o)
 
Dismiss a UI component shown with one of the showXXX methods More...
 
static void updateAlertTitle (Object o, String title)
 
Update the title in an alert dialog More...
 
static void updateAlert (Object o, String message)
 
Update the message in an alert dialog More...
 
static Object showOkNeutralCancel (Context context, String title, String message, String okButtonTitle, String neutralButtonTitle, String cancelButtonTitle, final Runnable completion, final Runnable neutralCompletion, final Runnable cancelCompletion)
 
Show an alert dialog with ok, neutral and cancel buttons More...
 
static Object showOkCancel (Context context, String title, String message, String okButtonTitle, String cancelButtonTitle, final Runnable completion, final Runnable cancelCompletion)
 
Show an alert dialog with ok and cancel buttons More...
 
static Object showOk (Context context, String title, String message, String okButtonTitle, final Runnable completion)
 
Show an alert dialog with an ok button More...
 
static Object showOk (Context context, String title, String message)
 
Show an alert dialog with an ok button More...
 
static Object showCancel (Context context, String title, String message, final Runnable completion)
 
Show an alert dialog with a cancel button More...
 
static Object showChoices (final Context context, final String[] choices, int initialSelectedIndex, final String title, String message, String actionButtonTitle, boolean canCancel, final ShowChoicesCompletion actionCompletion, final ShowChoicesConfirmationCompletion confirmationCompletion, final Runnable cancelCompletion)
 
Show UI to choose from a list of choices More...
 
static Object showMenu (final Context context, String title, final Runnable cancelCompletion, final MenuTitleAndHandler... items)
 
Display a menu More...
 
static void showToast (final Context context, String title, String message, double interval)
 
Show a "toast" (a temporary message) More...
 
static void showToast (final Context context, String title, String message)
 
Show a "toast" (a temporary message) for the default time More...
 
static Object showTextInput (Context context, String title, String message, String actionButtonTitle, String initialText, int inputType, String switchText, boolean switchInitialValue, final ShowTextInputCompletion actionCompletion, final Runnable cancelCompletion, final ShowTextInputShouldEnableForTextCompletion shouldEnableForTextCompletion)
 
Input a text string from the user More...
 
static void showWaiting (Context context, String message, final Runnable cancelCompletion)
 
Show "waiting" alert dialog, call completion if cancelled More...
 
static void showWaiting (Context context, String message)
 
Show "waiting" alert dialog without cancel More...
 
static void hideWaiting ()
 
Hide "waiting" alert dialog
 
static void updateWaiting (String message)
 Update the message in the waiting dialog. More...
 
static boolean isWaitingShown ()
 See if the waiting alert is shown. More...
 
static void stopInventoryWithCompletionShowWaiting (Context context, final UgiInventory.StopInventoryCompletion completion)
 Stop running inventory, showing a waiting dialog. More...
 
static void stopInventoryWithShownAlert (final Context context, final Object alert, final Runnable completion)
 Stop running inventory, showing a waiting alert if the given alert is dismissed before inventory stops. More...
 
static void startDisconnectedAlert (final Context context, final Runnable cancelCompletion)
 
Start showing a "disconnected, please connect your grokker" dialog if appropriate. More...
 
static void stopDisconnectedAlert ()
 Stop showing disconnected dialog. More...
 
static boolean isDisconnectedAlertActive ()
 See if the disconnected alert is active. More...
 
static Object showInventoryError (Context context, int result)
 
Show an alert if there was an inventory error. More...
 
static Object showInventoryError (Context context, int result, Runnable completion)
 
Show an alert if there was an inventory error. More...
 
static String getTagAccessErrorMessage (UgiInventory.TagAccessReturnValues result)
 Get the error message for a tag access return value. More...
 
static String getInventoryErrorMessage (int result)
 Get the error message for an inventory result. More...
 
static String getBarcodeScanErrorMessage ()
 Get the appropriate error message if barcode scan failed. More...
 
static Object showBarcodeError (Context context, Runnable completion)
 Show an alert with a message after barcode scan failed. More...
 
static Object showVersionAlert (Context context, String title, final boolean showExtraInfo)
 
Show an alert with version information More...
 
static String getStringWithDeviceName (String s)
 Substitute the device name for "PD20" in a string. More...
 

Classes

class  MenuTitleAndHandler
 Information for a menu item. More...
 
interface  ShowChoicesCompletion
 Completion for showChoices() More...
 
interface  ShowChoicesConfirmationCompletion
 Completion for showChoices() More...
 
interface  ShowTextInputCompletion
 Completion for showTextInput() More...
 
interface  ShowTextInputShouldEnableForTextCompletion
 Completion for showTextInput() More...
 
interface  TraverseSubviewsCallback
 Callback type used by traverseSubviews. More...
 

Static Public Attributes

static final int NULL_COLOR = Color.argb(0x45, 0x12, 0x23, 0x34)
 Color to use for "no color".
 
static final int UI_COLOR = Color.rgb(0x44, 0x6b, 0xcd)
 Ugi defaults.
 
static final int DEFAULT_THEME_COLOR = UI_COLOR
 Default color (a constant)
 
static final int DEFAULT_TEXT_COLOR_ON_THEME_COLOR = Color.WHITE
 Default color (a constant)
 
static final int DEFAULT_BUTTON_COLOR = UI_COLOR
 Default color (a constant)
 
static final int DEFAULT_BUTTON_PRESSED_COLOR = Color.BLACK
 Default color (a constant)
 
static final int DEFAULT_TEXT_COLOR_ON_BACKGROUND = Color.BLACK
 Default color (a constant)
 
static int themeColor = DEFAULT_THEME_COLOR
 Default color for the app, defaults to DEFAULT_THEME_COLOR.
 
static int textColorOnThemeColor = DEFAULT_TEXT_COLOR_ON_THEME_COLOR
 Default color for the app, defaults to DEFAULT_TEXT_COLOR_ON_THEME_COLOR.
 
static int buttonColor = DEFAULT_BUTTON_COLOR
 Default color for the app, defaults to DEFAULT_BUTTON_COLOR.
 
static int buttonPressedColor = DEFAULT_BUTTON_PRESSED_COLOR
 Default color for the app, defaults to DEFAULT_BUTTON_PRESSED_COLOR.
 
static int textColorOnBackground = DEFAULT_TEXT_COLOR_ON_BACKGROUND
 Default color for the app, defaults to DEFAULT_TEXT_COLOR_ON_BACKGROUND.
 
static final String DIALOG_MESSAGE_LEFT_JUSTIFY = "@left@"
 Prefix to message string to left justify.
 
static final String DIALOG_MESSAGE_SMALLER_TEXT = "@smaller@"
 Prefix to message string to use smaller text.
 
static final int DEFAULT_INPUT_TYPE = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT
 Default type for showTextInput()
 

Member Function Documentation

◆ getThemeColorToUse()

static int com.ugrokit.api.UgiUiUtil.getThemeColorToUse ( )
static

Color for the currently active UgiUiActivity.

Returns
theme color to use for the current activity

◆ getTextColorOnThemeColorToUse()

static int com.ugrokit.api.UgiUiUtil.getTextColorOnThemeColorToUse ( )
static

Color for the currently active UgiUiActivity.

Returns
text color on theme color to use for the current activity

◆ getButtonColorToUse()

static int com.ugrokit.api.UgiUiUtil.getButtonColorToUse ( )
static

Color for the currently active UgiUiActivity.

Returns
button color to use for the current activity

◆ getButtonPressedColorToUse()

static int com.ugrokit.api.UgiUiUtil.getButtonPressedColorToUse ( )
static

Color for the currently active UgiUiActivity.

Returns
button pressed color to use for the current activity

◆ getTextColorOnBackgroundToUse()

static int com.ugrokit.api.UgiUiUtil.getTextColorOnBackgroundToUse ( )
static

Color for the currently active UgiUiActivity.

Returns
text color to use for the current activity

◆ traverseSubviews()

static View com.ugrokit.api.UgiUiUtil.traverseSubviews ( View  v,
TraverseSubviewsCallback  callback 
)
static

Traverse all subviews of the given view.

Parameters
vView to traverse
callbackCallback to call
Returns
Return value from callback

◆ getParentActivity()

static Activity com.ugrokit.api.UgiUiUtil.getParentActivity ( View  view)
static

Get the parent activity for a view.

Parameters
viewView to get the parent activity of
Returns
The activity

◆ lightenColor()

static int com.ugrokit.api.UgiUiUtil.lightenColor ( int  color,
double  degree 
)
static

Make a color lighter.

Parameters
colorColor to change
degreeDegree to lighten: 0 = white, 1 = no change
Returns
New color

◆ darkenColor()

static int com.ugrokit.api.UgiUiUtil.darkenColor ( int  color,
double  degree 
)
static

Make a color darker.

Parameters
colorColor to change
degreeDegree to darken: 0 = black, 1 = no change
Returns
New color

◆ getColorLuminance()

static double com.ugrokit.api.UgiUiUtil.getColorLuminance ( int  color)
static

Get the perceived luminance of a color.

Parameters
colorThe color to get the luminance of
Returns
Luminance (between 0 and 1)

◆ colorToString()

static String com.ugrokit.api.UgiUiUtil.colorToString ( int  color)
static

Get a string description of a color (mostl;y for debugging)

Parameters
colorThe color
Returns
String description

◆ modifyColorToBeSufficientlyDarkForText()

static int com.ugrokit.api.UgiUiUtil.modifyColorToBeSufficientlyDarkForText ( int  textColor,
int  backgroundColor 
)
static

Modify a color to be sufficiently dark (or light) to appear on the given background color.

Parameters
textColortext color to modify, if needed
backgroundColorbackground color that the text will appear on
Returns
modified text color

◆ getUseUGrokItStyleAlerts()

static boolean com.ugrokit.api.UgiUiUtil.getUseUGrokItStyleAlerts ( )
static

Get whether U Grok It style alert dialogs are being used.

Returns
true if U Grok It style alert dialogs are being used

◆ setUseUGrokItStyleAlerts()

static void com.ugrokit.api.UgiUiUtil.setUseUGrokItStyleAlerts ( boolean  b)
static

Set whether U Grok It style alert dialogs should be used.

Parameters
btrue if U Grok It style alert dialogs are being used

◆ showCustomAlert()

static Object com.ugrokit.api.UgiUiUtil.showCustomAlert ( Context  context,
String  title,
View  view,
boolean  cancelable,
boolean  showCloseButton,
Runnable  closeCompletion 
)
static


Show an alert with a custom view

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
viewCustom view
cancelabletrue ifthe alert can be cancelled
showCloseButtontrue to show a close button (X)
closeCompletionBlock to execute when the alert closes
Returns
The alert dialog (for updateAlert or hideUI)

◆ hideUI()

static void com.ugrokit.api.UgiUiUtil.hideUI ( Object  o)
static


Dismiss a UI component shown with one of the showXXX methods

Parameters
oThe UI dialog to dismiss

◆ updateAlertTitle()

static void com.ugrokit.api.UgiUiUtil.updateAlertTitle ( Object  o,
String  title 
)
static


Update the title in an alert dialog

Parameters
oThe alert to update
titleNew title for the alert dialog

◆ updateAlert()

static void com.ugrokit.api.UgiUiUtil.updateAlert ( Object  o,
String  message 
)
static


Update the message in an alert dialog

Parameters
oThe alert to update
messageText for the body of the alert dialog

◆ showOkNeutralCancel()

static Object com.ugrokit.api.UgiUiUtil.showOkNeutralCancel ( Context  context,
String  title,
String  message,
String  okButtonTitle,
String  neutralButtonTitle,
String  cancelButtonTitle,
final Runnable  completion,
final Runnable  neutralCompletion,
final Runnable  cancelCompletion 
)
static


Show an alert dialog with ok, neutral and cancel buttons

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
messageText for the body of the alert
okButtonTitleText for the "ok" button, or "" for the default, or nil for no ok button
neutralButtonTitleText for the neutral button, or null for no ok button
cancelButtonTitleText for the "cancel" button, or "" for the default, or null for no cancel button
completionBlock to execute for "ok"
neutralCompletionBlock to execute for neutral
cancelCompletionBlock to execute for "cancel"
Returns
The alert dialog (for updateAlert or hideUI)

◆ showOkCancel()

static Object com.ugrokit.api.UgiUiUtil.showOkCancel ( Context  context,
String  title,
String  message,
String  okButtonTitle,
String  cancelButtonTitle,
final Runnable  completion,
final Runnable  cancelCompletion 
)
static


Show an alert dialog with ok and cancel buttons

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
messageText for the body of the alert
okButtonTitleText for the "ok" button, or "" for the default, or null for no ok button
cancelButtonTitleText for the "cancel" button, or "" for the default, or null for no cancel button
completionBlock to execute for "ok"
cancelCompletionBlock to execute for "cancel"
Returns
The alert dialog (for updateAlert or hideUI)

◆ showOk() [1/2]

static Object com.ugrokit.api.UgiUiUtil.showOk ( Context  context,
String  title,
String  message,
String  okButtonTitle,
final Runnable  completion 
)
static


Show an alert dialog with an ok button

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
messageText for the body of the alert
okButtonTitleText for the "ok" button, or "" for the default, or null for no ok button
completionBlock to execute for "ok"
Returns
The alert dialog (for updateAlert or hideUI)

◆ showOk() [2/2]

static Object com.ugrokit.api.UgiUiUtil.showOk ( Context  context,
String  title,
String  message 
)
static


Show an alert dialog with an ok button

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
messageText for the body of the alert
Returns
The alert dialog (for updateAlert or hideUI)

◆ showCancel()

static Object com.ugrokit.api.UgiUiUtil.showCancel ( Context  context,
String  title,
String  message,
final Runnable  completion 
)
static


Show an alert dialog with a cancel button

Parameters
contextActivity to show to alert dialog on
titleTitle for the alert
messageText for the body of the alert
completionBlock to execute for "cancel"
Returns
The alert dialog (for updateAlert or hideUI)

◆ showChoices()

static Object com.ugrokit.api.UgiUiUtil.showChoices ( final Context  context,
final String []  choices,
int  initialSelectedIndex,
final String  title,
String  message,
String  actionButtonTitle,
boolean  canCancel,
final ShowChoicesCompletion  actionCompletion,
final ShowChoicesConfirmationCompletion  confirmationCompletion,
final Runnable  cancelCompletion 
)
static


Show UI to choose from a list of choices

Parameters
contextcontext to show to alert dialog on
choicesChoices to choose from
initialSelectedIndexChoice to select initially
titleTitle for the alert
messageText for the body of the alert
actionButtonTitleText for the "ok" button, or "" for the default, or null for no ok button
canCanceltrue if the user can cancel
actionCompletionBlock to execute for "ok"
confirmationCompletionBlock to execute to confirm the choice, or null of no confirmation
cancelCompletionBlock to execute for "cancel"
Returns
The alert dialog (for updateAlert or hideUI)

◆ showMenu()

static Object com.ugrokit.api.UgiUiUtil.showMenu ( final Context  context,
String  title,
final Runnable  cancelCompletion,
final MenuTitleAndHandler...  items 
)
static


Display a menu

Parameters
contextcontext to show to alert dialog on
titleTitle for the alert
cancelCompletionBlock to execute for "cancel"
itemsmenu items
Returns
The alert dialog (for updateAlert or hideUI)

◆ showToast() [1/2]

static void com.ugrokit.api.UgiUiUtil.showToast ( final Context  context,
String  title,
String  message,
double  interval 
)
static


Show a "toast" (a temporary message)

Parameters
contextcontext to show to alert dialog on
titleTitle for the toast
messageText for the body of the toast
intervalDuration to display the toast

◆ showToast() [2/2]

static void com.ugrokit.api.UgiUiUtil.showToast ( final Context  context,
String  title,
String  message 
)
static


Show a "toast" (a temporary message) for the default time

Parameters
contextcontext to show to alert dialog on
titleTitle for the toast
messageText for the body of the toast

◆ showTextInput()

static Object com.ugrokit.api.UgiUiUtil.showTextInput ( Context  context,
String  title,
String  message,
String  actionButtonTitle,
String  initialText,
int  inputType,
String  switchText,
boolean  switchInitialValue,
final ShowTextInputCompletion  actionCompletion,
final Runnable  cancelCompletion,
final ShowTextInputShouldEnableForTextCompletion  shouldEnableForTextCompletion 
)
static


Input a text string from the user

Parameters
contextcontext to show to alert dialog on
titleTitle for the alert
messageMessage for the alert
actionButtonTitleText for the "ok" button, or "" for the default, or null for no ok button
initialTextInitial text
inputTypeType of text input: android.text.InputType.XXX
switchTextText for an on/off switch (if null then no switch)
switchInitialValueInitial value for the switch
actionCompletionBlock to execute for "ok"
cancelCompletionBlock to execute for "cancel"
shouldEnableForTextCompletionCode to determine whether the action button should be enabled
Returns
The alert dialog (for updateAlert or hideUI)

◆ showWaiting() [1/2]

static void com.ugrokit.api.UgiUiUtil.showWaiting ( Context  context,
String  message,
final Runnable  cancelCompletion 
)
static


Show "waiting" alert dialog, call completion if cancelled

Parameters
contextcontext to show to alert dialog on
messageText for the body of the alert dialog
cancelCompletionBlock to execute for "cancel" (or null if cancel is not an option)

◆ showWaiting() [2/2]

static void com.ugrokit.api.UgiUiUtil.showWaiting ( Context  context,
String  message 
)
static


Show "waiting" alert dialog without cancel

Parameters
contextcontext to show to alert dialog on
messageText for the body of the alert dialog

◆ updateWaiting()

static void com.ugrokit.api.UgiUiUtil.updateWaiting ( String  message)
static

Update the message in the waiting dialog.

Parameters
messageNew message

◆ isWaitingShown()

static boolean com.ugrokit.api.UgiUiUtil.isWaitingShown ( )
static

See if the waiting alert is shown.

Returns
true is waiting is shown

◆ stopInventoryWithCompletionShowWaiting()

static void com.ugrokit.api.UgiUiUtil.stopInventoryWithCompletionShowWaiting ( Context  context,
final UgiInventory.StopInventoryCompletion  completion 
)
static

Stop running inventory, showing a waiting dialog.

Parameters
contextContext to show waiting alert on
completionCompletion to run after inventory stops

◆ stopInventoryWithShownAlert()

static void com.ugrokit.api.UgiUiUtil.stopInventoryWithShownAlert ( final Context  context,
final Object  alert,
final Runnable  completion 
)
static

Stop running inventory, showing a waiting alert if the given alert is dismissed before inventory stops.

Parameters
contextContext to show waiting alert on
alertAlter being shown
completionCompletion to run after inventory stops and the alert is dismissed

◆ startDisconnectedAlert()

static void com.ugrokit.api.UgiUiUtil.startDisconnectedAlert ( final Context  context,
final Runnable  cancelCompletion 
)
static


Start showing a "disconnected, please connect your grokker" dialog if appropriate.

Normally called just after calling startInventory()

Parameters
contextcontext to show to alert dialog on
cancelCompletionCompletion to call if user cancels

◆ stopDisconnectedAlert()

static void com.ugrokit.api.UgiUiUtil.stopDisconnectedAlert ( )
static

Stop showing disconnected dialog.

Normally called just before calling stopInventory()

◆ isDisconnectedAlertActive()

static boolean com.ugrokit.api.UgiUiUtil.isDisconnectedAlertActive ( )
static

See if the disconnected alert is active.

Returns
true if disconnected alert is active

◆ showInventoryError() [1/2]

static Object com.ugrokit.api.UgiUiUtil.showInventoryError ( Context  context,
int  result 
)
static


Show an alert if there was an inventory error.

Parameters
contextcontext to show to alert dialog on
resultResult passed to inventoryDidStop
Returns
The alert dialog (for updateAlert or hideUI)

◆ showInventoryError() [2/2]

static Object com.ugrokit.api.UgiUiUtil.showInventoryError ( Context  context,
int  result,
Runnable  completion 
)
static


Show an alert if there was an inventory error.

Parameters
contextcontext to show to alert dialog on
resultResult passed to inventoryDidStop
completionCode to run after the alert is dismissed
Returns
The alert dialog (for updateAlert or hideUI)

◆ getTagAccessErrorMessage()

static String com.ugrokit.api.UgiUiUtil.getTagAccessErrorMessage ( UgiInventory.TagAccessReturnValues  result)
static

Get the error message for a tag access return value.

Parameters
resultResult passed to completion for readTag, lockUnlockTag, or others
Returns
Error message, or null if no error

◆ getInventoryErrorMessage()

static String com.ugrokit.api.UgiUiUtil.getInventoryErrorMessage ( int  result)
static

Get the error message for an inventory result.

Parameters
resultResult passed to inventoryDidStop
Returns
Error message, or null if no error

◆ getBarcodeScanErrorMessage()

static String com.ugrokit.api.UgiUiUtil.getBarcodeScanErrorMessage ( )
static

Get the appropriate error message if barcode scan failed.

Returns
Error message

◆ showBarcodeError()

static Object com.ugrokit.api.UgiUiUtil.showBarcodeError ( Context  context,
Runnable  completion 
)
static

Show an alert with a message after barcode scan failed.

Parameters
contextcontext to show to alert dialog on
completionBlock to execute when the alert is completed
Returns
The alert dialog (for updateAlert or hideUI)

◆ showVersionAlert()

static Object com.ugrokit.api.UgiUiUtil.showVersionAlert ( Context  context,
String  title,
final boolean  showExtraInfo 
)
static


Show an alert with version information

Parameters
contextContext to show to alert dialog on
titleTitle, no nulkl to use app's name and version
showExtraInfotrue to show debugging info
Returns
The alert dialog (for updateAlert or hideUI)

◆ getStringWithDeviceName()

static String com.ugrokit.api.UgiUiUtil.getStringWithDeviceName ( String  s)
static

Substitute the device name for "PD20" in a string.

Parameters
sstring
Returns
string with substitution
com.ugrokit.api.UgiUiUtil.ShowTextInputShouldEnableForTextCompletion Interface Reference

Overview

Completion for showTextInput()

Public Member Functions

boolean exec (String value)
 Callback to see if the action button should be enabled. More...
 

Member Function Documentation

◆ exec()

boolean com.ugrokit.api.UgiUiUtil.ShowTextInputShouldEnableForTextCompletion.exec ( String  value)

Callback to see if the action button should be enabled.

Parameters
valuetext
Returns
true to enable
com.ugrokit.api.UgiUiUtil.MenuTitleAndHandler Class Reference

Overview

Information for a menu item.

Public Member Functions

 MenuTitleAndHandler (String t, Runnable h)
 Create a menu item. More...
 

Constructor & Destructor Documentation

◆ MenuTitleAndHandler()

com.ugrokit.api.UgiUiUtil.MenuTitleAndHandler.MenuTitleAndHandler ( String  t,
Runnable  h 
)

Create a menu item.

Parameters
tTitle text
hHandler
com.ugrokit.api.UgiUiUtil.ShowChoicesCompletion Interface Reference

Overview

Completion for showChoices()

Public Member Functions

void exec (int choiceIndex, String choice)
 Completion method for showChoices() More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiUiUtil.ShowChoicesCompletion.exec ( int  choiceIndex,
String  choice 
)

Completion method for showChoices()

Parameters
choiceIndexIndex of the choice chosen
choiceThe choice chosen
com.ugrokit.api.UgiUiUtil.ShowChoicesConfirmationCompletion Interface Reference

Overview

Completion for showChoices()

Public Member Functions

void exec (int choiceIndex, String choice, Runnable completion)
 Completion method for showChoices() More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiUiUtil.ShowChoicesConfirmationCompletion.exec ( int  choiceIndex,
String  choice,
Runnable  completion 
)

Completion method for showChoices()

Parameters
choiceIndexIndex of the choice chosen
choiceThe choice chosen
completionCode to run if confirmed
com.ugrokit.api.UgiUiUtil.TraverseSubviewsCallback Interface Reference

Overview

Callback type used by traverseSubviews.

Public Member Functions

View exec (View v)
 Callback function for traversing a single view. More...
 

Member Function Documentation

◆ exec()

View com.ugrokit.api.UgiUiUtil.TraverseSubviewsCallback.exec ( View  v)

Callback function for traversing a single view.

Parameters
vView being traversed
Returns
If non-null, abort traversal and return this View
com.ugrokit.api.UgiUiUtil.ShowTextInputCompletion Interface Reference

Overview

Completion for showTextInput()

Public Member Functions

void exec (String value, boolean switchValue)
 Callback after text is entered. More...
 

Member Function Documentation

◆ exec()

void com.ugrokit.api.UgiUiUtil.ShowTextInputCompletion.exec ( String  value,
boolean  switchValue 
)

Callback after text is entered.

Parameters
valuetext
switchValuevalue of switch (or false if no switch)