AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.TextBoxBase Class Referenceabstract
Inheritance diagram for com.google.appinventor.components.runtime.TextBoxBase:
com.google.appinventor.components.runtime.AndroidViewComponent com.google.appinventor.components.runtime.VisibleComponent com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.EmailPicker com.google.appinventor.components.runtime.PasswordTextBox com.google.appinventor.components.runtime.TextBox

Public Member Functions

 TextBoxBase (ComponentContainer container, EditText textview)
 
View getView ()
 
void GotFocus ()
 
void LostFocus ()
 
int TextAlignment ()
 
void TextAlignment (int alignment)
 
int BackgroundColor ()
 
void BackgroundColor (int argb)
 
boolean Enabled ()
 
void Enabled (boolean enabled)
 
boolean FontBold ()
 
void FontBold (boolean bold)
 
boolean FontItalic ()
 
void FontItalic (boolean italic)
 
float FontSize ()
 
void FontSize (float size)
 
int FontTypeface ()
 
void FontTypeface (int typeface)
 
String Hint ()
 
void Hint (String hint)
 
String Text ()
 
void Text (String text)
 
int TextColor ()
 
void TextColor (int argb)
 
void RequestFocus ()
 
void onFocusChange (View previouslyFocused, boolean gainFocus)
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent
boolean Visible ()
 
void Visible (boolean visibility)
 
int Width ()
 
void Width (int width)
 
void WidthPercent (int pCent)
 
void setLastWidth (int width)
 
int getSetWidth ()
 
void setLastHeight (int height)
 
int getSetHeight ()
 
void CopyWidth (AndroidViewComponent sourceComponent)
 
int Height ()
 
void Height (int height)
 
void HeightPercent (int pCent)
 
void CopyHeight (AndroidViewComponent sourceComponent)
 
int Column ()
 
void Column (int column)
 
int Row ()
 
void Row (int row)
 
HandlesEventDispatching getDispatchDelegate ()
 

Protected Attributes

final EditText view
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidViewComponent
final ComponentContainer container
 

Additional Inherited Members

- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
static final String ASSET_DIRECTORY = "component"
 
static final int ALIGNMENT_NORMAL = 0
 
static final int ALIGNMENT_CENTER = 1
 
static final int ALIGNMENT_OPPOSITE = 2
 
static final int ACCELEROMETER_SENSITIVITY_WEAK = 1
 
static final int ACCELEROMETER_SENSITIVITY_MODERATE = 2
 
static final int ACCELEROMETER_SENSITIVITY_STRONG = 3
 
static final int BUTTON_SHAPE_DEFAULT = 0
 
static final int BUTTON_SHAPE_ROUNDED = 1
 
static final int BUTTON_SHAPE_RECT = 2
 
static final int BUTTON_SHAPE_OVAL = 3
 
static final int COLOR_NONE = 0x00FFFFFF
 
static final int COLOR_BLACK = 0xFF000000
 
static final int COLOR_BLUE = 0xFF0000FF
 
static final int COLOR_CYAN = 0xFF00FFFF
 
static final int COLOR_DKGRAY = 0xFF444444
 
static final int COLOR_GRAY = 0xFF888888
 
static final int COLOR_GREEN = 0xFF00FF00
 
static final int COLOR_LTGRAY = 0xFFCCCCCC
 
static final int COLOR_MAGENTA = 0xFFFF00FF
 
static final int COLOR_ORANGE = 0xFFFFC800
 
static final int COLOR_PINK = 0xFFFFAFAF
 
static final int COLOR_RED = 0xFFFF0000
 
static final int COLOR_WHITE = 0xFFFFFFFF
 
static final int COLOR_YELLOW = 0xFFFFFF00
 
static final int COLOR_DEFAULT = 0x00000000
 
static final String DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF"
 
static final String DEFAULT_VALUE_COLOR_BLACK = "&HFF000000"
 
static final String DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF"
 
static final String DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF"
 
static final String DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444"
 
static final String DEFAULT_VALUE_COLOR_GRAY = "&HFF888888"
 
static final String DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00"
 
static final String DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC"
 
static final String DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF"
 
static final String DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800"
 
static final String DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF"
 
static final String DEFAULT_VALUE_COLOR_RED = "&HFFFF0000"
 
static final String DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF"
 
static final String DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00"
 
static final String DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000"
 
static final float FONT_DEFAULT_SIZE = 14
 
static final int LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL
 
static final int LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL
 
static final int SCALING_SCALE_PROPORTIONALLY = 0
 
static final int SCALING_SCALE_TO_FIT = 1
 
static final int TYPEFACE_DEFAULT = 0
 
static final int TYPEFACE_SANSSERIF = 1
 
