Android Programming Press on the image to return to the main documentation page.

Views (Core)

List of types:

Activity
AutoCompleteEditText
Button
CheckBox
EditText
HorizontalScrollView
ImageView
Label
ListView
Panel
ProgressBar
RadioButton
ScrollView
SeekBar
Spinner
TabHost
ToggleButton
View
WebView

Activity

Each activity module include a predefined Activity object.
Activity is the main component of your application.
Activities have three special life cycle related event: Activity_Create, Activity_Resume and Activity_Pause.
See this tutorial for more information about activities and processes life cycle: Life cycle tutorial.

You can add and remove views to this activity with AddView and RemoveViewAt methods.
You can also load a layout file with LoadLayout.
The Touch event can be used to handle user touches.
The first parameter of this event is the Action parameter. The parameter values can be ACTION_DOWN,
ACTION_MOVE or ACTION_UP. Use this value to find the user current action.
The KeyPress and KeyUp events occur when the user presses or releases a key, assuming that no other view has consumed this event (like EditText).
When handling the KeyPress or KeyUp event you should return a boolean value which tells whether the event was consumed.
For example if the user pressed on the Back key and you return True then the OS will not close your activity.

Sub Activity_KeyPress (KeyCode As Int) As Boolean
  If Keycode = KeyCodes.KEYCODE_BACK Then
    Return True
  Else
    Return False
  End If
End Sub

You can add menu items to the activity with AddMenuItem method. Note that this method should only be called inside
Activity_Create event.
Starting from Android 4.3 it is not possible to show a modal dialog inside the KeyPress or KeyUp events, with one exception which is in the case of the Back key.
If you need to show a modal dialog for other keys then you should call a sub with CallSubDelayed and show the modal dialog in that sub.

Events:

Touch (Action As Int, X As Float, Y As Float)
KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
KeyUp (KeyCode As Int) As Boolean
WindowFocusChanged (Focused As Boolean)
ActionBarHomeClick
PermissionResult (Permission As String, Result As Boolean)
Click
LongClick

Members:


  ACTION_DOWN As Int

  ACTION_MOVE As Int

  ACTION_UP As Int

  AddMenuItem (Title As CharSequence, EventName As String)

  AddMenuItem2 (Title As CharSequence, EventName As String, Bitmap As android.graphics.Bitmap)

  AddMenuItem3 (Title As CharSequence, EventName As String, Bitmap As android.graphics.Bitmap, AddToActionBar As Boolean)

  AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)

  Background As android.graphics.drawable.Drawable

  CloseMenu

  Color As Int [write only]

  DisableAccessibility (Disable As Boolean)

  Finish

  GetAllViewsRecursive As IterableList

  GetStartingIntent As Intent

  GetView (Index As Int) As View

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  LoadLayout (LayoutFile As String) As LayoutValues

  NumberOfViews As Int [read only]

  OpenMenu

  Padding() As Int

  Parent As Object [read only]

  RemoveAllViews

  RemoveViewAt (Index As Int)

  RequestFocus As Boolean

  RerunDesignerScript (Layout As String, Width As Int, Height As Int)

  SetActivityResult (Result As Int, Data As Intent)

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Title As CharSequence

  TitleColor As Int

  Top As Int

  Width As Int

Members description:

ACTION_DOWN As Int
ACTION_MOVE As Int
ACTION_UP As Int
AddMenuItem (Title As CharSequence, EventName As String)
Adds a menu item to the activity.
Title - Menu item title.
EventName - The prefix name of the sub that will handle the click event.
This method should only be called inside sub Activity_Create.
Note that the 'Sender' value inside the click event equals to the clicked menu item text.
Example:
Activity.AddMenuItem("Open File", "OpenFile")
...
Sub OpenFile_Click
...
End Sub
AddMenuItem2 (Title As CharSequence, EventName As String, Bitmap As android.graphics.Bitmap)
Adds a menu item to the activity.
Title - Menu item title.
EventName - The prefix name of the sub that will handle the click event.
Bitmap - Bitmap to draw as the item background.
Only the first five (or six if there are six total) menu items display icons.
This method should only be called inside sub Activity_Create.
Note that the 'Sender' value inside the click event equals to the clicked menu item text.
Example:
Activity.AddMenuItem2("Open File", "OpenFile", LoadBitmap(File.DirAssets, "SomeImage.png"))
...
Sub OpenFile_Click
...
End Sub
AddMenuItem3 (Title As CharSequence, EventName As String, Bitmap As android.graphics.Bitmap, AddToActionBar As Boolean)
Similar to AddMenuItem2. If AddToActionBar is true then the item will be displayed in the action bar (on Android 3.0+ devices) if there is enough room.
If there is not enough room then the item will be displayed together with the other menu items.
AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)
Adds a view to this activity.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
CloseMenu
Programmatically closes the menu.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
DisableAccessibility (Disable As Boolean)
This method was added as a workaround for the following
Android bug.
By setting the Disable property to True the child views (of all Activities) will not be added to the accessibility enabled list.
Finish
Closes this activity.
GetAllViewsRecursive As IterableList
Returns an iterator that iterates over all the child views including views that were added to other child views.
Example:
For Each v As View In Activity.GetAllViewsRecursive
  ...
