A graphical widget (also graphical control element or control) in a graphical user interface is an element of interaction, such as a button or a scroll bar.
Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application.
The user interface for most Android screens is made up of one or more widgets.
Containers
Containers are ways of organizing multiple widgets into some sort of structure.
Widgets do not naturally line themselves up in some specific pattern — we have to
define that pattern ourselves.
In most GUI toolkits, a container is deemed to have a set of children. Those children
are widgets, or sometimes are other containers. Each container has its basic rule for
how it lays out its children on the screen, possibly customized by requests from the
children themselves.
Attributes
Widgets have attributes that describe how they should look and behave. In a layout
resource, these are literally XML attributes on the widget’s element in the file.
Usually, there are corresponding getter and setter methods for manipulating this
attribute at runtime from your Java/Kotlin code.
For example, widgets and containers have a “visibility” attribute. This is set by:
• android:visibility attribute in a layout resource
• setVisibility() in Java
• Assigning a value to the visibility property in Kotlin