Lesson 6
Lesson 6
Development
Lesson 6
Android Layouts, Styles, Theme
and Menus
Views
Layouts
• Constraint Layout
• Linear Layout
• Relative Layout
• TableRow Layout
• Frame Layout
• ScrowView Layout
Android Styles and Themes
• Android Styles
• Android Themes
App Manifest
A layout defines the visual structure for a user interface, such as the
user interface for an activity or app widget. You can declare a layout in
two ways:
1- Declare user elements in XML: Android provides a
straightforward XML vocabulary that corresponds to the View
classes and subclasses, such as those for widgets and layouts.
Constraint Layout:
Linear Layout
Relative Layout
The RelativeLayout
arranges widgets in
positions relative to each
other. For example, you
may position a button on
the layout to the left,
right or on top of
another button.
Table Layout
Table Layout arranges views into rows and columns.
<TableLayout
android:layout_width="368dp"
android:layout_height="495dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" />
</TableLayout>
ScrollView Layout
ScrollView is a view group that allows the view hierarchy placed within it to
be scrolled.
<ScrollView
android:layout_width="wrap_content" Scroll
android:layout_height="40dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="16dp"
android:text“ x x x x x x x " />
</ScrollView>
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Android 8.0 (API level 26) introduces adaptive launcher icons, which
can display a variety of shapes across different device models. Each
device provides a mask, which the system uses to render all the
adaptive icons of the same shape. An adaptive launcher icon is also
used in shortcuts, settings app, sharing dialogs, and the overview
screen