AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.ListPicker Class Reference
Inheritance diagram for com.google.appinventor.components.runtime.ListPicker:
com.google.appinventor.components.runtime.Picker com.google.appinventor.components.runtime.ActivityResultListener com.google.appinventor.components.runtime.Deleteable com.google.appinventor.components.runtime.OnResumeListener com.google.appinventor.components.runtime.ButtonBase com.google.appinventor.components.runtime.ActivityResultListener com.google.appinventor.components.runtime.AndroidViewComponent com.google.appinventor.components.runtime.VisibleComponent com.google.appinventor.components.runtime.Component

Public Member Functions

 ListPicker (ComponentContainer container)
 
void onResume ()
 
String Selection ()
 
void Selection (String value)
 
void ShowFilterBar (boolean showFilter)
 
boolean ShowFilterBar ()
 
void ItemTextColor (int argb)
 
int ItemTextColor ()
 
void ItemBackgroundColor (int argb)
 
int ItemBackgroundColor ()
 
int SelectionIndex ()
 
void SelectionIndex (int index)
 
YailList Elements ()
 
void Elements (YailList itemList)
 
void ElementsFromString (String itemstring)
 
String Title ()
 
void Title (String title)
 
Intent getIntent ()
 
void resultReturned (int requestCode, int resultCode, Intent data)
 
void onDelete ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.Picker
 Picker (ComponentContainer container)
 
void click ()
 
void Open ()
 
void BeforePicking ()
 
void AfterPicking ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.ButtonBase
 ButtonBase (ComponentContainer container)
 
boolean onTouch (View view, MotionEvent me)
 
View getView ()
 
void TouchDown ()
 
void TouchUp ()
 
void GotFocus ()
 
void LostFocus ()
 
int TextAlignment ()
 
void TextAlignment (int alignment)
 
int Shape ()
 
void Shape (int shape)
 
String Image ()
 
void Image (String path)
 
int BackgroundColor ()
 
void BackgroundColor (int argb)
 
boolean Enabled ()
 
void Enabled (boolean enabled)
 
boolean FontBold ()
 
void FontBold (boolean bold)
 
void ShowFeedback (boolean showFeedback)
 
boolean ShowFeedback ()
 
boolean FontItalic ()
 
void FontItalic (boolean italic)
 
float FontSize ()
 
void FontSize (float size)
 
int FontTypeface ()
 
void FontTypeface (int typeface)
 
String Text ()
 
void Text (String text)
 
int TextColor ()
 
void TextColor (int argb)
 
boolean longClick ()
 
void onClick (View view)
 
void onFocusChange (View previouslyFocused, boolean gainFocus)
 
boolean onLongClick (View view)
 
- 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 ()
 

Static Public Attributes

static final int DEFAULT_ITEM_TEXT_COLOR = Component.COLOR_WHITE
 
static final int DEFAULT_ITEM_BACKGROUND_COLOR = Component.COLOR_BLACK
 
- 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 = ""
 

Additional Inherited Members

- 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 ()
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.Picker
final ComponentContainer container
 
int requestCode
 
- Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidViewComponent
final ComponentContainer container
 

Detailed Description

A button that, when clicked on, displays a list of texts for the user to choose among. The texts can be specified through the Designer or Blocks Editor by setting the ElementsFromString(String) property to their string-separated concatenation (for example, choice 1, choice 2, choice 3) or by setting the Elements(YailList) property to a List in the Blocks editor.

Setting property ShowFilterBar(boolean) to true{:.logic.block}, will make the list searchable. Other properties affect the appearance of the button (TextAlignment(int), BackgroundColor(int), etc.) and whether it can be clicked on (Enabled(boolean)).

Author
sharo.nosp@m.n@go.nosp@m.ogle..nosp@m.com (Sharon Perl)
M. Hossein Amerkashi (kkash.nosp@m.i01@.nosp@m.gmail.nosp@m..com)

Definition at line 61 of file ListPicker.java.

Constructor & Destructor Documentation

◆ ListPicker()

com.google.appinventor.components.runtime.ListPicker.ListPicker ( ComponentContainer  container)

Create a new ListPicker component.

Parameters
containerthe parent container.

Definition at line 93 of file ListPicker.java.

Member Function Documentation

◆ Elements() [1/2]

YailList com.google.appinventor.components.runtime.ListPicker.Elements ( )

Specifies the list of choices to display.

Returns
a YailList representing the list of strings to be picked from

Definition at line 224 of file ListPicker.java.

◆ Elements() [2/2]

void com.google.appinventor.components.runtime.ListPicker.Elements ( YailList  itemList)

Elements property setter method