Next
GetStartingIntent As Intent
(Advanced) Gets the intent object that started this Activity.
This can be used together with SetActivityResult to return results to 3rd party applications.
GetView (Index As Int) As View
Gets the view that is stored in the specified index.
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
LoadLayout (LayoutFile As String) As LayoutValues
Loads a layout file (.bal).
Returns the LayoutValues of the actual layout variant that was loaded.
NumberOfViews As Int [read only]
Returns the number of child views.
OpenMenu
Programmatically opens the menu.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveAllViews
Removes all child views.
RemoveViewAt (Index As Int)
Removes the view that is stored in the specified index.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
RerunDesignerScript (Layout As String, Width As Int, Height As Int)
This method is deprecated. It ignores the anchoring features and it will fail in Rapid Debug mode.
You should instead remove the views and load the layout again.
SetActivityResult (Result As Int, Data As Intent)
(Advanced) Sets the result that the calling Activity will get after calling StartActivityForResult.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Title As CharSequence
TitleColor As Int
Gets or sets the title color. This property is only supported by Android 2.x devices. It will not do anything on newer devices.
Top As Int
Width As Int
Gets or sets the view's width.

AutoCompleteEditText

An enhanced version of EditText which shows the user a drop down list with all items matching the currently entered characters.
Items matching are items starting with the current input or items that include a word that starts with the current input (words must be separated with spaces).
Call SetItems with the list of possible items.

ItemClick event is raised when the user clicks on an item from the list.
Example:
Sub Process_Globals

End Sub

Sub Globals
  Dim ACT As AutoCompleteEditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
  ACT.Initialize("ACT")
  Activity.AddView(ACT, 10dip, 10dip, 500dip, 80dip)
  Dim countries() As String
  countries = Array As String( _
    "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", _
    "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", _
    "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", _
    "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", _
    "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", _
    "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", _
    "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", _
    "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde", _
    "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", _
    "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", _
    "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", _
    "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", _
    "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", _
    "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland", _
    "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia", _
    "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar", _
    "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", _
    "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary", _
    "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", _
    "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", _
    "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", _
    "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", _
    "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", _
    "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", _
    "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", _
    "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas", _
    "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", _
    "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", _
    "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena", _
    "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", _
    "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal", _
    "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", _
    "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea", _
    "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", _
    "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas", _
    "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", _
    "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda", _
    "Ukraine", "United Arab Emirates", "United Kingdom", _
    "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", _
    "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara", _
    "Yemen", "Yugoslavia", "Zambia", "Zimbabwe")
  ACT.SetItems(countries)
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Events:

