public class

TextArea

extends TextEdit
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.TextEdit
       ↳ com.neomades.ui.TextArea

Class Overview

A TextArea represents an area of editable text into Screen. A TextArea is a TextField that can have several lines.

Default properties

By default, the following properties are applied to a new TextArea:

  • focusable (limited to some devices)
  • clickable
  • enabled
  • autoCorrect: true
  • no text
  • width content stretch: MATCH_PARENT.
  • height content stretch: MATCH_CONTENT.
  • content alignment : LEFT|TOP.

Summary

XML Attributes
Attribute Name Related Method Description
lines setLines(int) Number of lines  
[Expand]
Inherited XML Attributes
From class com.neomades.ui.TextEdit
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
TextArea()
Constructs a TextArea with no text, no default text, and default edit mode
TextArea(String text)
Constructs a TextArea with given text, no default text, and default edit mode
TextArea(String defaultText, String text)
Constructs a TextArea with given text, given default text, and default edit mode
TextArea(int resId)
Constructs a TextArea with given text, no default text, and default edit mode
TextArea(int defaultTextId, int textId)
Constructs a TextArea with given text, given default text, and default edit mode
Public Methods
void setLines(int lines)
Sets the number of lines of this text area.
void setReturnKeyListener(ReturnKeyListener returnKeyListener)
This method has no effect, the return key is used to add a new line.
void setReturnKeyType(int returnKeyType)
This method has no effect, the return key is used to add a new line.
[Expand]
Inherited Methods
From class com.neomades.ui.TextEdit
From class com.neomades.ui.View
From class java.lang.Object

XML Attributes

lines

Number of lines

Related Methods

Public Constructors

public TextArea ()

Constructs a TextArea with no text, no default text, and default edit mode

public TextArea (String text)

Constructs a TextArea with given text, no default text, and default edit mode

Parameters
text the text of this text area

public TextArea (String defaultText, String text)

Constructs a TextArea with given text, given default text, and default edit mode

Parameters
defaultText the default text of this area
text the text of this text area

public TextArea (int resId)

Constructs a TextArea with given text, no default text, and default edit mode

Parameters
resId the string id representing the text of this text area

public TextArea (int defaultTextId, int textId)

Constructs a TextArea with given text, given default text, and default edit mode

Parameters
defaultTextId the string id representing the default text of this area
textId the string id representing the text of this text area

Public Methods

public void setLines (int lines)

Sets the number of lines of this text area.

If the text is longer than this number of lines, a scroll bar will be inserted in the area.

If the text is smaller than this number of lines, empty lines will be displayed after the text to reach the number of lines.

This method uses the setHeight() method, if a setHeight() have been use before it will be overwritten.

Related XML Attributes
Parameters
lines number of lines. If 0, no lines will be displayed. If -1, the number of lines displayed will rely on the text length and the stretch property of the TextArea (default). If < -1, an exception will be raised.
Throws
CrossThreadException if the method is called from outside the UI-Thread
IllegalArgumentException if lines is < -1

public void setReturnKeyListener (ReturnKeyListener returnKeyListener)

This method has no effect, the return key is used to add a new line.

Parameters
returnKeyListener the callback used to listen press event on "Return" for the keyboard of the TextField

public void setReturnKeyType (int returnKeyType)

This method has no effect, the return key is used to add a new line.

Parameters
returnKeyType the ReturnKeyType of the keyboard