static final int TYPEFACE_SERIF = 2
 
static final int TYPEFACE_MONOSPACE = 3
 
static final int LENGTH_PREFERRED = -1
 
static final int LENGTH_FILL_PARENT = -2
 
static final int LENGTH_UNKNOWN = -3
 
static final int LENGTH_PERCENT_TAG = -1000
 
static final int TOAST_LENGTH_SHORT = 0
 
static final int TOAST_LENGTH_LONG = 1
 
static final int DIRECTION_NORTH = 1
 
static final int DIRECTION_NORTHEAST = 2
 
static final int DIRECTION_EAST = 3
 
static final int DIRECTION_SOUTHEAST = 4
 
static final int DIRECTION_SOUTH = -1
 
static final int DIRECTION_SOUTHWEST = -2
 
static final int DIRECTION_WEST = -3
 
static final int DIRECTION_NORTHWEST = -4
 
static final int DIRECTION_NONE = 0
 
static final int DIRECTION_MIN = -4
 
static final int DIRECTION_MAX = 4
 
static float SLIDER_MIN_VALUE = 10
 
static float SLIDER_MAX_VALUE = 50
 
static float SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = ""
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = ""
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent
 AndroidViewComponent (ComponentContainer container)
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.VisibleComponent
 VisibleComponent ()
 

Detailed Description

Underlying base class for TextBox, not directly accessible to Simple programmers.

Author
sharo.nosp@m.n@go.nosp@m.ogle..nosp@m.com (Sharon Perl)

Definition at line 37 of file TextBoxBase.java.

Constructor & Destructor Documentation

◆ TextBoxBase()

com.google.appinventor.components.runtime.TextBoxBase.TextBoxBase ( ComponentContainer  container,
EditText  textview 
)

Creates a new TextBoxBase component

Parameters
containercontainer that the component will be placed in
textviewthe underlying EditText object that maintains the text

Definition at line 72 of file TextBoxBase.java.

Member Function Documentation

◆ BackgroundColor() [1/2]

int com.google.appinventor.components.runtime.TextBoxBase.BackgroundColor ( )

Returns the background color of the type% as an alpha-red-green-blue integer.

Returns
background RGB color with alpha

Definition at line 201 of file TextBoxBase.java.

◆ BackgroundColor() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.BackgroundColor ( int  argb)

The background color of the type%‘. You can choose a color by name in the Designer or in the Blocks Editor. The default background color is 'default’ (shaded 3-D look).

@internaldoc Specifies the background color of the type% as an alpha-red-green-blue integer.

Parameters
argbbackground RGB color with alpha

Definition at line 218 of file TextBoxBase.java.

◆ Enabled() [1/2]

boolean com.google.appinventor.components.runtime.TextBoxBase.Enabled ( )

Returns true if the type% is active and useable.

Returns
true
indicates enabled,
false
disabled

Definition at line 236 of file TextBoxBase.java.

◆ Enabled() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.Enabled ( boolean  enabled)

If set, user can enter text into the type%.

@internaldoc Specifies whether the type% should be active and usable.

Parameters
enabled

Definition at line 251 of file TextBoxBase.java.

◆ FontBold() [1/2]

boolean com.google.appinventor.components.runtime.TextBoxBase.FontBold ( )

Returns true if the text of the type% should be bold. If bold has been requested, this property will return true, even if the font does not support bold.

Returns
true
indicates bold,
false
normal

Definition at line 267 of file TextBoxBase.java.

◆ FontBold() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.FontBold ( boolean  bold)

Specifies whether the text of the type% should be bold. Some fonts do not support bold.

Parameters
bold

Definition at line 281 of file TextBoxBase.java.

◆ FontItalic() [1/2]

boolean com.google.appinventor.components.runtime.TextBoxBase.FontItalic ( )

Returns true if the text of the type% should be italic. If italic has been requested, this property will return true, even if the font does not support italic.

Returns
true
indicates italic,
false
normal

Definition at line 298 of file TextBoxBase.java.

◆ FontItalic() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.FontItalic ( boolean  italic)

Specifies whether the text of the type% should be italic. Some fonts do not support italic.

Parameters
italic

Definition at line 311 of file TextBoxBase.java.

◆ FontSize() [1/2]

float com.google.appinventor.components.runtime.TextBoxBase.FontSize ( )

Returns the text font size of the type%, measured in sp(scale-independent pixels).

Returns
font size in sp(scale-independent pixels).

Definition at line 325 of file TextBoxBase.java.

◆ FontSize() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.FontSize ( float  size)

Specifies the text font size of the type%, measured in sp(scale-independent pixels).

Parameters
sizefont size in pixel

Definition at line 337 of file TextBoxBase.java.

◆ FontTypeface() [1/2]