ItemClick (Value As String)
TextChanged (Old As String, New As String)
EnterPressed
FocusChanged (HasFocus As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  DismissDropDown

  Ellipsize As String

  Enabled As Boolean

  ForceDoneButton As Boolean [write only]

  Gravity As Int

  Height As Int

  Hint As String

  HintColor As Int

  Initialize (EventName As String)

  INPUT_TYPE_DECIMAL_NUMBERS As Int

  INPUT_TYPE_NONE As Int

  INPUT_TYPE_NUMBERS As Int

  INPUT_TYPE_PHONE As Int

  INPUT_TYPE_TEXT As Int

  InputType As Int

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  PasswordMode As Boolean [write only]

  RemoveView

  RequestFocus As Boolean

  SelectAll

  SelectionLength As Int [read only]

  SelectionStart As Int

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetItems (Items As List)

  SetItems2 (Items As List, Typeface As android.graphics.Typeface, Gravity As Int, TextSize As Float, TextColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetSelection (Start As Int, Length As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  ShowDropDown

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

  Wrap As Boolean [write only]

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
DismissDropDown
Forces the drop down list to disappear.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
ForceDoneButton As Boolean [write only]
By default the OS sets the virtual keyboard action key to display Done or Next according to the specific layout.
You can force it to display Done by setting this value to True.
Example:
EditText1.ForceDoneButton = True
Gravity As Int
Height As Int
Gets or sets the view's height.
Hint As String
Gets or sets the text that will appear when the EditText is empty.
Example:
EditText1.Hint = "Enter username"
HintColor As Int
Gets or sets the hint text color.
Example:
EditText1.HintColor = Colors.Gray
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
INPUT_TYPE_DECIMAL_NUMBERS As Int
Numeric keyboard will be displayed. Numbers, decimal point and minus sign are accepted.
INPUT_TYPE_NONE As Int
No keyboard will be displayed.
INPUT_TYPE_NUMBERS As Int
Numeric keyboard will be displayed. Only numbers are accepted.
INPUT_TYPE_PHONE As Int
Keyboard will be displayed in phone mode.
INPUT_TYPE_TEXT As Int
Default text mode.
InputType As Int
Gets or sets the input type flag. This flag is used to determine the settings of the virtual keyboard.
Note that changing the input type will set the EditText to be in single line mode.
Example:
EditText1.InputType = EditText1.INPUT_TYPE_NUMBERS
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
PasswordMode As Boolean [write only]
Sets whether the EditText should be in password mode and hide the actual characters.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SelectAll
Selects the entire text.
SelectionLength As Int [read only]
Gets the selection length.
SelectionStart As Int
Gets or sets the selection start position (or the cursor position).
Returns -1 if there is no selection or cursor.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetItems (Items As List)
Sets the list of possible items.
The items visual style will be the same as the style of the main text.
SetItems2 (Items As List, Typeface As android.graphics.Typeface, Gravity As Int, TextSize As Float, TextColor As Int)
Sets the list of possible items and specifies their style.
Example:
Dim act As AutoCompleteEditText
act.Initialize("act")
Activity.AddView(act, 10dip, 10dip, 200dip, 80dip)
act.SetItems2(Array As String("aab", "abc"), act.Typeface, Gravity.LEFT, 12, Colors.Green)
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetSelection (Start As Int, Length As Int)
Sets the selected text.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
ShowDropDown
Forces the drop down list to appear.
SingleLine As Boolean [write only]
Sets whether the EditText should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.
Wrap As Boolean [write only]
Sets whether the text content will wrap within the EditText bounds. Relevant when the EditText is in multiline mode.
Example:
EditText1.Wrap = False

Button

A Button view.
If you change the button's background you will usually want to use StateListDrawable which allows you to set the "default" drawable
and the "pressed" drawable.
Note that the Up and Down events are still implemented but should not be used as they will not work properly on all devices.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Click
LongClick

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
Gravity As Int
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the text field should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.

CheckBox

A CheckBox view. Unlike RadioButtons each CheckBox can be checked independently.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

CheckedChange(Checked As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Checked As Boolean

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Checked As Boolean
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
Gravity As Int
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the text field should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.

EditText

EditText view is a view that allows the user to write free text (similar to WinForms TextBox).
The EditText has two modes; SingleLine and MultiLine. You can set it to be multiline by calling EditText1.SingleLine = False
On most devices the soft keyboard will show automatically when the user presses on the EditText.
You can change the InputType property and change the type of keyboard that appears.
For example: EditText1.InputType = EditText1.INPUT_TYPE_NUMBERS will cause the numeric keyboard to appear when
the user presses on the EditText. Note that it will also cause the EditText to only accept numbers.

The TextChanged event fires whenever the text changes and it includes the old and new strings.
The EnterPressed event fires when the user presses on the enter key or action key (Done or Next).
The FocusChanged event fires when the view is focused or loses focus. HasFocus parameter value will be set accordingly.
Note that most views are not focusable. For example, pressing on a Button will not change the focus state of an EditText.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

TextChanged (Old As String, New As String)
EnterPressed
FocusChanged (HasFocus As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  ForceDoneButton As Boolean [write only]

  Gravity As Int

  Height As Int

  Hint As String

  HintColor As Int

  Initialize (EventName As String)

  INPUT_TYPE_DECIMAL_NUMBERS As Int

  INPUT_TYPE_NONE As Int

  INPUT_TYPE_NUMBERS As Int

  INPUT_TYPE_PHONE As Int

  INPUT_TYPE_TEXT As Int

  InputType As Int

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  PasswordMode As Boolean [write only]

  RemoveView

  RequestFocus As Boolean

  SelectAll

  SelectionLength As Int [read only]

  SelectionStart As Int

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetSelection (Start As Int, Length As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

  Wrap As Boolean [write only]

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
ForceDoneButton As Boolean [write only]
By default the OS sets the virtual keyboard action key to display Done or Next according to the specific layout.
You can force it to display Done by setting this value to True.
Example:
EditText1.ForceDoneButton = True
Gravity As Int
Height As Int
Gets or sets the view's height.
Hint As String
Gets or sets the text that will appear when the EditText is empty.
Example:
EditText1.Hint = "Enter username"
HintColor As Int
Gets or sets the hint text color.
Example:
EditText1.HintColor = Colors.Gray
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
INPUT_TYPE_DECIMAL_NUMBERS As Int
Numeric keyboard will be displayed. Numbers, decimal point and minus sign are accepted.
INPUT_TYPE_NONE As Int
No keyboard will be displayed.
INPUT_TYPE_NUMBERS As Int
Numeric keyboard will be displayed. Only numbers are accepted.
INPUT_TYPE_PHONE As Int
Keyboard will be displayed in phone mode.
INPUT_TYPE_TEXT As Int
Default text mode.
InputType As Int
Gets or sets the input type flag. This flag is used to determine the settings of the virtual keyboard.
Note that changing the input type will set the EditText to be in single line mode.
Example:
EditText1.InputType = EditText1.INPUT_TYPE_NUMBERS
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
PasswordMode As Boolean [write only]
Sets whether the EditText should be in password mode and hide the actual characters.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SelectAll
Selects the entire text.
SelectionLength As Int [read only]
Gets the selection length.
SelectionStart As Int
Gets or sets the selection start position (or the cursor position).
Returns -1 if there is no selection or cursor.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetSelection (Start As Int, Length As Int)
Sets the selected text.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the EditText should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.
Wrap As Boolean [write only]
Sets whether the text content will wrap within the EditText bounds. Relevant when the EditText is in multiline mode.
Example:
EditText1.Wrap = False

HorizontalScrollView

HorizontalScrollView is a view that contains other views and allows the user to horizontally scroll those views.
The HorizontalScrollView is similar to ScrollView which scrolls vertically.
See the ScrollView tutorial for more information.
The HorizontalScrollView has an inner panel which actually contains the child views.
You can add views by calling: HorizontalScrollView1.Panel.AddView(...)
Note that it is not possible to nest scrolling views.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

ScrollChanged(Position As Int)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  FullScroll (Right As Boolean)

  Height As Int

  Initialize (Width As Int, EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Panel As Panel [read only]

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  ScrollPosition As Int

  ScrollToNow (Scroll As Int)

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
FullScroll (Right As Boolean)
Scrolls the view to the right or left.
Height As Int
Gets or sets the view's height.
Initialize (Width As Int, EventName As String)
Initializes the object.
Width - The width of the inner panel.
EventName - Sets the sub that will handle the event.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Panel As Panel [read only]
Returns the panel which you can use to add views to.
Example:
HorizontalScrollView1.Panel.AddView(...)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
ScrollPosition As Int
Gets or sets the scroll position.
ScrollToNow (Scroll As Int)
Immediately scrolls the HorizontalScrollView (with no animations).
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

ImageView

A view that shows an image.
You can assign a bitmap using the Bitmap property.
The Gravity property changes the way the image appears.
The two most relevant values are Gravity.FILL (which will cause the image to fill the entire view)
and Gravity.CENTER (which will draw the image in the view's center).
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Click
LongClick

Members:


  Background As android.graphics.drawable.Drawable

  Bitmap As android.graphics.Bitmap

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
Bitmap As android.graphics.Bitmap
Gets or sets the bitmap assigned to the ImageView.
Example:
ImageView1.Bitmap = LoadBitmap(File.DirAssets, "someimage.jpg")
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
Gravity As Int
Gets or sets the gravity assigned to the bitmap.
Example:
ImageView1.Gravity = Gravity.Fill
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is not changed.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

Label

A Label view that shows read-only text.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Click
LongClick

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
Gravity As Int
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the text field should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.

ListView

ListView is a very useful view that can handle large and small lists.
The ListView raises two events. ItemClick is raised when an item is clicked and ItemLongClick is raised when an item is clicked and held.
See the ListView tutorial for more information.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

ItemClick (Position As Int, Value As Object)
ItemLongClick (Position As Int, Value As Object)

Members:


  AddSingleLine (Text As CharSequence)

  AddSingleLine2 (Text As CharSequence, ReturnValue As Object)

  AddTwoLines (Text1 As CharSequence, Text2 As CharSequence)

  AddTwoLines2 (Text1 As CharSequence, Text2 As CharSequence, ReturnValue As Object)

  AddTwoLinesAndBitmap (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap)

  AddTwoLinesAndBitmap2 (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap, ReturnValue As Object)

  Background As android.graphics.drawable.Drawable

  BringToFront

  Clear

  Color As Int [write only]

  Enabled As Boolean

  FastScrollEnabled As Boolean

  GetItem (Index As Int) As Object

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveAt (Index As Int)

  RemoveView

  RequestFocus As Boolean

  ScrollingBackgroundColor As Int [write only]

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetSelection (Position As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLineLayout As SingleLineLayout [read only]

  Size As Int [read only]

  Tag As Object

  Top As Int

  TwoLinesAndBitmap As TwoLinesAndBitmapLayout [read only]

  TwoLinesLayout As TwoLinesLayout [read only]

  Visible As Boolean

  Width As Int

Members description:

AddSingleLine (Text As CharSequence)
Adds a single line item.
Example:
ListView1.AddSingleLine("Sunday")
AddSingleLine2 (Text As CharSequence, ReturnValue As Object)
Adds a single line item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
Example:
ListView1.AddSingleLine2("Sunday", 1)
AddTwoLines (Text1 As CharSequence, Text2 As CharSequence)
Adds a two lines item.
Example:
ListView1.AddTwoLines("This is the first line.", "And this is the second")
AddTwoLines2 (Text1 As CharSequence, Text2 As CharSequence, ReturnValue As Object)
Adds a two lines item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
AddTwoLinesAndBitmap (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap)
Adds a two lines and a bitmap item.
Example:
ListView1.AddTwoLinesAndBitmap("First line", "Second line", LoadBitmap(File.DirAssets, "SomeImage.png"))
AddTwoLinesAndBitmap2 (Text1 As CharSequence, Text2 As CharSequence, Bitmap As android.graphics.Bitmap, ReturnValue As Object)
Adds a two lines and a bitmap item.
The specified return value will be returned when calling GetItem or in the ItemClick event.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Clear
Clears all items from the list.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
FastScrollEnabled As Boolean
Gets or sets whether the fast scroll icon will appear when the user scrolls the list.
The default is false.
GetItem (Index As Int) As Object
Returns the value of the item at the specified position.
Returns the "return value" if it was set and if not returns the text of the first line.
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveAt (Index As Int)
Removes the item at the specified position.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
ScrollingBackgroundColor As Int [write only]
Sets the background color that will be used while scrolling the list.
This is an optimization done to make the scrolling smoother.
Set to Colors.Transparent if the background behind the list is not solid color.
The default is black.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetSelection (Position As Int)
Sets the currently selected item. Calling this method will make this item visible.
If the user is interacting with the list with the keyboard or the wheel button the item will also be visibly selected.
Example:ListView1.SetSelection(10)
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLineLayout As SingleLineLayout [read only]
Returns the layout that is used to show single line items.
You can change the layout values to change the appearance of such items.
Example:
Dim Label1 As Label
Label1 = ListView1.SingleLineLayout.Label
Label1.TextSize = 20
Label1.TextColor = Colors.Green
Size As Int [read only]
Returns the number of items stored in the list.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
TwoLinesAndBitmap As TwoLinesAndBitmapLayout [read only]
Returns the layout that is used to show two lines and bitmap items.
You can change the layout values to change the appearance of such items.
For example if you want to remove the second label (in all items with this layout):
ListView1.TwoLinesAndBitmap.SecondLabel.Visible = False
TwoLinesLayout As TwoLinesLayout [read only]
Returns the layout that is used to show two lines items.
You can change the layout values to change the appearance of such items.
Example:
Dim Label1 As Label
Label1 = ListView1.TwoLinesLayout.SecondLabel
Label1.TextSize = 20
Label1.TextColor = Colors.Green
Visible As Boolean
Width As Int
Gets or sets the view's width.

Panel

A Panel is a view that holds other child views.
You can add child views programmatically or by loading a layout file.
The Panel raises the Touch event. The first parameter of this event is the Action which is one of the Activity action constants.
Return True from the Touch event sub to consume the event (otherwise other views behind the Panel will receive the event).
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Touch (Action As Int, X As Float, Y As Float)
Click
LongClick

Members:


  ACTION_DOWN As Int

  ACTION_MOVE As Int

  ACTION_UP As Int

  AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)

  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Elevation As Float

  Enabled As Boolean

  GetAllViewsRecursive As IterableList

  GetView (Index As Int) As View

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  LoadLayout (LayoutFile As String) As LayoutValues

  NumberOfViews As Int [read only]

  Padding() As Int

  Parent As Object [read only]

  RemoveAllViews

  RemoveView

  RemoveViewAt (Index As Int)

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetElevationAnimated (Duration As Int, Elevation As Float)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

ACTION_DOWN As Int
ACTION_MOVE As Int
ACTION_UP As Int
AddView (View As android.view.View, Left As Int, Top As Int, Width As Int, Height As Int)
Adds a view to this panel.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Elevation As Float
Enabled As Boolean
GetAllViewsRecursive As IterableList
Returns an iterator that iterates over all the child views including views that were added to other child views.
Example:
For Each v As View In Panel1.GetAllViewsRecursive
  ...
Next
GetView (Index As Int) As View
Gets the view that is stored in the specified index.
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
LoadLayout (LayoutFile As String) As LayoutValues
Loads a layout file to this panel. Returns the value of the chosen layout variant.
NumberOfViews As Int [read only]
Returns the number of child views.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveAllViews
Removes all child views.
RemoveView
Removes this view from its parent.
RemoveViewAt (Index As Int)
Removes the view that is stored in the specified index.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetElevationAnimated (Duration As Int, Elevation As Float)
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

ProgressBar

A progress bar view. The Progress property sets the progress value which is between 0 to 100.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

None

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  Height As Int

  Indeterminate As Boolean

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  Progress As Int

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
Height As Int
Gets or sets the view's height.
Indeterminate As Boolean
Gets or sets whether the progress bar is in indeterminate mode (cyclic animation).
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
Progress As Int
Gets or sets the progress value.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

RadioButton

A RadioButton view. Only one RadioButton in a group can be checked. When a different RadioButton is checked all others will
automatically be unchecked. Grouping is done by adding RadioButtons to the same activity or panel.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

CheckedChange(Checked As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Checked As Boolean

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  Text As String

  TextColor As Int

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Checked As Boolean
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
Gravity As Int
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the text field should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Text As String
TextColor As Int
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.

ScrollView

ScrollView is a view that contains other views and allows the user to vertically scroll those views.
See the ScrollView tutorial for more information.
The ScrollView has an inner panel which actually contains the child views.
You can add views by calling: ScrollView1.Panel.AddView(...)
Note that it is not possible to nest scrolling views. For example a multiline EditText cannot be located inside a ScrollView.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

ScrollChanged(Position As Int)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  FullScroll (Bottom As Boolean)

  Height As Int

  Initialize (Height As Int)

  Initialize2 (Height As Int, EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Panel As Panel [read only]

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  ScrollPosition As Int

  ScrollToNow (Scroll As Int)

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
FullScroll (Bottom As Boolean)
Scrolls the scroll view to the top or bottom.
Height As Int
Gets or sets the view's height.
Initialize (Height As Int)
Initializes the ScrollView and sets its inner panel height to the given height.
You can later change this height by calling ScrollView.Panel.Height.

Dim ScrollView1 As ScrollView
ScrollView1.Initialize(1000dip)
Initialize2 (Height As Int, EventName As String)
Similar to Initialize. Sets the Sub that will handle the ScrollChanged event.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Panel As Panel [read only]
Returns the panel which you can use to add views to.
Example:
ScrollView1.Panel.AddView(...)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
ScrollPosition As Int
Gets or sets the scroll position.
ScrollToNow (Scroll As Int)
Immediately scrolls the ScrollView (with no animations).
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

SeekBar

A view that allows the user to set a value by dragging a slider. Similar to WinForms TrackBar.
The ValueChanged event is raised whenever the value is changed. The UserChanged parameter can be used to distinguish between changes done by the user and changes done programmatically.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

ValueChanged (Value As Int, UserChanged As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Max As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Value As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Max As Int
Gets or sets the maximum allowed value.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Value As Int
Gets or sets the current value.
Visible As Boolean
Width As Int
Gets or sets the view's width.

Spinner

A folded list that opens when the user clicks on it and allows the user to choose an item. Similar to WinForms ComboBox.
The ItemClick event is raised each time a user presses on an item (even if it is the already selected item).
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

ItemClick (Position As Int, Value As Object)

Members:


  Add (Item As String)

  AddAll (List As List)

  Background As android.graphics.drawable.Drawable

  BringToFront

  Clear

  Color As Int [write only]

  DropdownBackgroundColor As Int

  DropdownTextColor As Int

  Enabled As Boolean

  GetItem (Index As Int) As String

  Height As Int

  IndexOf (value As String) As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  Prompt As String

  RemoveAt (Index As Int)

  RemoveView

  RequestFocus As Boolean

  SelectedIndex As Int

  SelectedItem As String [read only]

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Size As Int [read only]

  Tag As Object

  TextColor As Int

  TextSize As Float

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Add (Item As String)
Adds an item.
Example:
Spinner1.Add("Sunday")
AddAll (List As List)
Adds multiple items.
Example:
Spinner1.AddAll(Array As String("Sunday", "Monday", ...))
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Clear
Clears all items.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
DropdownBackgroundColor As Int
Gets or sets the dropdown items background color. The color should be set before adding items.
Setting the color to transparent will make the spinner use the default background color.
DropdownTextColor As Int
Gets or sets the dropdown text color. The color should be set before adding items.
Setting the color to transparent will make the spinner use the default text color.
Enabled As Boolean
GetItem (Index As Int) As String
Returns the item at the specified index.
Height As Int
Gets or sets the view's height.
IndexOf (value As String) As Int
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
Prompt As String
Gets or sets the title that will be displayed when the spinner is opened.
RemoveAt (Index As Int)
Removes the item at the specified index.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SelectedIndex As Int
Gets or sets the index of the selected item. Returns -1 if no item is selected.
SelectedItem As String [read only]
Returns the value of the selected item.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Size As Int [read only]
Returns the number of items.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
TextColor As Int
Gets or sets the text color. The color should be set before adding items.
Setting the color to transparent will make the spinner use the default text color.
TextSize As Float
Gets or sets the text size. The size should be set before adding items.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

TabHost

TabHost is a view that contains multiple tab pages. Each tab page contains other child views.
See the TabHost tutorial for more information.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

TabChanged
Click
LongClick

Members:


  AddTab (Title As String, LayoutFile As String)

  AddTab2 (Title As String, View As android.view.View)

  AddTabWithIcon (Title As String, DefaultBitmap As android.graphics.Bitmap, SelectedBitmap As android.graphics.Bitmap, LayoutFile As String)

  AddTabWithIcon2 (Title As String, DefaultBitmap As android.graphics.Bitmap, SelectedBitmap As android.graphics.Bitmap, View As android.view.View)

  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  CurrentTab As Int

  Enabled As Boolean

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  TabCount As Int [read only]

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

AddTab (Title As String, LayoutFile As String)
Adds a tab page.
Title - The page title.
LayoutFile - A layout file describing the page layout.
Example:
TabHost1.AddTab("Page 1", "page1.bal")
AddTab2 (Title As String, View As android.view.View)
Adds a tab page.
Title - The page title.
View - The page content. Usually the view should be a panel containing other views.
AddTabWithIcon (Title As String, DefaultBitmap As android.graphics.Bitmap, SelectedBitmap As android.graphics.Bitmap, LayoutFile As String)
Adds a tab page. The tab title includes an icon.
Title - The page title.
DefaultBitmap - The icon that will be drawn when the page is not selected.
SelectedBitmap - The icon that will be drawn when the page is selected.
LayoutFile - A layout file describing the page layout.
Example:
Dim bmp1, bmp2 As Bitmap
bmp1 = LoadBitmap(File.DirAssets, "ic.png")
bmp2 = LoadBitmap(File.DirAssets, "ic_selected.png")
TabHost1.AddTabWithIcon("Page 1", bmp1, bmp2,"tabpage1.bal")
AddTabWithIcon2 (Title As String, DefaultBitmap As android.graphics.Bitmap, SelectedBitmap As android.graphics.Bitmap, View As android.view.View)
Adds a tab page. The tab title includes an icon.
Title - The page title.
DefaultBitmap - The icon that will be drawn when the page is not selected.
SelectedBitmap - The icon that will be drawn when the page is selected.
View - The page content. Usually the view should be a panel containing other views.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
CurrentTab As Int
Gets or sets the current tab.
Example:
TabHost1.CurrentTab = (TabHost1.CurrentTab + 1) Mod TabHost1.TabCount 'switch to the next tab.
Enabled As Boolean
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
TabCount As Int [read only]
Returns the number of tab pages.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

ToggleButton

A ToggleButton view. This view which is similar to a button has two modes: ON and OFF.
When the user presses on it, it will change its mode.
You can set the text with the TextOn and TextOff properties.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

CheckedChange(Checked As Boolean)

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Checked As Boolean

  Color As Int [write only]

  Ellipsize As String

  Enabled As Boolean

  Gravity As Int

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetTextColorAnimated (Duration As Int, ToColor As Int)

  SetTextSizeAnimated (Duration As Int, TextSize As Float)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  SingleLine As Boolean [write only]

  Tag As Object

  TextColor As Int

  TextOff As String

  TextOn As String

  TextSize As Float

  Top As Int

  Typeface As android.graphics.Typeface

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Checked As Boolean
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Ellipsize As String
Gets or sets the truncation mode. Only affects single line fields.
Possible values:
NONE
START - The three dots appear at the beginning.
MIDDLE - The three dots appear at the middle.
END - The three dots appear at the end.
Enabled As Boolean
Gravity As Int
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextColorAnimated (Duration As Int, ToColor As Int)
Changes the text color with a transition animation between the current color and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetTextSizeAnimated (Duration As Int, TextSize As Float)
Changes the text size with an animation effect.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
SingleLine As Boolean [write only]
Sets whether the text field should be in single line mode or multiline mode.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
TextColor As Int
TextOff As String
Gets or sets the text that will appear in the OFF mode.
TextOn As String
Gets or sets the text that will appear in the ON mode.
TextSize As Float
Get or sets the view's text size.
Top As Int
Gets or sets the view's top position.
Typeface As android.graphics.Typeface
Visible As Boolean
Width As Int
Gets or sets the view's width.

View

View is a special type of object. You cannot create new View objects. However all other view types can be assigned to a view variable.
This allows you to access the shared properties of all views.
For example this code hides all views of an activity:
For i = 0 To Activity.NumberOfViews - 1
  Dim v As View
  v = Activity.GetView(i)
  v.Visible = False
Next

This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

Click
LongClick

Members:


  Background As android.graphics.drawable.Drawable

  BringToFront

  Color As Int [write only]

  Enabled As Boolean

  Height As Int

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  Left As Int

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  Tag As Object

  Top As Int

  Visible As Boolean

  Width As Int

Members description:

Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
Height As Int
Gets or sets the view's height.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
Left As Int
Gets or sets the view's left position.
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Visible As Boolean
Width As Int
Gets or sets the view's width.

WebView

The WebView view uses the internal WebKit engine to display Html pages.
The page displayed can be an online page loaded with LoadUrl or a Html string loaded with LoadHtml.
The PageFinished event is raised after the page loads.
OverrideUrl is called before loading any Url. If this method returns True then the Url will not be loaded.
You can use this event as a way to handle click events in your code.
UserAndPasswordRequired event is raised when accessing a site that requires basic authentication.
You should return an array of strings with the username as the first element and password as the second element.
For example:Return Array As String("someuser", "password123")
Returning Null will cancel the request.
Sending incorrect credentials will cause this event to be raised again.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Permissions:

android.permission.INTERNET

Events:

PageFinished (Url As String)
OverrideUrl (Url As String) As Boolean
UserAndPasswordRequired (Host As String, Realm As String) As String()

Members:


  Back

  Background As android.graphics.drawable.Drawable

  BringToFront

  CaptureBitmap As Bitmap

  Color As Int [write only]

  Enabled As Boolean

  Forward

  Height As Int

  Initialize (EventName As String)

  Invalidate

  Invalidate2 (Rect As android.graphics.Rect)

  Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)

  IsInitialized As Boolean

  JavaScriptEnabled As Boolean

  Left As Int

  LoadHtml (Html As String)

  LoadUrl (Url As String)

  Padding() As Int

  Parent As Object [read only]

  RemoveView

  RequestFocus As Boolean

  SendToBack

  SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable

  SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)

  SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)

  SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)

  SetVisibleAnimated (Duration As Int, Visible As Boolean)

  StopLoading

  Tag As Object

  Top As Int

  Url As String [read only]

  Visible As Boolean

  Width As Int

  Zoom (In As Boolean) As Boolean

  ZoomEnabled As Boolean

Members description:

Back
Goes back to the previous Url.
Background As android.graphics.drawable.Drawable
Gets or sets the background drawable.
BringToFront
Changes the Z order of this view and brings it to the front.
CaptureBitmap As Bitmap
Returns the complete html page as a bitmap.
Color As Int [write only]
Sets the background of the view to be a ColorDrawable with the given color.
If the current background is of type GradientDrawable or ColorDrawable the round corners will be kept.
Enabled As Boolean
Forward
Goes forward to the next Url.
Height As Int
Gets or sets the view's height.
Initialize (EventName As String)
Initializes the view and sets the subs that will handle the events.
Views added with the designer should NOT be initialized. These views are initialized when the layout is loaded.
Invalidate
Invalidates the whole view forcing the view to redraw itself.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate2 (Rect As android.graphics.Rect)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
Invalidate3 (Left As Int, Top As Int, Right As Int, Bottom As Int)
Invalidates the given rectangle.
Redrawing will only happen when the program can process messages. Usually when it finishes running the current code.
IsInitialized As Boolean
JavaScriptEnabled As Boolean
Gets or sets whether JavaScript is enabled.
JavaScript is enabled by default.
Left As Int
Gets or sets the view's left position.
LoadHtml (Html As String)
Loads the given Html.
Example:
WebView1.LoadHtml("<html><body>Hello world!</body></html>")

You can use "file:///android_asset" to access files added with the file manager:
WebView1.LoadHtml("<html><body><img src='file:///android_asset/someimage.jpg'/></body></html>")
Note that files added with the file manager should be accessed with a lower cased name.
LoadUrl (Url As String)
Loads the given Url.
Example:
WebView1.LoadUrl("http://www.google.com")
Padding() As Int
Gets or sets the view's padding (distance between border and content).
The data is stored in a 4 element array with the following values: left, top, right and bottom.
Make sure to use 'dip' units when setting the padding.
Example: Button1.Padding = Array As Int (30dip, 10dip, 10dip, 10dip)
Parent As Object [read only]
Returns the view's parent. In most cases the returned value can be casted to a Panel.
Returns Null if there is no parent.
RemoveView
Removes this view from its parent.
RequestFocus As Boolean
Tries to set the focus to this view.
Returns True if the focus was set.
SendToBack
Changes the Z order of this view and sends it to the back.
SetBackgroundImage (Bitmap As android.graphics.Bitmap) As BitmapDrawable
Creates a BitmapDrawable with the given Bitmap and sets it as the view's background. The Gravity is set to FILL.
The BitmapDrawable is returned. You can use it to change the Gravity.
SetColorAnimated (Duration As Int, FromColor As Int, ToColor As Int)
Changes the background color with a transition animation between the FromColor and the ToColor colors.
The transition is based on the HSV color space.
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetLayout (Left As Int, Top As Int, Width As Int, Height As Int)
Changes the view position and size.
SetLayoutAnimated (Duration As Int, Left As Int, Top As Int, Width As Int, Height As Int)
Similar to SetLayout. Animates the change. Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
SetVisibleAnimated (Duration As Int, Visible As Boolean)
Changes the view visibility with a fade-in or fade-out animation.
You must
Note that the animation will only be applied when running on Android 3+ devices.
Duration - Animation duration measured in milliseconds.
Visible - New visibility state.
StopLoading
Stops the current load.
Tag As Object
Gets or sets the Tag value. This is a place holder which can used to store additional data.
Top As Int
Gets or sets the view's top position.
Url As String [read only]
Returns the current Url.
Visible As Boolean
Width As Int
Gets or sets the view's width.
Zoom (In As Boolean) As Boolean
Zooms in or out according to the value of In.
Returns true if zoom has changed.
ZoomEnabled As Boolean
Gets or sets whether the internal zoom feature is enabled.
The zoom feature is enabled by default.
Top