1/35
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Input Controls
Involves tapping, typing, using gestures, or talking
Button
Is usually a rectangle or rounded rectangle with a descriptive caption or icon in its center. It can text, icon, or both
Syntax to create a button with text
<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap content”
android:src=”@string/button_text” />
Syntax to create a button with icon
<ImageButton
android:layout_width=”wrap_content”
android:layout_height=”wrap content”
android:src=”@drwable/button_icon” />
Syntax to create a button with text and icon
<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap content”
android:src=”@string/button_text”
android:drawableLeft=”@drawable/button_icon” />
Three states of button
These are the states the ____ element:
Normal
Disabled
Pressed
Raised Button
Appears lifted from the screen, the shading around it indicates that it is possible to tap or click it
Flat button
Also known as a borderless button, is a text-only button that looks flat and doesn’t have a shadow
ImageView
Is used to display image resources. It can be turned into a button by adding the android:onClick attribute in the XML layout
Floating Action Button
Is a circular button that appears to float above the layout
Touch Gesture
Occurs when a user places one or more fingers on the touchscreen, and the app interprets that pattern of touches as a particular gesture, such as top, touch and hold, double-tap, fling, or scroll
Input Controls
Are interactive elements in the app’s UI that accept data input
Text Field (EditText)
Is used for entering and modifying text
Syntax that stores the value of the selected option in a String
<Spinner
android:id=”@+id/language_spinner”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:entries=”@array/language_array” />
String text = mySpinner.getSelectedItem().toString();
Toggle Button
Lets the user change a setting between two states
Switch
A type of toggle button, provides a slider for selection
SeekBar
Is dragged to the left or right to indicate a progress level
Event
Occurs when the user interacts with an input control or item in the user interface
Event Listener
Is an interface in the View class that contains a single callback method. These methods will be called when the View to which the listener has been registered is triggered by user interaction with the item in the UI
OnClick()
When the user either touches or focuses upon the item
onLongClick()
When the user either touches or focuses upon the item for a second
onKey()
When the user is focused on the item and presses or releases a hardware key on the device
onTouch()
When the user performs an action qualified as a touch event (a press, a release, or any movement gesture on the screen)
Drawable
Is a graphic that can be drawn to the screen. It is the class used for adding rich images in an app with a minimal impact on its performance
WebP
A modern image format developed by Google that provides superior lossless and lossy compression for images on the web
PNG
Portable Network Graphics
JPG/JPEG
Joint Photographic Experts Group
GIF
Graphics Interchange Format
BMP
Bitmap
Recommended image formats
WebP
PNG
JPG
Style
A collection of attributes that define the look and format of a view
Platform Styles
The styles that Android provides
<style>
This element must include the following:
name
parent (optional)
Any number of <item> elements as child elements of <style>
Inheritance
Allows a style to inherit the properties of an existing style
Theme
Is a collection of attributes that define the look and format of an activity or an entire app. Any style can be used as a theme