public class TextContainer extends java.lang.Object implements MapWidget.OnClickListener, java.lang.Runnable, MapWidget2.OnWidgetSizeChangedListener
Modifier and Type | Field and Description |
---|---|
protected TextWidget |
_text |
protected MarkerIconWidget |
_widget |
protected MapTextFormat |
DEFAULT_FORMAT |
protected Icon |
icon_lit |
static java.lang.String |
TAG |
protected MapTextFormat |
textFormat |
Modifier | Constructor and Description |
---|---|
protected |
TextContainer() |
Modifier and Type | Method and Description |
---|---|
void |
closePrompt() |
void |
closePrompt(java.lang.String text)
Closes the prompt if it's currently displayed.
|
void |
displayPrompt(java.lang.CharSequence prompt) |
void |
displayPrompt(java.lang.CharSequence prompt,
MapTextFormat textFormat) |
void |
displayPrompt(java.lang.CharSequence prompt,
MapTextFormat textFormat,
int color) |
void |
displayPrompt(int textId) |
void |
displayPrompt(java.lang.String prompt) |
void |
displayPrompt(java.lang.String prompt,
MapTextFormat textFormat) |
void |
displayPrompt(java.lang.String prompt,
MapTextFormat textFormat,
int color) |
protected void |
displayPromptAtTop(java.lang.CharSequence prompt,
boolean blink) |
void |
displayPromptForceShow(java.lang.String prompt)
Allows a user to display a prompt, but force it independently from
the user descision to show or hide the prompt.
|
void |
dispose() |
protected Icon |
getIcon() |
static TextContainer |
getInstance()
Returns a TextContainer that displays at the top of the screen.
|
static TextContainer |
getTopInstance()
Return a TextContainer that displays at the top of the screen.
|
void |
onMapWidgetClick(MapWidget widget,
android.view.MotionEvent event) |
void |
onWidgetSizeChanged(MapWidget2 widget) |
void |
run()
Blink thread.
|
protected static java.lang.String |
wrap(java.lang.String prompt,
MapTextFormat fmt,
float maxWidth)
Line-wrap a string based on its text format and available width
|
public static final java.lang.String TAG
protected MapTextFormat DEFAULT_FORMAT
protected TextWidget _text
protected final MarkerIconWidget _widget
protected final Icon icon_lit
protected MapTextFormat textFormat
public void onMapWidgetClick(MapWidget widget, android.view.MotionEvent event)
onMapWidgetClick
in interface MapWidget.OnClickListener
public void onWidgetSizeChanged(MapWidget2 widget)
onWidgetSizeChanged
in interface MapWidget2.OnWidgetSizeChangedListener
public static TextContainer getInstance()
public static TextContainer getTopInstance()
public void dispose()
public void displayPrompt(int textId)
public void displayPrompt(java.lang.String prompt)
public void displayPrompt(java.lang.CharSequence prompt)
public void displayPrompt(java.lang.String prompt, MapTextFormat textFormat)
public void displayPrompt(java.lang.CharSequence prompt, MapTextFormat textFormat)
public void displayPrompt(java.lang.String prompt, MapTextFormat textFormat, int color)
public void displayPrompt(java.lang.CharSequence prompt, MapTextFormat textFormat, int color)
public void displayPromptForceShow(java.lang.String prompt)
protected static java.lang.String wrap(java.lang.String prompt, MapTextFormat fmt, float maxWidth)
prompt
- Text promptfmt
- Text format (used for width calculations)maxWidth
- Max width availableprotected void displayPromptAtTop(java.lang.CharSequence prompt, boolean blink)
public void run()
run
in interface java.lang.Runnable
protected Icon getIcon()
public void closePrompt(java.lang.String text)
text
- Only close if this text is showing (null to ignore);public void closePrompt()