org.hermit.android.notice
Class InfoBox

java.lang.Object
  extended by Dialog
      extended by org.hermit.android.notice.InfoBox

public class InfoBox
extends Dialog

This class implements a popup info box (a subclass of Dialog) which can be used to display help text, about info, license info, etc.


Field Summary
static int BUTTON_1
          Select configurable button 1 -- the middle button.
static int BUTTON_2
          Select configurable button 2 -- the middle button.
 
Constructor Summary
InfoBox(Activity parent)
          Create an info box with a "close" button.
InfoBox(Activity parent, int button)
          Create an info box.
 
Method Summary
protected  void linkButtonPressed(int which)
          Called when a link button is clicked.
protected  void okButtonPressed()
          Called when the OK button is clicked.
 void setLinkButton(int which, int label, int link)
          Set a link button on this dialog.
 void setSubtitle(int textId)
          Set the subtitle for the about box.
 void setSubtitle(java.lang.String text)
          Set the subtitle for the about box.
 void show(int text)
          Start the dialog and display it on screen.
 void show(int title, int text)
          Start the dialog and display it on screen.
 void show(java.lang.String text)
          Start the dialog and display it on screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON_1

public static final int BUTTON_1
Select configurable button 1 -- the middle button.

See Also:
Constant Field Values

BUTTON_2

public static final int BUTTON_2
Select configurable button 2 -- the middle button.

See Also:
Constant Field Values
Constructor Detail

InfoBox

public InfoBox(Activity parent)
Create an info box with a "close" button.

Parameters:
parent - Parent application context.

InfoBox

public InfoBox(Activity parent,
               int button)
Create an info box.

Parameters:
parent - Parent application context.
button - Resource ID of the text for the OK button.
Method Detail

setLinkButton

public void setLinkButton(int which,
                          int label,
                          int link)
Set a link button on this dialog. These are buttons that the user can click to open a URL, e.g. the project page, license, etc.

Parameters:
which - Which button to set: BUTTON_1 or BUTTON_2.
label - The button label as a resource ID.
link - Resource ID of the URL for the button.

setSubtitle

public void setSubtitle(int textId)
Set the subtitle for the about box.

Parameters:
textId - ID of the subtitle to display; if 0, don't show one.

setSubtitle

public void setSubtitle(java.lang.String text)
Set the subtitle for the about box.

Parameters:
text - Subtitle to display; if null, don't show one.

show

public void show(int title,
                 int text)
Start the dialog and display it on screen. The window is placed in the application layer and opaque.

Parameters:
title - Title for the dialog.
text - Text to display in the dialog.

show

public void show(int text)
Start the dialog and display it on screen. The window is placed in the application layer and opaque.

Parameters:
text - Text to display in the dialog.

show

public void show(java.lang.String text)
Start the dialog and display it on screen. The window is placed in the application layer and opaque.

Parameters:
text - Text to display in the dialog.

okButtonPressed

protected void okButtonPressed()
Called when the OK button is clicked.


linkButtonPressed

protected void linkButtonPressed(int which)
Called when a link button is clicked.

Parameters:
which - The ID of the link button which has been clicked, as passed to setLinkButton(int, int, int).