Which Is Not A Legal Character In An App Inventor Project Name?
« Back to index
User Interface
Table of Contents:
- Button
- CheckBox
- DatePicker
- Image
- Label
- ListPicker
- ListView
- Notifier
- PasswordTextBox
- Screen
- Slider
- Spinner
- Switch
- TextBox
- TimePicker
- WebViewer
Button
Button with the ability to detect clicks. Many aspects of its appearance can be changed, as well as whether it is clickable (Enabled). Its properties can be changed in the Designer or in the Blocks Editor.
Properties
- BackgroundColor
- Specifies the
Button's background color as an alpha-red-green-blue integer. If anImagehas been set, the color change will not be visible until theImageis removed. - Enabled
- Specifies whether the
Buttonshould be active and clickable. - FontBold
- Specifies whether the text of the
Buttonshould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
Buttonshould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
Button, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
Buttonas default, serif, sans serif, or monospace. - Height
- Specifies the
Button's vertical height, measured in pixels. - HeightPercent
- Specifies the
Button's vertical height as a percentage of theScreen'sHeight. - Image
- Specifies the path of the
Button's image. If there is both anImageand aBackgroundColorspecified, only theImagewill be visible. - Shape
- Specifies the shape of the
Button. The valid values for this property are0(default),1(rounded),2(rectangle), and3(oval). TheShapewill not be visible if anImageis used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
Buttonwith an assignedImageis pressed. - Text
- Specifies the text displayed by the
Button. - TextAlignment
- Specifies the alignment of the
Button's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
Buttonas an alpha-red-green-blue integer. - Visible
- Specifies whether the
Buttonshould be visible on the screen. Value istrueif theButtonis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Button, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Buttonas a percentage of theScreen'sWidth.
Events
- Click()
- Indicates that the user tapped and released the
Button. - GotFocus()
- Indicates the cursor moved over the
Buttonso it is now possible to click it. - LongClick()
- Indicates that the user held the
Buttondown. - LostFocus()
- Indicates the cursor moved away from the
Buttonso it is now no longer possible to click it. - TouchDown()
- Indicates that the
Buttonwas pressed down. - TouchUp()
- Indicates that the
Buttonhas been released.
Methods
None
CheckBox
CheckBox components can detect user taps and can change their boolean state in response.
A CheckBox component raises an event when the user taps it. There are many properties affecting its appearance that can be set in the Designer or Blocks Editor.
Properties
- BackgroundColor
- Specifies the background color of the
CheckBoxas an alpha-red-green-blue integer. - Checked
- Set to
trueif the box is checked,falseotherwise. - Enabled
- Specifies whether the
CheckBoxshould be active and clickable. - FontBold
- Specifies whether the text of the
CheckBoxshould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
CheckBoxshould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
CheckBox, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
CheckBoxas default, serif, sans serif, or monospace. - Height
- Specifies the
CheckBox's vertical height, measured in pixels. - HeightPercent
- Specifies the
CheckBox's vertical height as a percentage of theScreen'sHeight. - Text
- Specifies the text displayed by the
CheckBox. - TextColor
- Specifies the text color of the
CheckBoxas an alpha-red-green-blue integer. - Visible
- Specifies whether the
CheckBoxshould be visible on the screen. Value istrueif theCheckBoxis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
CheckBox, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
CheckBoxas a percentage of theScreen'sWidth.
Events
- Changed()
- User tapped and released the
CheckBox. - GotFocus()
-
CheckBoxbecame the focused component. - LostFocus()
-
CheckBoxstopped being the focused component.
Methods
None
DatePicker
A button that, when clicked on, launches a popup dialog to allow the user to select a date on the Gregorian Calendar.
Note: Date and time are manipulated using methods in the Clock component.
Properties
- BackgroundColor
- Specifies the
DatePicker's background color as an alpha-red-green-blue integer. If anImagehas been set, the color change will not be visible until theImageis removed. - Day
- Returns the Day of the month that was last picked using the DatePicker.
- Enabled
- Specifies whether the
DatePickershould be active and clickable. - FontBold
- Specifies whether the text of the
DatePickershould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
DatePickershould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
DatePicker, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
DatePickeras default, serif, sans serif, or monospace. - Height
- Specifies the
DatePicker's vertical height, measured in pixels. - HeightPercent
- Specifies the
DatePicker's vertical height as a percentage of theScreen'sHeight. - Image
- Specifies the path of the
DatePicker's image. If there is both anImageand aBackgroundColorspecified, only theImagewill be visible. - Instant
- Returns instant of the date that was last picked using the DatePicker.
- Month
- Returns the number of the Month that was last picked using the DatePicker.
- MonthInText
- Returns the name of the Month that was last picked using the DatePicker.
- Shape
- Specifies the shape of the
DatePicker. The valid values for this property are0(default),1(rounded),2(rectangle), and3(oval). TheShapewill not be visible if anImageis used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
DatePickerwith an assignedImageis pressed. - Text
- Specifies the text displayed by the
DatePicker. - TextAlignment
- Specifies the alignment of the
DatePicker's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
DatePickeras an alpha-red-green-blue integer. - Visible
- Specifies whether the
DatePickershould be visible on the screen. Value istrueif theDatePickeris showing andfalseif hidden. - Width
- Specifies the horizontal width of the
DatePicker, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
DatePickeras a percentage of theScreen'sWidth. - Year
- Returns the Year that was last picked using the DatePicker.
Events
- AfterDateSet()
- Event that runs after the user chooses a Date in the dialog.
- GotFocus()
- Indicates the cursor moved over the
DatePickerso it is now possible to click it. - LostFocus()
- Indicates the cursor moved away from the
DatePickerso it is now no longer possible to click it. - TouchDown()
- Indicates that the
DatePickerwas pressed down. - TouchUp()
- Indicates that the
DatePickerhas been released.
Methods
- LaunchPicker()
- Launches the DatePicker dialog. The
AfterDateSetevent will be run after the user confirms their selection. - SetDateToDisplay(year,month,day)
- Allows the user to set the date to be displayed when the date picker opens. Valid values for the month field are 1-12 and 1-31 for the day field.
- SetDateToDisplayFromInstant(instant)
- Allows the user to set the date from the instant to be displayed when the date picker opens.
Image
Component for displaying images and basic animations.
The picture to display, and other aspects of the Image's appearance, can be specified in the Designer or in the Blocks Editor.
Properties
- AlternateText
- A written description of what the image looks like.
- Animation
- This is a limited form of animation that can attach a small number of motion types to images. The allowable motions are
ScrollRightSlow,ScrollRight,ScrollRightFast,ScrollLeftSlow,ScrollLeft,ScrollLeftFast, andStop. - Clickable
- Specifies whether the image should be clickable or not.
- Height
- Specifies the
Image's vertical height, measured in pixels. - HeightPercent
- Specifies the
Image's vertical height as a percentage of theScreen'sHeight. - Picture
- Specifies the path of the
Image'sPicture. - RotationAngle
- The angle at which the image picture appears rotated. This rotation does not appear on the designer screen, only on the device.
- ScalePictureToFit
- Specifies whether the image should be resized to match the size of the ImageView.
- Scaling
- This property determines how the picture scales according to the Height or Width of the Image. Scale proportionally (0) preserves the picture aspect ratio. Scale to fit (1) matches the Image area, even if the aspect ratio changes.
- Visible
- Specifies whether the
Imageshould be visible on the screen. Value istrueif theImageis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Image, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Imageas a percentage of theScreen'sWidth.
Events
- Click()
- An event that occurs when an image is clicked.
Methods
None
Label
Labels are components used to show text.
A label displays text which is specified by the Text property. Other properties, all of which can be set in the Designer or Blocks Editor, control the appearance and placement of the text.
Properties
- BackgroundColor
- Specifies the label's background color as an alpha-red-green-blue integer.
- FontBold
- Specifies whether the label's text should be bold. Some fonts do not support bold.
- FontItalic
- Specifies whether the label's text should be italic. Some fonts do not support italic.
- FontSize
- Specifies the label's text's font size, measured in sp(scale-independent pixels).
- FontTypeface
- Specifies the label's text's font face as default, serif, sans serif, or monospace.
- HTMLContent
- Returns the content of the Label as HTML. This is only useful if the HTMLFormat property is true.
- HTMLFormat
- Specifies the label's text's format
- HasMargins
- Specifies whether the label should have margins. This margin value is not well coordinated with the designer, where the margins are defined for the arrangement, not just for individual labels.
- Height
- Specifies the
Label's vertical height, measured in pixels. - HeightPercent
- Specifies the
Label's vertical height as a percentage of theScreen'sHeight. - Text
- Specifies the text displayed by the label.
- TextAlignment
- Specifies the alignment of the label's text: center, normal (e.g., left-justified if text is written left to right), or opposite (e.g., right-justified if text is written left to right).
- TextColor
- Specifies the label's text color as an alpha-red-green-blue integer.
- Visible
- Specifies whether the
Labelshould be visible on the screen. Value istrueif theLabelis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Label, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Labelas a percentage of theScreen'sWidth.
Events
None
Methods
None
ListPicker
A button that, when clicked on, displays a list of texts for the user to choose among. The texts can be specified through the Designer or Blocks Editor by setting the ElementsFromString property to their string-separated concatenation (for example, choice 1, choice 2, choice 3) or by setting the Elements property to a List in the Blocks editor.
Setting property ShowFilterBar to true, will make the list searchable. Other properties affect the appearance of the button (TextAlignment, BackgroundColor, etc.) and whether it can be clicked on (Enabled).
Properties
- BackgroundColor
- Specifies the
ListPicker's background color as an alpha-red-green-blue integer. If anImagehas been set, the color change will not be visible until theImageis removed. - Elements
- Specifies the list of choices to display.
- ElementsFromString
- Set the list of choices from a string of comma-separated values.
- Enabled
- Specifies whether the
ListPickershould be active and clickable. - FontBold
- Specifies whether the text of the
ListPickershould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
ListPickershould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
ListPicker, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
ListPickeras default, serif, sans serif, or monospace. - Height
- Specifies the
ListPicker's vertical height, measured in pixels. - HeightPercent
- Specifies the
ListPicker's vertical height as a percentage of theScreen'sHeight. - Image
- Specifies the path of the
ListPicker's image. If there is both anImageand aBackgroundColorspecified, only theImagewill be visible. - ItemBackgroundColor
- The background color of the
ListPickeritems. - ItemTextColor
- The text color of the ListPicker items.
- Selection
- The selected item. When directly changed by the programmer, the
SelectionIndexproperty is also changed to the first item in theListPickerwith the given value. If the value is not inElements,SelectionIndexwill be set to 0. - SelectionIndex
- Selection index property setter method.
- Shape
- Specifies the shape of the
ListPicker. The valid values for this property are0(default),1(rounded),2(rectangle), and3(oval). TheShapewill not be visible if anImageis used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
ListPickerwith an assignedImageis pressed. - ShowFilterBar
- If
true, the ListPicker will show a search filter bar. - Text
- Specifies the text displayed by the
ListPicker. - TextAlignment
- Specifies the alignment of the
ListPicker's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
ListPickeras an alpha-red-green-blue integer. - Title
- Optional title displayed at the top of the list of choices.
- Visible
- Specifies whether the
ListPickershould be visible on the screen. Value istrueif theListPickeris showing andfalseif hidden. - Width
- Specifies the horizontal width of the
ListPicker, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
ListPickeras a percentage of theScreen'sWidth.
Events
- AfterPicking()
- Event to be raised after the
ListPickeractivity returns its result and the properties have been filled in. - BeforePicking()
- Event to raise when the
ListPickeris clicked or the picker is shown using theOpenmethod. This event occurs before the picker is displayed, and can be used to prepare the picker before it is shown. - GotFocus()
- Indicates the cursor moved over the
ListPickerso it is now possible to click it. - LostFocus()
- Indicates the cursor moved away from the
ListPickerso it is now no longer possible to click it. - TouchDown()
- Indicates that the
ListPickerwas pressed down. - TouchUp()
- Indicates that the
ListPickerhas been released.
Methods
- Open()
- Opens the
ListPicker, as though the user clicked on it.
ListView
This is a visible component that displays a list of text and image elements in your Screen to display. Simple lists of strings may be set using the ElementsFromString property. More complex lists of elements containing multiple strings and/or images can be created using the ListData and ListViewLayout properties.
Information on Layouts
Warning: This component will not work correctly on Screens that are scrollable if its Height is set to Fill Parent.
Properties
- BackgroundColor
- The color of the
ListViewbackground. - Elements
- Specifies the list of choices to display.
- ElementsFromString
- Set the list of choices specified as a string with the elements separated by commas such as: Cheese,Fruit,Bacon,Radish.
- FontSizeDetail
- Specifies the
ListViewitem's text font size - FontTypeface
- Specifies the label's text's font face as default, serif, sans serif, or monospace.
- FontTypefaceDetail
- Specifies the label's text's font face as default, serif, sans serif, or monospace.
- Height
- Specifies the
ListView's vertical height, measured in pixels. - HeightPercent
- Specifies the
ListView's vertical height as a percentage of theScreen'sHeight. - ImageHeight
- Specifies the image height of ListView layouts containing images
- ImageWidth
- Specifies the image width of ListView layouts containing images
- ListData
- Specifies data to be displayed in the ListView elements. This property sets the elements specified in
ListViewLayout. For example, if the chosen layout isImage,MainTextthis property will allow any number of elements to be defined, each containing a filename for Image and a string for MainText. Designer only property. - ListViewLayout
- Specifies type of layout for ListView row. Designer only property.
- Orientation
- Specifies the layout's orientation. This may be:
Vertical, which displays elements in rows one after the other; orHorizontal, which displays one element at a time and allows the user to swipe left or right to brows the elements. - Selection
- Returns the text in the
ListViewat the position ofSelectionIndex. - SelectionColor
- The color of the item when it is selected.
- SelectionDetailText
- Returns the Secondary or Detail text in the ListView at the position set by SelectionIndex
- SelectionIndex
- The index of the currently selected item, starting at
1. If no item is selected, the value will be0. If an attempt is made to set this to a number less than1or greater than the number of items in theListView,SelectionIndexwill be set to0, andSelectionwill be set to the empty text. - ShowFilterBar
- Sets visibility of the filter bar.
truewill show the bar,falsewill hide it. - TextColor
- The text color of the
ListViewitems. - TextColorDetail
- Specifies the color of the secondary text in a ListView layout
- TextSize
- Specifies the
ListViewitem's text font size - Visible
- Specifies whether the
ListViewshould be visible on the screen. Value istrueif theListViewis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
ListView, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
ListViewas a percentage of theScreen'sWidth.
Events
- AfterPicking()
- Simple event to be raised after the an element has been chosen in the list. The selected element is available in the
Selectionproperty.
Methods
- CreateElement(mainText,detailText,imageName)
- Creates a
- GetDetailText(listElement)
- Get the Detail Text of a ListView element.
- GetImageName(listElement)
- Get the filename of the image of a ListView element that has been uploaded to Media.
- GetMainText(listElement)
- Get the Main Text of a ListView element.
- Refresh()
- Reload the ListView to reflect any changes in the data.
Notifier
The Notifier component displays alert messages and creates Android log entries through an assortment of methods.
Properties
- BackgroundColor
- Specifies the background color for alerts (not dialogs).
- NotifierLength
- Specifies the length of time that the alert is shown – either "short" or "long".
- TextColor
- Specifies the text color for alerts (not dialogs).
Events
- AfterChoosing(choice)
- Event after the user has made a selection for
ShowChooseDialog. - AfterTextInput(response)
- Event raised after the user has responded to
ShowTextDialog. - ChoosingCanceled()
- Event raised when the user cancels choosing an option.
ShowChooseDialog. - TextInputCanceled()
- Event raised when the user cancels
ShowPasswordDialog, orShowTextDialog.
Methods
- DismissProgressDialog()
- Dismisses the alert created by the ShowProgressDialog block
- LogError(message)
- Writes an error message to the Android system log. See the Google Android documentation for how to access the log.
- LogInfo(message)
- Writes an information message to the Android log.
- LogWarning(message)
- Writes a warning message to the Android log. See the Google Android documentation for how to access the log.
- ShowAlert(notice)
- Display a temporary notification.
- ShowChooseDialog(message,title,button1Text,button2Text,cancelable)
- Shows a dialog box with two buttons, from which the user can choose. If
cancelableistruethere will be an additional CANCEL button. Pressing a button will raise theAfterChoosingevent. The "choice" parameter toAfterChoosingwill be the text on the button that was pressed, or "Cancel" if the CANCEL button was pressed. If canceled, theTextInputCanceledevent will also run. - ShowMessageDialog(message,title,buttonText)
- Display an alert dialog with a single button that dismisses the alert.
- ShowPasswordDialog(message,title,cancelable)
- Shows a dialog box where the user can enter password (input is masked), after which the
AfterTextInputevent will be raised. Ifcancelableistruethere will be an additional CANCEL button. TheAfterTextInputandTextInputCanceledevents behave the same way as described inShowTextDialog. - ShowProgressDialog(message,title)
- Shows a dialog box with an optional title and message (use empty strings if they are not wanted). This dialog box contains a spinning artifact to indicate that the program is working. It cannot be canceled by the user but must be dismissed by the App Inventor Program by using the
DismissProgressDialogmethod. - ShowTextDialog(message,title,cancelable)
- Shows a dialog box where the user can enter text, after which the
AfterTextInputevent will be raised. Ifcancelableistruethere will be an additional CANCEL button. Entering text will raise theAfterTextInputevent. The "response" parameter toAfterTextInputwill be the text that was entered, or "Cancel" if the CANCEL button was pressed. If canceled, theTextInputCanceledevent will also run.
PasswordTextBox
Users enter passwords in a password text box component, which hides the text that has been typed in it.
A password text box is the same as the ordinary TextBox component, except that it does not display the characters typed by the user.
You can get or set the value of the text in the box with the Text property. If Text is blank, you can use the Hint property to provide the user with a suggestion of what to type. The Hint appears as faint text in the box.
Password text box components are usually used with a Button component. The user taps the Button after entering text.
Properties
- BackgroundColor
- The background color of the
PasswordTextBox`. You can choose a color by name in the Designer or in the Blocks Editor. The default background color is 'default' (shaded 3-D look). - Enabled
- If set, user can enter text into the
PasswordTextBox. - FontBold
- Specifies whether the text of the
PasswordTextBoxshould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
PasswordTextBoxshould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
PasswordTextBox, measured in sp(scale-independent pixels). - FontTypeface
- The text font face of the
PasswordTextBox. Valid values are0(default),1(serif),2(sans serif), or3(monospace). - Height
- Specifies the
PasswordTextBox's vertical height, measured in pixels. - HeightPercent
- Specifies the
PasswordTextBox's vertical height as a percentage of theScreen'sHeight. - Hint
-
PasswordTextBoxhint for the user. - NumbersOnly
- If true, then this
PasswordTextBoxaccepts only numbers as keyboard input. Numbers can include a decimal point and an optional leading minus sign. This applies to keyboard input only. Even ifNumbersOnlyis true, you can set the text to anything at all using the [Text`](#PasswordTextBox.Text) property. - PasswordVisible
- Specifies whether the password is hidden (default) or shown.
- Text
- The text in the
PasswordTextBox, which can be set by the programmer in the Designer or Blocks Editor, or it can be entered by the user (unless theEnabledproperty is false). - TextAlignment
- Specifies the alignment of the
PasswordTextBox's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
PasswordTextBoxas an alpha-red-green-blue integer. - Visible
- Specifies whether the
PasswordTextBoxshould be visible on the screen. Value istrueif thePasswordTextBoxis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
PasswordTextBox, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
PasswordTextBoxas a percentage of theScreen'sWidth.
Events
- GotFocus()
- Event raised when the
PasswordTextBoxis selected for input, such as by the user touching it. - LostFocus()
- Event raised when the
PasswordTextBoxis no longer selected for input, such as if the user touches a different text box.
Methods
- RequestFocus()
- Request focus to current
PasswordTextBox.
Screen
Top-level component containing all other components in the program.
Properties
- AboutScreen
- Information about the screen. It appears when "About this Application" is selected from the system menu. Use it to tell users about your app. In multiple screen apps, each screen has its own
AboutScreeninfo. - AccentColor
- This is the accent color used for highlights and other user interface accents in newer versions of Android. Components affected by this property include dialogs created by the
Notifier, theDatePicker, and others. - AlignHorizontal
- A number that encodes how contents of the screen are aligned horizontally. The choices are:
1(left aligned),3(horizontally centered),2(right aligned). - AlignVertical
- A number that encodes how the contents of the arrangement are aligned vertically. The choices are:
1(aligned at the top),2(vertically centered),3(aligned at the bottom). Vertical alignment has no effect if the screen is scrollable. - AppName
- This is the display name of the installed application in the phone. If the
AppNameis blank, it will be set to the name of the project when the project is built. - BackgroundColor
- Specifies the
Screen's background color as an alpha-red-green-blue integer. If anBackgroundImagehas been set, the color change will not be visible until theBackgroundImageis removed. - BackgroundImage
- Specifies the path of the
Screen's background image. If there is both anBackgroundImageand aBackgroundColorspecified, only theBackgroundImagewill be visible. - BigDefaultText
- When checked, all default size text will be increased in size.
- BlocksToolkit
- A JSON string representing the subset for the screen. Authors of template apps can use this to control what components, designer properties, and blocks are available in the project.
- CloseScreenAnimation
- Sets the animation type for the transition of this form closing and returning to a form behind it in the activity stack.
- DefaultFileScope
- Specifies the default scope used when components access files. Note that the
Filecomponent has its own property for controlling file scopes. - Height
- Returns the Screen height in pixels (y-size).
- HighContrast
- When checked, there will be high contrast mode turned on.
- Icon
- The image used for your App's display icon should be a square png or jpeg image with dimensions up to 1024x1024 pixels. Larger images may cause compiling or installing the app to fail. The build server will generate images of standard dimensions for Android devices.
- OpenScreenAnimation
- Sets the animation type for the transition of this form opening.
- Platform
- Gets the name of the underlying platform running the app. Currently, this is the text "Android". Other platforms may be supported in the future.
- PlatformVersion
- Gets the version number of the platform running the app. This is typically a dotted version number, such as 10.0. Any value can be returned, however, so you should take care to handle unexpected data. If the platform version is unavailable, the empty text will be returned.
- PrimaryColor
- This is the primary color used as part of the Android theme, including coloring the
Screen's title bar. - PrimaryColorDark
- This is the primary color used when the Theme property is specified to be Dark. It applies to a number of elements, including the
Screen's title bar. - ScreenOrientation
- Declares the requested screen orientation, specified as a text value. Commonly used values are
landscape,portrait,sensor,userandunspecified. See the Android developer documentation for the complete list of possible options. - Scrollable
- When checked, there will be a vertical scrollbar on the screen, and the height of the application can exceed the physical height of the device. When unchecked, the application height is constrained to the height of the device.
- ShowListsAsJson
- If
true(the default), lists will be shown as strings in JSON/Python notation for example [1, "a", true]. Iffalse, lists will be shown in the LISP notation, for example (1 a true).Note: This property appears only in Screen1 and the value for Screen1 determines the behavior for all screens in the app.
- ShowStatusBar
- The status bar is the topmost bar on the screen. This property reports whether the status bar is visible.
- Sizing
- If set to responsive (the default), screen layouts will use the actual resolution of the device. See the documentation on responsive design in App Inventor for more information. If set to fixed, screen layouts will be created for a single fixed-size screen and autoscaled.
Note: This property appears on Screen1 only and controls the sizing for all screens in the app.
- Theme
- Selects the theme for the application. Theme can only be set at compile time and the Companion will approximate changes during live development. Possible options are:
-
Classic, which is the same as older versions of App Inventor; -
Device Default, which gives the same theme as the version of Android running on the device and uses PrimaryColor for the Action Bar and has light buttons; -
Black Title Text, which is theDevice Defaulttheme but with black title text; and -
Dark, which is a dark version of theDevice Defaulttheme usingPrimaryColorDarkand having dark grey components.
-
- Title
- Title property setter method: sets a new caption for the form in the form's title bar.
- TitleVisible
- The title bar is the top gray bar on the screen. This property reports whether the title bar is visible.
- TutorialURL
- A URL which will be opened on the left side panel (which can be toggled once it is open). This is intended for projects that have an in-line tutorial as part of the project. For security reasons, only tutorials hosted on http://appinventor.mit.edu or linked to from our URL shortener (http://appinv.us) may be used here. Other URLs will be silently ignored.
- VersionCode
- An integer value which must be incremented each time a new Android Application Package File (APK) is created for the Google Play Store.
- VersionName
- A string which can be changed to allow Google Play Store users to distinguish between different versions of the App.
- Width
- Returns the Screen width in pixels (x-size).
Events
- BackPressed()
- Device back button pressed.
- ErrorOccurred(component,functionName,errorNumber,message)
- Event raised when an error occurs. Only some errors will raise this condition. For those errors, the system will show a notification by default. You can use this event handler to prescribe an error behavior different than the default.
- Initialize()
- The Initialize event is run when the Screen starts and is only run once per screen.
- OtherScreenClosed(otherScreenName,result)
- Event raised when another screen has closed and control has returned to this screen.
- PermissionDenied(component,functionName,permissionName)
- Event to handle when the app user has denied a needed permission.
- PermissionGranted(permissionName)
- Event to handle when the app user has granted a needed permission. This event is only run when permission is granted in response to the
AskForPermissionmethod. - ScreenOrientationChanged()
- Screen orientation changed
Methods
- AskForPermission(permissionName)
- Ask the user to grant access to a sensitive permission, such as
ACCESS_FINE_LOCATION. This block is typically used as part of aPermissionDeniedevent to ask for permission. If the user grants permission, thePermissionGrantedevent will be run. If the user denies permission, thePermissionDeniedevent will be run.Note: It is a best practice to only ask for permissions at the time they are needed, which App Inventor components will do when necessary. You should not use
AskForPermissionin yourInitializeevent unless access to that permission is critical to the behavior of your app and is needed up front, such as location services for a navigation app. - HideKeyboard()
- Hide the soft keyboard
Slider
This class is used to display a Slider.
A Slider is a progress bar that adds a draggable thumb. You can touch the thumb and drag left or right to set the slider thumb position. As the Slider thumb is dragged, it will trigger the PositionChanged event, reporting the position of the Slider thumb. The reported position of the thumb can be used to dynamically update another component attribute, such as the TextBox's FontSize of a TextBox or the Radius of a Ball.
The Slider uses the following default values. However these values can be changed through the Designer or Blocks editor:
-
MinValue= 10 -
MaxValue= 50 -
ThumbPosition= 30
Properties
- ColorLeft
- Specifies the color of the slider bar to the left of the thumb as an alpha-red-green-blue integer, i.e.,
0xAARRGGBB. An alpha of00indicates fully transparent andFFmeans opaque. - ColorRight
- Specifies the color of the slider bar to the right of the thumb as an alpha-red-green-blue integer, i.e.,
0xAARRGGBB. An alpha of00indicates fully transparent andFFmeans opaque. - HeightPercent
- Specifies the
Slider's vertical height as a percentage of theScreen'sHeight. - MaxValue
- Sets the maximum value of slider. If the new maximum is less than the current minimum, then minimum and maximum will both be set to this value. Setting
MaxValueresets the thumb position to halfway betweenMinValueandMaxValueand signals thePositionChanged` event. - MinValue
- Sets the minimum value of slider. If the new minimum is greater than the current maximum, then minimum and maximum will both be set to this value. Setting
MinValueresets the thumb position to halfway betweenMinValueandMaxValueand signals thePositionChanged` event. - ThumbEnabled
- Whether or not the slider thumb is being be shown.
- ThumbPosition
- Sets the position of the slider thumb. If this value is greater than
MaxValue, then it will be set to same value asMaxValue. If this value is less thanMinValue, then it will be set to same value asMinValue. - Visible
- Specifies whether the
Slidershould be visible on the screen. Value istrueif theSlideris showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Slider, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Slideras a percentage of theScreen'sWidth.
Events
- PositionChanged(thumbPosition)
- Indicates that position of the slider thumb has changed.
Methods
None
Spinner
A Spinner component that displays a dialog with a list of elements. These elements can be set in the Designer or Blocks Editor by setting the ElementsFromString property to a comma-separated list of values (for example, choice 1, choice 2, choice 3) or by setting the Elements property to a List in the Blocks editor. Spinners are created with the first item already selected, so selecting it does not generate an AfterSelecting event. Consequently it's useful to make the first Spinner item be a non-choice like "Select from below…".
Properties
- Elements
- Specifies the list of choices to display.
- ElementsFromString
- Set the list of choices from a string of comma-separated values.
- Height
- Specifies the
Spinner's vertical height, measured in pixels. - HeightPercent
- Specifies the
Spinner's vertical height as a percentage of theScreen'sHeight. - Prompt
- Specifies the text used for the title of the Spinner window.
- Selection
- Specifies the current selected item in the
Spinner. - SelectionIndex
- Set the
Spinnerselection to the element at the given index. If an attempt is made to set this to a number less than1or greater than the number of items in theSpinner,SelectionIndexwill be set to0, andSelectionwill be set to the empty text. - Visible
- Specifies whether the
Spinnershould be visible on the screen. Value istrueif theSpinneris showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Spinner, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Spinneras a percentage of theScreen'sWidth.
Events
- AfterSelecting(selection)
- Event called after the user selects an item from the dropdown list.
Methods
- DisplayDropdown()
- Displays the dropdown list for selection, same action as when the user clicks on the spinner.
Switch
Switch components can detect user taps and can change their boolean state in response. They are identical to CheckBoxes except in appearance.
Switches have an on (true) state and an off (false) state. A Switch component raises an event when the user taps it to toggle between states.
Properties
- BackgroundColor
- Specifies the background color of the
Switchas an alpha-red-green-blue integer. - Enabled
- Specifies whether the
Switchshould be active and clickable. - FontBold
- Specifies whether the text of the
Switchshould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
Switchshould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
Switch, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
Switchas default, serif, sans serif, or monospace. - Height
- Specifies the
Switch's vertical height, measured in pixels. - HeightPercent
- Specifies the
Switch's vertical height as a percentage of theScreen'sHeight. - On
- True if the switch is in the On state, false otherwise.
- Text
- Specifies the text displayed by the
Switch. - TextColor
- Specifies the text color of the
Switchas an alpha-red-green-blue integer. - ThumbColorActive
- Specifies the
Switch's thumb color when switch is in the On state. - ThumbColorInactive
- Specifies the
Switch's thumb color when switch is in the Off state. - TrackColorActive
- Specifies the
Switch's track color when in the On state. - TrackColorInactive
- Specifies the
Switch's track color when in the Off state. - Visible
- Specifies whether the
Switchshould be visible on the screen. Value istrueif theSwitchis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
Switch, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Switchas a percentage of theScreen'sWidth.
Events
- Changed()
- User change the state of the
Switchfrom On to Off or back. - GotFocus()
-
Switchbecame the focused component. - LostFocus()
-
Switchstopped being the focused component.
Methods
None
TextBox
Users enter text in a text box component.
The initial or user-entered text value in a text box component is in the Text property. If Text is blank, you can use the Hint property to provide the user with a suggestion of what to type. The Hint appears as faint text in the box.
The MultiLine property determines if the text can have more than one line. For a single line text box, the keyboard will close automatically when the user presses the Done key. To close the keyboard for multiline text boxes, the app should use the HideKeyboard method or rely on the user to press the Back key.
The NumbersOnly property restricts the keyboard to accept numeric input only.
Other properties affect the appearance of the text box (TextAlignment, BackgroundColor, etc.) and whether it can be used (Enabled).
Text boxes are usually used with the Button component, with the user clicking on the Button when text entry is complete.
If the text entered by the user should not be displayed, use PasswordTextBox instead.
Properties
- BackgroundColor
- The background color of the
TextBox`. You can choose a color by name in the Designer or in the Blocks Editor. The default background color is 'default' (shaded 3-D look). - Enabled
- If set, user can enter text into the
TextBox. - FontBold
- Specifies whether the text of the
TextBoxshould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
TextBoxshould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
TextBox, measured in sp(scale-independent pixels). - FontTypeface
- The text font face of the
TextBox. Valid values are0(default),1(serif),2(sans serif), or3(monospace). - Height
- Specifies the
TextBox's vertical height, measured in pixels. - HeightPercent
- Specifies the
TextBox's vertical height as a percentage of theScreen'sHeight. - Hint
-
TextBoxhint for the user. - MultiLine
- If true, then this
TextBoxaccepts multiple lines of input, which are entered using the return key. For single line text boxes there is a Done key instead of a return key, and pressing Done hides the keyboard. The app should call the HideKeyboard method to hide the keyboard for a mutiline text box. - NumbersOnly
- If true, then this
TextBoxaccepts only numbers as keyboard input. Numbers can include a decimal point and an optional leading minus sign. This applies to keyboard input only. Even ifNumbersOnlyis true, you can set the text to anything at all using the [Text`](#TextBox.Text) property. - ReadOnly
- Whether the TextBox is read-only. By default, this is
true. - Text
- The text in the
TextBox, which can be set by the programmer in the Designer or Blocks Editor, or it can be entered by the user (unless theEnabledproperty is false). - TextAlignment
- Specifies the alignment of the
TextBox's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
TextBoxas an alpha-red-green-blue integer. - Visible
- Specifies whether the
TextBoxshould be visible on the screen. Value istrueif theTextBoxis showing andfalseif hidden. - Width
- Specifies the horizontal width of the
TextBox, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
TextBoxas a percentage of theScreen'sWidth.
Events
- GotFocus()
- Event raised when the
TextBoxis selected for input, such as by the user touching it. - LostFocus()
- Event raised when the
TextBoxis no longer selected for input, such as if the user touches a different text box.
Methods
- HideKeyboard()
- Hide the keyboard. Only multiline text boxes need this. Single line text boxes close the keyboard when the users presses the Done key.
- RequestFocus()
- Request focus to current
TextBox.
TimePicker
A button that, when clicked on, opens a dialog to allow the user to select a time.
Note: Date and time are manipulated using methods in the Clock component.
Properties
- BackgroundColor
- Specifies the
TimePicker's background color as an alpha-red-green-blue integer. If anImagehas been set, the color change will not be visible until theImageis removed. - Enabled
- Specifies whether the
TimePickershould be active and clickable. - FontBold
- Specifies whether the text of the
TimePickershould be bold. Some fonts do not support bold. - FontItalic
- Specifies whether the text of the
TimePickershould be italic. Some fonts do not support italic. - FontSize
- Specifies the text font size of the
TimePicker, measured in sp(scale-independent pixels). - FontTypeface
- Specifies the text font face of the
TimePickeras default, serif, sans serif, or monospace. - Height
- Specifies the
TimePicker's vertical height, measured in pixels. - HeightPercent
- Specifies the
TimePicker's vertical height as a percentage of theScreen'sHeight. - Hour
- Returns the hour of the time that was last picked using the
TimePicker`. The time returned is always in the 24hour format. - Image
- Specifies the path of the
TimePicker's image. If there is both anImageand aBackgroundColorspecified, only theImagewill be visible. - Instant
- Returns the instant in time that was last picked using the
TimePicker. - Minute
- Returns the hour of the time that was last picked using the
TimePicker. The time returned is always in the 24hour format. - Shape
- Specifies the shape of the
TimePicker. The valid values for this property are0(default),1(rounded),2(rectangle), and3(oval). TheShapewill not be visible if anImageis used. - ShowFeedback
- Specifies if a visual feedback should be shown when a
TimePickerwith an assignedImageis pressed. - Text
- Specifies the text displayed by the
TimePicker. - TextAlignment
- Specifies the alignment of the
TimePicker's text. Valid values are:0(normal; e.g., left-justified if text is written left to right),1(center), or2(opposite; e.g., right-justified if text is written left to right). - TextColor
- Specifies the text color of the
TimePickeras an alpha-red-green-blue integer. - Visible
- Specifies whether the
TimePickershould be visible on the screen. Value istrueif theTimePickeris showing andfalseif hidden. - Width
- Specifies the horizontal width of the
TimePicker, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
TimePickeras a percentage of theScreen'sWidth.
Events
- AfterTimeSet()
- This event is run when a user has set the time in the popup dialog.
- GotFocus()
- Indicates the cursor moved over the
TimePickerso it is now possible to click it. - LostFocus()
- Indicates the cursor moved away from the
TimePickerso it is now no longer possible to click it. - TouchDown()
- Indicates that the
TimePickerwas pressed down. - TouchUp()
- Indicates that the
TimePickerhas been released.
Methods
- LaunchPicker()
- Launches the
TimePickerdialog. - SetTimeToDisplay(hour,minute)
- Allows the user to set the time to be displayed when the
TimePickeropens. Valid values for the hour field are 0-23 and 0-59 for the second field. - SetTimeToDisplayFromInstant(instant)
- Allows the instant to set the hour and minute to be displayed when the
TimePickeropens. Instants are used inClock,DatePicker, andTimePickercomponents.
WebViewer
Component for viewing Web pages.
The HomeUrl can be specified in the Designer or in the Blocks Editor. The view can be set to follow links when they are tapped, and users can fill in Web forms.
Warning: This is not a full browser. For example, pressing the phone's hardware Back key will exit the app, rather than move back in the browser history.
You can use the WebViewString property to communicate between your app and Javascript code running in the WebViewer page. In the app, you get and set WebViewString. In the WebViewer, you include Javascript that references the window.AppInventor object, using the methods getWebViewString() and setWebViewString(text).
For example, if the WebViewer opens to a page that contains the Javascript command
document . write ( "The answer is" + window . AppInventor . getWebViewString ()); and if you set WebViewString to "hello", then the web page will show
And if the Web page contains Javascript that executes the command
windowAppInventor . setWebViewString ( "hello from Javascript" ), then the value of the WebViewString property will be
Calling setWebViewString from JavaScript will also run the WebViewStringChange event so that the blocks can handle when the WebViewString property changes.
Beginning with release nb184a, you can specify a HomeUrl beginning with http://localhost/ to reference assets both in the Companion and in compiled apps. Previously, apps needed to use file:///android_asset/ in compiled apps and /sdcard/AppInventor/assets/ in the Companion. Both of these options will continue to work but the http://localhost/ approach will work in both scenarios. You may also use "file:///appinventor_asset/" which provides more security by preventing the use of asynchronous requests from JavaScript in your assets from going out to the web.
Properties
- CurrentPageTitle
- Returns the title of the page currently being viewed
- CurrentUrl
- Returns the URL currently being viewed. This could be different from the
HomeUrlif new pages were visited by following links. - FollowLinks
- Determines whether to follow links when they are tapped in the
WebViewer. If you follow links, you can useGoBackandGoForwardto navigate the browser history. - Height
- Specifies the
WebViewer's vertical height, measured in pixels. - HeightPercent
- Specifies the
WebViewer's vertical height as a percentage of theScreen'sHeight. - HomeUrl
- Specifies the URL of the page the
WebViewershould initially open to. Setting this will load the page. - IgnoreSslErrors
- Determine whether or not to ignore SSL errors. Set to
trueto ignore errors. Use this to accept self signed certificates from websites. - PromptforPermission
- Determine if the user should be prompted for permission to use the geolocation API while in the
WebViewer. Iftrue, prompt the user of theWebViewerto give permission to access the geolocation API. Iffalse, assume permission is granted. - UsesLocation
- Specifies whether or not this
WebViewercan access the JavaScript geolocation API. - Visible
- Specifies whether the
WebViewershould be visible on the screen. Value istrueif theWebVieweris showing andfalseif hidden. - WebViewString
- Gets the
WebView's String, which is viewable through Javascript in theWebViewas thewindow.AppInventorobject. - Width
- Specifies the horizontal width of the
WebViewer, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
WebVieweras a percentage of theScreen'sWidth.
Events
- BeforePageLoad(url)
- When a page is about to load this event is run.
- ErrorOccurred(errorCode,description,failingUrl)
- When an error occurs this event is run.
- PageLoaded(url)
- When a page is finished loading this event is run.
- WebViewStringChange(value)
- Event that runs when the
AppInventor.setWebViewStringmethod is called from JavaScript. The newWebViewStringis given by thevalueparameter.
Methods
- CanGoBack()
- Returns true if the WebViewer can go back in the history list.
- CanGoForward()
- Returns true if the WebViewer can go forward in the history list.
- ClearCaches()
- Clear the internal webview cache, both ram and disk. This is useful when using the
WebViewerto poll a page that may not be sending appropriate cache control headers. - ClearCookies()
- Clear the webview's cookies. This is useful if you want to sign the user out of a website that uses them to store logins.
- ClearLocations()
- Clear Stored Location permissions. When the geolocation API is used in the
WebViewer, the end user is prompted on a per URL basis for whether or not permission should be granted to access their location. This function clears this information for all locations.As the permissions interface is not available on phones older then Eclair, this function is a no-op on older phones.
- GoBack()
- Go back to the previous page in the history list. Does nothing if there is no previous page.
- GoForward()
- Go forward to the next page in the history list. Does nothing if there is no next page.
- GoHome()
- Loads the page from the home URL. This happens automatically when home URL is changed.
- GoToUrl(url)
- Load the page at the given URL.
- Reload()
- Reload the current page.
- RunJavaScript(js)
- Run JavaScript in the current page.
- StopLoading()
- Stop loading a page.
Which Is Not A Legal Character In An App Inventor Project Name?
Source: http://ai2.appinventor.mit.edu/reference/components/userinterface.html
Posted by: stottpubbee1972.blogspot.com

0 Response to "Which Is Not A Legal Character In An App Inventor Project Name?"
Post a Comment