MAD-Unit-3-Part-1
MAD-Unit-3-Part-1
• This is the folder in your project where you will be storing all
of the source code files written in Java programming
language.
• A MainActivity.java is automatically created in this folder by
Android Studio. All of your classes will be available here,
and Android Studio will even bundle together the package
path so that you can work with the files without having to
drill down through the folders that make up your package.
Android application components…
Additional components…
S.No Components & Description
2 Views UI elements that are drawn on-screen including buttons, lists forms etc.
3 Layouts View hierarchies that control screen format and appearance of the views.
• Activities :
fundamentals of UI design android
All the interaction of a user with the Android application is through the user interface(UI),
hence it is very important to understand the basics about the User Interface of an android
application.
ViewGroup
1. A ViewGroup is a special view that can contain other views. In other words, ViewGroup is
generally used to define the layout in which views(widgets) will be set/arranged/listed on
the android screen.
2. ViewGroups acts as an invisible container in which other Views and Layouts are placed.
Yes, a layout can hold another layout in it, or in other words a ViewGroup can have
another ViewGroup in it.
3. The class ViewGroup extends the class View.
4. The ViewGroup is the base class for Layouts in android, like LinearLayout, RelativeLayout,
FrameLayout etc.
View types…
• TextView
• EditText
• ImageView
• ProgressBar
• Button
• ImageButton
• CheckBox
• DatePicker etc..
Linear Layout…
• Android LinearLayout is a view group that aligns all
children in either vertically or horizontally.
Sr.No Attribute & Description
android:baselineAligned This must be a boolean value, either "true" or "false" and prevents the layout from aligning its
2
children's baselines. (it is not align to bottom)
android:divider This is drawable to use as a vertical divider between buttons. You use a color value, in the form of
4
"#rgb", "#argb", "#rrggbb", or "#aarrggbb".
android:gravity This specifies how an object should position its content, on both the X and Y axes. Possible values are
5
top, bottom, left, right, center, center_vertical, center_horizontal etc.
android:orientation This specifies the direction of arrangement and you will use "horizontal" for a row, "vertical" for a
6
column. The default is horizontal.
• It is used to set the gravity of foreground. We can also set multiple values
by using “|”. Ex: fill_horizontal|top .Both the fill_horizontal and top gravity
are set to framelayout.
• android:visibility
• This determine whether to make the view visible, invisible or
gone.
• visible – the view is present and also visible
• invisible – The view is present but not visible
• gone – The view is neither present nor visible
E n d o f Un i t-3 … . .T h a n ks .