int com.google.appinventor.components.runtime.TextBoxBase.FontTypeface ( )

Returns the text font face of the type% as default, serif, sans serif, or monospace.

Returns
one of Component#TYPEFACE_DEFAULT, Component#TYPEFACE_SERIF, Component#TYPEFACE_SANSSERIF or Component#TYPEFACE_MONOSPACE

Definition at line 355 of file TextBoxBase.java.

◆ FontTypeface() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.FontTypeface ( int  typeface)

The text font face of the type%. Valid values are 0 (default), 1 (serif), 2 (sans serif), or 3 (monospace).

Parameters
typefaceone of Component#TYPEFACE_DEFAULT, Component#TYPEFACE_SERIF, Component#TYPEFACE_SANSSERIF or Component#TYPEFACE_MONOSPACE

Definition at line 372 of file TextBoxBase.java.

◆ getView()

View com.google.appinventor.components.runtime.TextBoxBase.getView ( )

Returns the View that is displayed in the UI.

Reimplemented from com.google.appinventor.components.runtime.AndroidViewComponent.

Definition at line 118 of file TextBoxBase.java.

◆ GotFocus()

void com.google.appinventor.components.runtime.TextBoxBase.GotFocus ( )

Event raised when the type% is selected for input, such as by the user touching it.

Reimplemented in com.google.appinventor.components.runtime.EmailPicker.

Definition at line 128 of file TextBoxBase.java.

◆ Hint() [1/2]

String com.google.appinventor.components.runtime.TextBoxBase.Hint ( )

Hint property getter method.

Returns
hint text

Definition at line 387 of file TextBoxBase.java.

◆ Hint() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.Hint ( String  hint)

type% hint for the user.

@internaldoc Hint property setter method.

Parameters
hinthint text

Definition at line 402 of file TextBoxBase.java.

◆ LostFocus()

void com.google.appinventor.components.runtime.TextBoxBase.LostFocus ( )

Event raised when the type% is no longer selected for input, such as if the user touches a different text box.

Definition at line 138 of file TextBoxBase.java.

◆ onFocusChange()

void com.google.appinventor.components.runtime.TextBoxBase.onFocusChange ( View  previouslyFocused,
boolean  gainFocus 
)

Definition at line 482 of file TextBoxBase.java.

◆ RequestFocus()

void com.google.appinventor.components.runtime.TextBoxBase.RequestFocus ( )

Request focus to current type%.

Definition at line 475 of file TextBoxBase.java.

◆ Text() [1/2]

String com.google.appinventor.components.runtime.TextBoxBase.Text ( )

Returns the textbox contents.

Returns
text box contents

Definition at line 414 of file TextBoxBase.java.

◆ Text() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.Text ( String  text)

The text in the type%, which can be set by the programmer in the Designer or Blocks Editor, or it can be entered by the user (unless the Enabled(boolean) property is false).

Parameters
textnew text in text box

Definition at line 432 of file TextBoxBase.java.

◆ TextAlignment() [1/2]

int com.google.appinventor.components.runtime.TextBoxBase.TextAlignment ( )

Default Validate event handler. Returns the alignment of the type%'s text: center, normal (e.g., left-justified if text is written left to right), or opposite (e.g., right-justified if text is written left to right).

Returns
one of Component#ALIGNMENT_NORMAL, Component#ALIGNMENT_CENTER or Component#ALIGNMENT_OPPOSITE

Definition at line 166 of file TextBoxBase.java.

◆ TextAlignment() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.TextAlignment ( int  alignment)

Specifies the alignment of the type%'s text. Valid values are: 0 (normal; e.g., left-justified if text is written left to right), 1 (center), or 2 (opposite; e.g., right-justified if text is written left to right).

Parameters
alignmentone of Component#ALIGNMENT_NORMAL, Component#ALIGNMENT_CENTER or Component#ALIGNMENT_OPPOSITE

Definition at line 184 of file TextBoxBase.java.

◆ TextColor() [1/2]

int com.google.appinventor.components.runtime.TextBoxBase.TextColor ( )

Returns the text color of the type% as an alpha-red-green-blue integer.

Returns
text RGB color with alpha

Definition at line 448 of file TextBoxBase.java.

◆ TextColor() [2/2]

void com.google.appinventor.components.runtime.TextBoxBase.TextColor ( int  argb)

Specifies the text color of the type% as an alpha-red-green-blue integer.

Parameters
argbtext RGB color with alpha

Definition at line 461 of file TextBoxBase.java.

Member Data Documentation

◆ view

final EditText com.google.appinventor.components.runtime.TextBoxBase.view
protected

Definition at line 40 of file TextBoxBase.java.


The documentation for this class was generated from the following file: