DroidDialog
index
/storage/sdcard0/sl4a/scripts/DroidUi/DroidDialog.py

dialog wrapper function for UiFacade

 
Modules
       
datetime
warnings

 
Functions
       
Loading(title, message, max=100)
get a Spinner Progress dialog
TITLE - the title of the dialog
MESSAGE - the message of the dialog
MAX - max value (100 by default)
 
the dialog object support these methods
show() - show the dialog
update(value) - set the progress of the dialog to value
dismiss() - dismiss the dialog
Progress(title, message, max=100)
get a Horizontal Progress dialog
TITLE - the title of the dialog
MESSAGE - the message of the dialog
MAX - max value (100 by default)
 
the dialog object support these methods
show() - show the dialog
update(value) - set the progress of the dialog to value
dismiss() - dismiss the dialog
askdate(date=None)
get a date, if DATE is None, using today as default
askfloat(title, message, default=0.0, **kw)
show a dialog to ask for float input.
TITLE - the title of the dialog
MESSAGE - the message of the dialog
DEFAULT - default value of the float (0.0 by default)
KW - same as KW in askstring()
askint(title, message, default=0, **kw)
show a dialog to ask for int input.
TITLE - the title of the dialog
MESSAGE - the message of the dialog
DEFAULT - default value of the int (0 by default)
KW - same as KW in askstring()
askpassword(title, message, default='', **kw)
show a dialog to ask for password input.
TITLE - the title of the dialog
MESSAGE - the message of the dialog
DEFAULT - default value of the password (empty string by default)
KW - same as KW in askstring()
askstring(title, message, default='', **kw)
show a dialog to ask for string input.
TITLE - the title of the dialog
MESSAGE - the message of the dialog
DEFAULT - default value of the string (empty string by default)
KW - the keyword argument, used to set the button text on the dialog
  `yes' - set the YES button text ("Yes" if not set)
  `no' - set the NO button text ("Cancel" if not set)
asktime(time=None)
get a time, if TIME is None, using now as default
NOTE: only hour and minute is supported
askvalue(title, message, value=50, max=100, **kw)
get a value using seekbar
TITLE - the title of the dialog
MESSAGE - the message of the dialog
VALUE - default value (50 by default)
MAX - max value (100 by default)
KW - same as KW in askstring()
askyesno(title, message, **kw)
ask yes or no
RETURN: True on Yes, False on No, or None if cancelled
askyesnocancel(title, message, **kw)
ask yes or no or cancel
RETURN: True on Yes, False on No, or None if cancelled
choose(title, items, **kw)
choose one or more items from ITEMS
RETURN: a tuple of chosen items, or None if cancelled
dialog(title, message, **kw)
The final dialog API
TITLE: dialog title
MESSAGE: dialog body message
you can set `yes', `no' and `cancel' button behaviour with keyword param
value for the keyword can be
1. a string, will be the button text and the result of the dialog
2. a callable object, will be called if the button clicked
3. a list with to two element.
  a. the first element will be the button text.
  b. the second will be called if callable, or the result of the dialog
4. all other situation, the value will be the result of the dialog
info(what)
show information INFO to user
message(title, message, text='OK')
show a message
notify(title, message)
Displays a notification
pick(title, items)
choose one items from ITEMS
RETURN:  the selected item, or None if cancelled
select(title, items, **kw)
select one item from ITEMS
RETURN: the selected item, or None if cancelled
toast = info(what)
show information INFO to user

 
Data
        CANCEL = 'Cancel'
NO = 'No'
NUMBER_DECIMAL = 'numberDecimal'
NUMBER_SIGNED = 'numberSigned'
OK = 'OK'
TEXT = 'text'
TEXT_PASSWORD = 'textPassword'
YES = 'Yes'