@suppressdoc

Parameters
itemList- a YailList containing the strings to be added to the ListPicker

Definition at line 237 of file ListPicker.java.

◆ ElementsFromString()

void com.google.appinventor.components.runtime.ListPicker.ElementsFromString ( String  itemstring)

Set the list of choices from a string of comma-separated values.

Parameters
itemstring- a string containing a comma-separated list of the strings to be picked from

Definition at line 253 of file ListPicker.java.

◆ getIntent()

Intent com.google.appinventor.components.runtime.ListPicker.getIntent ( )

Provides the Intent used to launch the picker activity.

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

Definition at line 286 of file ListPicker.java.

◆ ItemBackgroundColor() [1/2]

int com.google.appinventor.components.runtime.ListPicker.ItemBackgroundColor ( )

The background color of the ListPicker items.

Definition at line 188 of file ListPicker.java.

◆ ItemBackgroundColor() [2/2]

void com.google.appinventor.components.runtime.ListPicker.ItemBackgroundColor ( int  argb)

Definition at line 178 of file ListPicker.java.

◆ ItemTextColor() [1/2]

int com.google.appinventor.components.runtime.ListPicker.ItemTextColor ( )

Definition at line 171 of file ListPicker.java.

◆ ItemTextColor() [2/2]

void com.google.appinventor.components.runtime.ListPicker.ItemTextColor ( int  argb)

Definition at line 164 of file ListPicker.java.

◆ onDelete()

void com.google.appinventor.components.runtime.ListPicker.onDelete ( )

◆ onResume()

void com.google.appinventor.components.runtime.ListPicker.onResume ( )

◆ resultReturned()

void com.google.appinventor.components.runtime.ListPicker.resultReturned ( int  requestCode,
int  resultCode,
Intent  data 
)

Callback method to get the result returned by the list picker activity

Parameters
requestCodea code identifying the request.
resultCodea code specifying success or failure of the activity
datathe returned data, in this case an Intent whose data field contains the selected item.

Implements com.google.appinventor.components.runtime.ActivityResultListener.

Definition at line 317 of file ListPicker.java.

◆ Selection() [1/2]

String com.google.appinventor.components.runtime.ListPicker.Selection ( )

The selected item. When directly changed by the programmer, the SelectionIndex(int) property is also changed to the first item in the ListPicker with the given value. If the value is not in Elements(), SelectionIndex(int) will be set to 0.

Definition at line 125 of file ListPicker.java.

◆ Selection() [2/2]

void com.google.appinventor.components.runtime.ListPicker.Selection ( String  value)

Selection property setter method.

@suppressdoc

Definition at line 137 of file ListPicker.java.

◆ SelectionIndex() [1/2]

int com.google.appinventor.components.runtime.ListPicker.SelectionIndex ( )

Selection index property getter method.

Definition at line 202 of file ListPicker.java.

◆ SelectionIndex() [2/2]

void com.google.appinventor.components.runtime.ListPicker.SelectionIndex ( int  index)

Selection index property setter method.

Definition at line 212 of file ListPicker.java.

◆ ShowFilterBar() [1/2]

boolean com.google.appinventor.components.runtime.ListPicker.ShowFilterBar ( )

If true{:.logic.block}, the ListPicker will show a search filter bar.

Definition at line 157 of file ListPicker.java.

◆ ShowFilterBar() [2/2]

void com.google.appinventor.components.runtime.ListPicker.ShowFilterBar ( boolean  showFilter)

Definition at line 147 of file ListPicker.java.

◆ Title() [1/2]

String com.google.appinventor.components.runtime.ListPicker.Title ( )

Optional title displayed at the top of the list of choices.

@internaldoc Title property getter method.

Returns
list picker title

Definition at line 267 of file ListPicker.java.

◆ Title() [2/2]

void com.google.appinventor.components.runtime.ListPicker.Title ( String  title)

Title property setter method: sets a new caption for the list picker in the list picker activity's title bar.

@suppressdoc

Parameters
titlenew list picker caption

Definition at line 281 of file ListPicker.java.

Member Data Documentation

◆ DEFAULT_ITEM_BACKGROUND_COLOR

final int com.google.appinventor.components.runtime.ListPicker.DEFAULT_ITEM_BACKGROUND_COLOR = Component.COLOR_BLACK
static

Definition at line 86 of file ListPicker.java.

◆ DEFAULT_ITEM_TEXT_COLOR

final int com.google.appinventor.components.runtime.ListPicker.DEFAULT_ITEM_TEXT_COLOR = Component.COLOR_WHITE
static

Definition at line 85 of file ListPicker.java.


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