What is View?
A view is a small rectangular box that responds to user inputs.View is a
basic building block of UI (User Interface) in android.Eg: EditText, Button,
CheckBox, etc.
The View class is the base class or we can say that it is the superclass for
all the GUI components in android.
What is View Group?
The ViewGroup class is a subclass of the View class. And also it will act as a base class for layouts and layouts parameters. The ViewGroup will provide an invisible container to hold other Views or ViewGroups and to define the layout properties. For example, Linear Layout is the ViewGroup that contains UI controls like Button, TextView, etc.
Type of View Group?
Those are the commonly used ViewGroup subclasses used in android applications.
Most used Layouts are Linear Layout, Relative Layout and Constraint Layout. Let's have a discussion about those Layout.
Linear Layout: Linear Layout is the most basic layout in android studio, that aligns all the children sequentially either in a horizontal manner or a vertical manner by specifying the android:orientation attribute.
Relative Layout: Relative Layout is a ViewGroup subclass, used to specify the position of child View elements relative to each other like (A to the right of B) or relative to the parent.
Constraint Layout: Constraint Layout is a combination of Linear Layout, Relative Layout and also some Layout. This layout takes attribute from different Layout.
Table Layout: Android TableLayout is a ViewGroup subclass which is used to display the child View elements in rows and columns. It will arrange all the children elements into rows and columns and does not display any border lines in between rows, columns or cells.
Coordinator Layout: To handle the views in a better way, Android introduced a new layout called the Coordinator Layout. By using Coordinator layout you can easily handle and animate the transitions of views present in a Coordinator Layout.
When the view that is having some motion, the best case is to use the CoordinatorLayout.
Frame Layout: FrameLayout is designed to block out an area on the screen to display a single item. Generally, Frame Layout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.
Recycler View: When an item scrolls off the screen, recycler view doesn't destroy the view, it reuses the view for new items that have scrolled in screen.
Advantages of using ConstraintLayout in Android
Disadvantages of using ConstraintLayout