0% found this document useful (0 votes)
7 views4 pages

Mad pr05

The document outlines a practical assignment for developing a program that implements linear and absolute layouts in Android. It includes XML code for creating a user interface with buttons, text fields, and image views arranged in a structured layout. The layout is designed to display items and includes a submit button at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Mad pr05

The document outlines a practical assignment for developing a program that implements linear and absolute layouts in Android. It includes XML code for creating a user interface with buttons, text fields, and image views arranged in a structured layout. The layout is designed to display items and includes a submit button at the end.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: Shreyas Lokhande Roll no : 41

Batch : B Subject : MAD


Practical No : 5 (develop a program to implement linear layout and absolute layout)

<?xml version="1.0" encoding="utf-8"?> android:padding="10dp"


<LinearLayout android:text="Popular"
xmlns:android="http://schemas.android. android:textColor="#000000"
com/apk/res/android" android:textSize="16sp" />
android:layout_width="match_parent" <Button
android:layout_height="match_parent" android:layout_width="wrap_content"
android:orientation="vertical" android:layout_height="wrap_content"
android:background="#FFFFFF" android:backgroundTint="#BDA8A8"
android:padding="10dp" android:padding="10dp"
android:id="@+id/main"> android:text="Recent"
<!-- Search Bar --> android:textColor="#000000"
<LinearLayout android:textSize="16sp" />
android:layout_width="match_parent" <Button
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="center_vertical" android:layout_height="wrap_content"
android:padding="20dp"> android:backgroundTint="#B49F9F"
<EditText android:padding="10dp"
android:layout_width="match_parent" android:text="Contacts"
android:layout_height="wrap_content" android:textColor="#000000"
android:backgroundTint="#BC2323" android:textSize="16sp" />
android:hint="Search" </LinearLayout>
android:padding="10dp" /> <!-- Grid of Images -->
</LinearLayout> <LinearLayout
<LinearLayout android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical"
android:gravity="center" android:paddingTop="10dp">
android:orientation="horizontal" <!-- Row 1 -->
android:padding="0dp"> <LinearLayout
<Button android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal"
android:backgroundTint="#CCB6B6" android:weightSum="3"
android:paddingBottom="10dp"> android:layout_weight="1"
<LinearLayout android:orientation="vertical"
android:layout_width="0dp" android:padding="5dp">
android:layout_height="wrap_content" <ImageView
android:layout_weight="1" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="120dp"
android:padding="5dp"> android:src="@drawable/w3" />
<ImageView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="120dp" android:layout_height="wrap_content"
android:src="@drawable/w1" /> android:text="Item 3"
<TextView android:gravity="center"
android:layout_width="match_parent" android:textColor="#000000" />
android:layout_height="wrap_content" </LinearLayout>
android:text="Item 1" </LinearLayout>
android:gravity="center" <!-- Row 2 -->
android:textColor="#000000" /> <LinearLayout
</LinearLayout> android:layout_width="match_parent"
<LinearLayout android:layout_height="wrap_content"
android:layout_width="0dp" android:orientation="horizontal"
android:layout_height="wrap_content" android:weightSum="3">
android:layout_weight="1" <LinearLayout
android:orientation="vertical" android:layout_width="0dp"
android:padding="5dp"> android:layout_height="wrap_content"
<ImageView android:layout_weight="1"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="120dp" android:padding="5dp">
android:src="@drawable/w2" /> <ImageView
<TextView android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="120dp"
android:layout_height="wrap_content" android:src="@drawable/w5" />
android:text="Item 2" <TextView
android:gravity="center"
android:textColor="#000000" /> android:layout_width="match_parent"
</LinearLayout> android:layout_height="wrap_content"
<LinearLayout android:text="Item 4"
android:layout_width="0dp" android:gravity="center"
android:layout_height="wrap_content" android:textColor="#000000" />
</LinearLayout> android:layout_height="wrap_content"
<LinearLayout android:orientation="horizontal"
android:layout_width="0dp" android:weightSum="3"
android:layout_height="wrap_content" android:paddingBottom="10dp">
android:layout_weight="1" <LinearLayout
android:orientation="vertical" android:layout_width="0dp"
android:padding="5dp"> android:layout_height="wrap_content"
<ImageView android:layout_weight="1"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="120dp" android:padding="5dp">
android:src="@drawable/w6" /> <ImageView
<TextView android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="120dp"
android:layout_height="wrap_content" android:src="@drawable/w8" />
android:text="Item 5" <TextView
android:gravity="center" android:layout_width="match_parent"
android:textColor="#000000" /> android:layout_height="wrap_content"
</LinearLayout> android:text="Item 7"
<LinearLayout android:gravity="center"
android:layout_width="0dp" android:textColor="#000000" />
android:layout_height="wrap_content" </LinearLayout>
android:layout_weight="1" <LinearLayout
android:orientation="vertical" android:layout_width="0dp"
android:padding="5dp"> android:layout_height="wrap_content"
<ImageView android:layout_weight="1"
android:layout_width="match_parent" android:orientation="vertical"
android:layout_height="120dp" android:padding="5dp">
android:src="@drawable/w7" /> <ImageView
<TextView android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="120dp"
android:layout_height="wrap_content" android:src="@drawable/w10"
android:text="Item 6" />
android:gravity="center" <TextView
android:textColor="#000000" /> android:layout_width="match_parent"
</LinearLayout> android:layout_height="wrap_content"
</LinearLayout> android:text="Item 8"
<LinearLayout android:gravity="center"
android:layout_width="match_parent" android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="5dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="120dp"
android:src="@drawable/w11"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Item 9"
android:gravity="center"
android:textColor="#000000" />
</LinearLayout>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#C72020"
android:backgroundTint="#A41515"
android:padding="10dp"
android:text="Submit"
android:textColor="#000000"
android:textSize="25sp" />
</LinearLayout>
</LinearLayout>

You might also like