0% found this document useful (0 votes)
26 views

Practical No 10

The document describes an Android login screen layout using XML. It contains a ConstraintLayout with a centered TextView label for "Swiggy Login" on top. Below is a RelativeLayout containing EditText fields for the username and password, with label TextViews on the left. At the bottom is a centered "Login Here" button. An additional EditText is placed at the bottom of the parent ConstraintLayout.

Uploaded by

atharvabutte03
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)
26 views

Practical No 10

The document describes an Android login screen layout using XML. It contains a ConstraintLayout with a centered TextView label for "Swiggy Login" on top. Below is a RelativeLayout containing EditText fields for the username and password, with label TextViews on the left. At the bottom is a centered "Login Here" button. An additional EditText is placed at the bottom of the parent ConstraintLayout.

Uploaded by

atharvabutte03
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/ 2

Practical No 10

Q1.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Swiggy Login"
android:textAlignment="center"
android:textColor="#FF4003"
android:textSize="30dp"
app:layout_constraintBottom_toTopOf=

"@+id/relativeLayout"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.709"
tools:layout_editor_absoluteX="9dp" />

<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="393dp"
android:layout_height="212dp"
android:layout_marginTop="236dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/unm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Username"
android:textColor="@android:color/holo_blue_dark"
android:textSize="20dp" />
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/unm" />
<TextView
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/unm"
android:layout_margin="10dp"
android:text="Password"
android:textColor="#F30F5C"
android:textSize="20dp" />
<EditText
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_below="@+id/unm"
android:layout_toRightOf="@+id/pass"
android:inputType="textPassword" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Login Here" /> </RelativeLayout>

<EditText
android:layout_width="162dp"
android:layout_height="48dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Atharva Butte"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Q2.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="393dp"
android:layout_height="212dp"
android:layout_marginTop="236dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/unm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="Enrollment No"
android:textSize="20dp" />
<EditText
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/unm" />
<TextView
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/unm"
android:layout_margin="10dp"
android:text="Password"
android:textColor="#F30F5C"
android:textSize="20dp" />
<EditText
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_below="@+id/unm"
android:layout_toRightOf="@+id/pass"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Login Here" />
</RelativeLayout>
<EditText
android:layout_width="162dp"
android:layout_height="48dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Atharva Butte"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

You might also like