Android user interface
Android provides a variety of pre-built UI components such as structured layout objects, UI controls, dialogs, notifications, and menus.
base ui elements
class | description |
---|---|
TextView | A user interface element that displays text to the user. |
EditText | A user interface element for entering and modifying text. |
AutoCompleteTextView | An editable text view that shows completion suggestions automatically while the user is typing. |
ImageView | Displays image resources, for example Bitmap or Drawable resources. |
Button | A user interface element the user can tap or click to perform an action. |
ImageButton | A button with an image (instead of text) that can be pressed or clicked by the user. |
RadioButton | A two-states button that can be either checked or unchecked. Unlike a CheckBox, a radio button cannot be unchecked by the user once checked. |
RadioGroup | Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group. |
CheckBox | A two-states button that can be either checked or unchecked. |
Switch | A two-state toggle switch widget that can select between two options. |
Spinner | Provides a quick way to select one value from a set. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one. |
layouts
Layout defines the visual structure of the user interface. Typically the layout is defined as an xml resource and not programmatically.
Most layouts are a ViewGroup subclass.
class | description |
---|---|
LinearLayout | Layouts elements one by horizontally or vertically. |
RelativeLayout | Allows to specify the position of child elements relative to each other or relative to the parent. |
ConstraintLayout | Allows to specify the position of child elements relative to each other or relative to the parent. It is more powerful than RelativeLayout. |
FrameLayout | Allows overlay one element above others. Child elements are drawn in a stack, with the most recently added child on top. |
CoordinatorLayout | A super-powered FrameLayout. Used to manage the transactions and animation of various views present in an Activity. |
MotionLayout | Helps you manage motion and widget animation in your app. Works only with its direct children. |
display data
class | description |
---|---|
RecyclerView | Allows to display large sets of data as scrollable vertical or horizontal list. |
WebView | Allows you to display web content as part of your activity layout, but lack some of the features of fully-developed browsers. |