|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Window
danger.ui.DialogWindow
public class DialogWindow
Standard dialog window.
This window class has the standard look and feel of dialog windows, including the title, frame, and frame buttons.
| Field Summary | |
|---|---|
static int |
APP_ALERT_STYLE
Constant to be used with setWindowStyle(int) or
a constructor. |
static int |
APP_DIALOG_STYLE
Constant to be used with setWindowStyle(int) or
a constructor. |
static int |
BOTTOM_POSITION1
Specifies the bottom rightmost frame button position. |
static int |
BOTTOM_POSITION2
Specifies the bottom middle frame button position. |
static int |
BOTTOM_POSITION3
Specifies the bottom leftmost frame button position. |
protected static int |
BUTTON_HEIGHT
Deprecated. For internal use only. |
protected boolean |
m_autoCenter
Deprecated. Use setAutoCenter(boolean) instead. |
protected int |
m_bottomBorder
Deprecated. Use setBorders(int, int, int, int) instead. |
protected int |
m_leftBorder
Deprecated. Use setBorders(int, int, int, int) instead. |
protected int |
m_rightBorder
Deprecated. Use setBorders(int, int, int, int) instead. |
protected RingToneObject |
m_showTone
Deprecated. Use setShowTone(danger.audio.RingToneObject) instead. |
protected int |
m_showToneID
Deprecated. Use setShowTone(int) instead. |
protected Alarm |
m_toneAlarm
Deprecated. For internal use only. |
protected int |
m_topBorder
Deprecated. Use setBorders(int, int, int, int) instead. |
protected boolean |
mAutoSizeHeight
Deprecated. Use setAutoSize(boolean) or setAutoSizeHeight(boolean) instead. |
protected boolean |
mAutoSizeWidth
Deprecated. Use setAutoSize(boolean) or setAutoSizeWidth(boolean) instead. |
protected static int |
MAX_BOTTOM_BUTTONS
Deprecated. For internal use only. |
protected static int |
MAX_BUTTONS
Deprecated. For internal use only. |
protected Event |
mBackEvent
Deprecated. Use setBackEvent(danger.app.Event) instead. |
protected int[] |
mButtonIDs
Deprecated. For internal use only. |
protected Button[] |
mButtons
Deprecated. For internal use only. |
protected Event |
mCancelEvent
Deprecated. Use setCancelButtonEvent(danger.app.Event) instead. |
protected boolean |
mCenterTitle
Deprecated. Use setCenterTitle(boolean) instead. |
protected Button |
mDefaultButton
Deprecated. Use setDefaultFrameButton(Button) instead. |
protected int |
mDefaultButtonPosition
Deprecated. Use setDefaultFrameButton(int) instead. |
protected boolean[] |
mHideOnButton
Deprecated. Use setHideOnButtonEvent(boolean),
setHideOnButtonWithID(int,boolean) or
setHideOnButtonWithPosition(int,boolean) instead. |
protected boolean |
mLayoutButtonsVertically
Deprecated. Use setLayoutBottomFrameButtonsVertically(boolean) instead. |
protected Listener |
mListener
Deprecated. Use setListener(danger.app.Listener) instead. |
protected boolean |
mNeedToAddBottomFrameButtons
Deprecated. For internal use only. |
protected boolean |
mNeedToAddTopFrameButtons
Deprecated. For internal use only. |
protected boolean |
mRegisteredForKeyGuardEvent
Deprecated. For internal use only. |
protected int[] |
mShortcutModifiers
Deprecated. For internal use only. |
protected char[] |
mShortcuts
Deprecated. For internal use only. |
static int |
SHOW_STATE_HIDDEN
Constant returned by getShowState(). |
static int |
SHOW_STATE_SHOWING
Constant returned by getShowState(). |
static int |
SHOW_STATE_VISIBLE
Constant returned by getShowState(). |
static int |
SYSTEM_ALERT_TYPE_ALARM
Constant to be used with show(int). |
static int |
SYSTEM_ALERT_TYPE_CONTROL
Constant to be used with show(int). |
static int |
SYSTEM_ALERT_TYPE_GENERAL
Constant to be used with show(int). |
static int |
SYSTEM_ALERT_TYPE_INCOMING_CALL
Constant to be used with show(int). |
static int |
SYSTEM_ALERT_TYPE_MISSED_CALL
Constant to be used with show(int). |
static int |
SYSTEM_ALERT_TYPE_PERSISTENT_CONTROL
Constant to be used with show(int). |
static int |
SYSTEM_DIALOG_STYLE
Constant to be used with setWindowStyle(int) or
a constructor. |
static int |
SYSTEM_ERROR_STYLE
Constant to be used with setWindowStyle(int) or
a constructor. |
static int |
TOP_POSITION1
Specifies the top rightmost frame button position. |
static int |
TOP_POSITION2
Specifies the top leftmost frame button position. |
| Fields inherited from class danger.ui.Window |
|---|
mBusyPaintCount, mDefaultListener, STATE_AUTO_HIDE_IF_IDLE, STATE_DROP_ORPHANED_EVENTS, STATE_FULLSCREEN, STATE_UNUSED1 |
| Constructor Summary | |
|---|---|
DialogWindow()
Construct an instance. |
|
DialogWindow(boolean showCancel)
Construct an instance. |
|
DialogWindow(CharSequence inTitle)
Construct an instance. |
|
DialogWindow(CharSequence inTitle,
int windowStyle)
Construct an instance. |
|
DialogWindow(CharSequence inTitle,
int windowStyle,
boolean showCancel)
Construct an instance. |
|
DialogWindow(String inTitle)
Construct an instance. |
|
DialogWindow(String inTitle,
int windowStyle)
Construct an instance. |
|
DialogWindow(String inTitle,
int windowStyle,
boolean showCancel)
Construct an instance. |
|
| Method Summary | |
|---|---|
protected void |
activateFrameButton(int position)
Activates the frame button with the given position. |
Button |
addBottomFrameButton(CharSequence buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
|
Button |
addBottomFrameButton(String buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
Add a button to the dialog window. |
protected void |
addBottomFrameButtons()
Add the bottom frame buttons to the window. |
Button |
addFrameButton(int position,
CharSequence buttonStr,
int flags,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int id)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int flags,
int eventType,
int data,
Object arg,
char shortcut)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int flags,
int eventType,
int data,
Object arg,
char shortcut,
int id)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int eventType,
int data,
Object arg)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int eventType,
int data,
Object arg,
char shortcut,
int id)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
int eventType,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
|
Button |
addFrameButton(int position,
CharSequence buttonStr,
Listener eventListener,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
|
Button |
addFrameButton(int position,
String buttonStr,
int flags,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int id)
Add a frame button to the dialog. |
Button |
addFrameButton(int position,
String buttonStr,
int flags,
int eventType,
int data,
Object arg,
char shortcut)
Add a button to the dialog window. |
Button |
addFrameButton(int position,
String buttonStr,
int flags,
int eventType,
int data,
Object arg,
char shortcut,
int id)
|
Button |
addFrameButton(int position,
String buttonStr,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
|
Button |
addFrameButton(int position,
String buttonStr,
int eventType,
int data,
Object arg)
|
Button |
addFrameButton(int position,
String buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
|
Button |
addFrameButton(int position,
String buttonStr,
int eventType,
int data,
Object arg,
char shortcut,
int id)
|
Button |
addFrameButton(int position,
String buttonStr,
int eventType,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
|
Button |
addFrameButton(int position,
String buttonStr,
Listener eventListener,
int eventType,
int eventWhat,
int data,
Object arg,
char shortcut,
int shortcutModifiers,
int id)
Add a button to the dialog window. |
Button |
addTopFrameButton(CharSequence buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
|
Button |
addTopFrameButton(String buttonStr,
int eventType,
int data,
Object arg,
char shortcut)
Add a top frame button to the dialog. |
protected void |
addTopFrameButtons()
Add the top frame buttons to the window. |
boolean |
blocksChooser()
Whether the window blocks from going to the chooser Some applications, such as security/passcode lock and registration block from going to the chooser when the JUMP button is pressed. |
protected int |
calcBottom()
This is called automatically to determine positions of vertical frame buttons. |
protected int |
convertShortcutKeyToButtonIndex(char key,
Event event)
This is called automatically to determine if a shortcut key matches a shortcut for a frame button. |
int |
convertShortcutKeyToButtonIndex(Event e)
This is called automatically to determine if a shortcut key matches a shortcut for a frame button. |
void |
disableBottomRightButtonOnEmptyField(TextField textField)
Specifies that the bottom right frame button should be disabled whenever the specified text field is empty. |
void |
disableButtonOnEmptyField(int buttonID,
int fieldID)
Specifies that the specified button should be disabled whenever the specified text field is empty. |
protected void |
drawDialogStyleFrame(Pen p,
int windowStyle)
Draw the frame for the dialog window. |
boolean |
eventKeyUp(char c,
Event event)
Processes key releases directed at this container. |
boolean |
eventShortcut(char shortcut,
Event event)
Handles shortcuts for frame buttons. |
boolean |
eventWidgetDown(int widget,
Event event)
Handle a button down event. |
boolean |
eventWidgetUp(int widget,
Event event)
Handle the release of a device widget |
protected Button |
getCancelButton()
This method will return the cancel button, if there is any. |
View |
getChildWithID(int id)
Get the child view with the given id. |
Rect |
getContentRect()
Get the content rect Returns the content rect of the dialog, which does not include the top or bottom frames (or frame buttons). |
Button |
getDefaultFrameButton()
Get the frame button with initial focus. |
View |
getDescendantWithID(int id)
Get the descendant view with the given id. |
protected Button |
getFrameButtonWithID(int id)
Get the frame button with the given id. |
int |
getNumTopFrameButtons()
|
int |
getShowState()
Get the show state. |
Bitmap |
getSleepScreenImage()
|
String |
getSleepScreenMessage()
Deprecated. Use getSleepScreenMessageCharSequence instead |
CharSequence |
getSleepScreenMessageCharSequence()
|
String |
getTitle()
Obtain the title of the window Obtains the title of the window that was set via a constructor or by a call to setTitle(java.lang.String) |
int |
getTitleBarHeight()
Get the height of the title bar Currently, this value is a constant. |
protected static Font |
getTitleFont()
Get the font being used for the dialog title. |
CharSequence |
getTitleSequence()
Obtain the title of the window Obtains the title of the window that was set via a constructor or by a call to setTitle(java.lang.String). |
int |
getWidthToFitTitle()
Get the dialog width that will fit the title exactly, accounting for any top frame buttons. |
int |
getWindowStyle()
|
boolean |
handleButtonShortcut(char shortcut,
Event event)
Handle shortcuts for buttons in the container. |
protected boolean |
handleFrameButtonShortcut(int position)
Handle a frame button shortcut This method is called to handle a shortcut for a particular frame button. |
boolean |
handleShortcutKey(Event e)
Handle a shortcut key event. |
boolean |
hasVisibleFrameButtons()
Determine whether this dialog has any visible frame buttons. |
void |
hide()
Hide the dialog window. |
protected void |
layoutTopFrameButtons()
This is called automatically to position the top frame buttons in the dialog. |
void |
paint(Pen pen)
Draw the contents of this View. |
protected void |
positionDialog()
This method is called to position the dialog. |
boolean |
receiveEvent(Event e)
Entry point for event processing. |
void |
reflowFrameButtons()
|
void |
removeAllChildren()
Remove all child views. |
void |
removeFrameButtonWithID(int id)
Remove a frame button. |
void |
setAutoCenter(boolean autoCenter)
Use this method to specify whether the dialog should be automatically centered in positionDialog(). |
void |
setAutoSize(boolean doAutoSize)
Specify whether the window should be automatically resized. |
void |
setAutoSizeHeight(boolean doAutoSize)
Specify whether the window's height should be set automatically. |
void |
setAutoSizeWidth(boolean doAutoSize)
Specify whether the window's width should be set automatically. |
void |
setBackEvent(Event e)
Specifies an event to send when the BACK button is pressed. |
void |
setBorders(int inLeft,
int inTop,
int inRight,
int inBottom)
Set the width of the borders. |
void |
setCancelButtonEvent(Event e)
Specifies the event to be sent when the user selects the Cancel button. |
void |
setCenterTitle(boolean center)
Set a flag that tells the dialog to center its title. |
void |
setContentSize(int width,
int height)
Resize the window Sets the size of the window such that the content rect is the given size. |
void |
setDefaultFrameButton(Button button)
Set the default frame button. |
void |
setDefaultFrameButton(int which)
Set the default frame button. |
protected void |
setDrawBottomFrame(boolean drawFrame)
Specify whether to draw the bottom frame of the dialog. |
void |
setEventForControlWithID(int id,
Event newEvent)
Set the event for the control with the given id. |
protected boolean |
setEventForFrameButtonWithID(int id,
Event newEvent)
Set the event for the frame button with the given id. |
void |
setFocusedChild(View inNewFocus)
Convenience method which simply calls setFocusedChild(newFocus,
true). |
void |
setFocusedDescendant(View inNewFocus,
boolean inFromAbove)
Set the focus for the container to be the child which is, or which has as a descendant, the given view. |
void |
setForceDrawBottomFrame(boolean drawFrame)
Specify whether the bottom frame should be drawn, even if there's nothing in the frame. |
void |
setFrameButtonShortcut(int position,
char shortcut)
Set the shortcut for a frame button The shortcut will not display or require any modifier keys (MENU, ALT, or SHIFT). |
void |
setFrameButtonShortcut(int position,
char shortcut,
int modifiers)
Set the shortcut for a frame button |
void |
setHideOnButtonEvent(boolean hide)
Use this method to specify whether the dialog should be automatically hidden when the user selects a frame button. |
void |
setHideOnButtonWithID(int id,
boolean hide)
Use this method to specify whether the dialog should be automatically hidden when the user selects the frame button with the specified id. |
void |
setHideOnButtonWithPosition(int position,
boolean hide)
Use this method to specify whether the dialog should be automatically hidden when the user selects the frame button with the specified position. |
void |
setLayoutBottomFrameButtonsVertically(boolean flag)
Layout buttons vertically instead of horizontally. |
void |
setListener(Listener inListener)
Set the listener for the dialog. |
void |
setNoDefaultFrameButton()
Specify that no frame button should be focused when the dialog is first displayed. |
void |
setShowCancel(boolean showCancel)
Specify whether a cancel button should be displayed. |
void |
setShowTone(int resourceID)
Specify a tone to play while the dialog is showing. |
void |
setShowTone(RingToneObject tone)
Specify a tone to play while the dialog is showing. |
void |
setSize(int width,
int height)
Set the size of the dialog. |
void |
setSleepScreenMessage(CharSequence message)
Set the message to display on the sleep screen when this dialog is up while the device is in keyguard mode |
void |
setSleepScreenMessage(String message)
Set the message to display on the sleep screen when this dialog is up while the device is in keyguard mode |
void |
setTitle(CharSequence inTitle)
Specifies the title of the window Sets the title to appear in the upper left of the window. |
void |
setTitle(String inTitle)
Specifies the title of the window Sets the title to appear in the upper left of the window. |
void |
setWidthToFitTitle()
Resize the window to fit the title This method changes the width of the dialog to fit the title exactly, accounting for any top frame buttons. |
void |
setWindowStyle(int windowStyle)
Set the window style. |
void |
show()
Show the dialog. |
void |
show(int alertType)
Show the dialog. |
void |
show(int alertType,
boolean withPendingSound)
Show the dialog. |
protected void |
showInternal()
Actually shows the dialog. |
void |
snapToChildren(int inLeft,
int inTop,
int inRight,
int inBottom)
Resize the dialog to fit the children, with the given gaps. |
protected void |
startShowTone()
Starts playing the tone specified with setShowTone(danger.audio.RingToneObject). |
protected void |
stopShowTone()
Stops playing the tone specified with setShowTone(danger.audio.RingToneObject). |
protected void |
updateBottomButtonWidths()
This is called automatically to set the width of the bottom frame buttons. |
protected void |
updateFrameButtonColors()
This is called automatically to change the color of the buttons depending on the window style. |
boolean |
wantsEndButton()
Whether the window wants to receive END button events instead of page down. |
boolean |
wantsSendButton()
Whether the window wants to receive SEND button events instead of page down. |
| Methods inherited from class danger.app.Listener |
|---|
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean mAutoSizeWidth
setAutoSize(boolean) or setAutoSizeWidth(boolean) instead.protected boolean mAutoSizeHeight
setAutoSize(boolean) or setAutoSizeHeight(boolean) instead.protected Event mBackEvent
setBackEvent(danger.app.Event) instead.protected Event mCancelEvent
setCancelButtonEvent(danger.app.Event) instead.protected int m_leftBorder
setBorders(int, int, int, int) instead.protected int m_rightBorder
setBorders(int, int, int, int) instead.protected int m_topBorder
setBorders(int, int, int, int) instead.protected int m_bottomBorder
setBorders(int, int, int, int) instead.protected boolean m_autoCenter
setAutoCenter(boolean) instead.protected RingToneObject m_showTone
setShowTone(danger.audio.RingToneObject) instead.protected int m_showToneID
setShowTone(int) instead.protected boolean mNeedToAddTopFrameButtons
protected boolean mNeedToAddBottomFrameButtons
protected Button[] mButtons
protected char[] mShortcuts
protected int[] mShortcutModifiers
protected int[] mButtonIDs
protected int mDefaultButtonPosition
setDefaultFrameButton(int) instead.protected Button mDefaultButton
setDefaultFrameButton(Button) instead.protected boolean[] mHideOnButton
setHideOnButtonEvent(boolean),
setHideOnButtonWithID(int,boolean) or
setHideOnButtonWithPosition(int,boolean) instead.protected boolean mLayoutButtonsVertically
setLayoutBottomFrameButtonsVertically(boolean) instead.protected Listener mListener
setListener(danger.app.Listener) instead.protected boolean mRegisteredForKeyGuardEvent
protected Alarm m_toneAlarm
protected boolean mCenterTitle
setCenterTitle(boolean) instead.protected static final int BUTTON_HEIGHT
public static final int BOTTOM_POSITION1
public static final int BOTTOM_POSITION2
public