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

Register Activity Layouts Overview

The document contains XML layout files for an Android application, including layouts for registration and main activity screens. Each layout utilizes different structures such as LinearLayout, RelativeLayout, and ConstraintLayout, featuring elements like TextViews, EditTexts, and Buttons for user input. The layouts are designed with attributes for styling, padding, and alignment, ensuring a user-friendly interface for registration functionality.

Uploaded by

Shukla Aayush
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)
8 views4 pages

Register Activity Layouts Overview

The document contains XML layout files for an Android application, including layouts for registration and main activity screens. Each layout utilizes different structures such as LinearLayout, RelativeLayout, and ConstraintLayout, featuring elements like TextViews, EditTexts, and Buttons for user input. The layouts are designed with attributes for styling, padding, and alignment, ensuring a user-friendly interface for registration functionality.

Uploaded by

Shukla Aayush
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

activity_layout_linear.

xml
<?xml version="1.0" encoding="utf-8"?>​
<LinearLayout xmlns:android="[Link]
android:layout_width="match_parent" android:layout_height="match_parent"​
android:orientation="vertical" android:padding="16dp"​
android:background="@color/background_color">​

<TextView​
android:id="@+id/tvRegister"​
android:layout_width="wrap_content"​
android:layout_height="wrap_content"​
android:text="@string/register" android:textSize="24sp"​
android:layout_gravity="center_horizontal" android:textStyle="bold"​
android:textColor="@color/primary_color" android:layout_marginBottom="32sp"/>​
android:contentDescription="@string/register_description"​

<EditText​
android:id="@+id/etName"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:hint="@string/name” android:inputType="textPersonName"​
android:autofillHints="name" android:backgroundTint="@color/primary_color"​
android:minHeight="48dp" android:textColor="@color/text_color"​
android:textColorHint="@color/hint_color" android:layout_marginBottom="8dp" ​
android:focusableInTouchMode="true" android:layout_marginTop="32dp"/>​

<EditText​
android:id="@+id/etEmail"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:hint="@string/email" android:inputType="textEmailAddress"​
android:autofillHints="email" android:backgroundTint="@color/primary_color"​
android:minHeight="48dp" android:focusableInTouchMode="true"​
android:textColor="@color/text_color" android:textColorHint="@color/hint_color"​
android:layout_marginBottom="8dp"/>​

<EditText​
android:id="@+id/etPassword"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:autofillHints="password" android:backgroundTint="@color/primary_color"​
android:hint="@string/password" android:textColorHint="@color/hint_color"​
android:inputType="textPassword" android:layout_marginBottom="16dp"​
android:minHeight="48dp" android:textColor="@color/text_color"​
android:focusableInTouchMode="true"/>​

<Button​
android:id="@+id/btnRegister"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:text="@string/register" android:backgroundTint="@color/accent_color"​
android:textColor="@color/button_text_color" android:minHeight="48dp"​
android:contentDescription="@string/register_button_description"/>​
</LinearLayout>
activity_layout_relative.xml
<?xml version="1.0" encoding="utf-8"?>​
<RelativeLayout xmlns:android="[Link]
android:layout_width="match_parent" android:layout_height="match_parent"​
android:padding="16dp" android:background="@color/background_color">​

<TextView​
android:id="@+id/tvRegister"​
android:layout_width="wrap_content"​
android:layout_height="wrap_content"​
android:text="@string/register" android:textSize="24sp"​
android:textStyle="bold" android:layout_centerHorizontal="true"​
android:textColor="@color/primary_color" android:layout_marginBottom="32sp"​
android:contentDescription="@string/register_description"/>​

<EditText​
android:id="@+id/etName"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:hint="@string/name" android:inputType="textPersonName"​
android:autofillHints="name" android:minHeight="48dp"​
android:backgroundTint="@color/primary_color" android:layout_marginBottom="8dp"​
android:textColor="@color/text_color" android:textColorHint="@color/hint_color"​
android:layout_below="@id/tvRegister" android:layout_marginTop="32dp"/>​

<EditText​
android:id="@+id/etEmail"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:hint="@string/email" android:inputType="textEmailAddress"​
android:autofillHints="email" android:minHeight="48dp"​
android:backgroundTint="@color/primary_color" android:textColor="@color/text_color"​
android:textColorHint="@color/hint_color" android:layout_below="@id/etName"​
android:layout_marginBottom="8dp"/>​

<EditText​
android:id="@+id/etPassword"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:hint="@string/password" android:inputType="textPassword"​
android:autofillHints="password" android:minHeight="48dp"​
android:backgroundTint="@color/primary_color"​
android:textColor="@color/text_color" android:textColorHint="@color/hint_color"​
android:layout_below="@id/etEmail" android:layout_marginBottom="16dp"/>​

<Button​
android:id="@+id/btnRegister"​
android:layout_width="match_parent"​
android:layout_height="wrap_content"​
android:text="@string/register" android:backgroundTint="@color/accent_color"​
android:textColor="@color/button_text_color" android:minHeight="48dp"​
android:contentDescription="@string/register_button_description"​
android:layout_below="@id/etPassword"/>​
</RelativeLayout>
activity_layout_constraint.xml
<?xml version="1.0" encoding="utf-8"?>​
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
android:layout_width="match_parent" android:layout_height="match_parent"​
android:padding="16dp" android:background="@color/background_color">​
<TextView​
android:id="@+id/tvRegister"​
android:layout_width="wrap_content" android:layout_height="wrap_content"​
android:text="@string/register" android:textSize="24sp"​
android:textStyle="bold" android:textColor="@color/primary_color"​
app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent"​
app:layout_constraintStart_toStartOf="parent" android:layout_marginBottom="32sp"​
android:contentDescription="@string/register_description"/>​
<EditText​
android:id="@+id/etName" android:layout_height="wrap_content"​
android:hint="@string/name" android:inputType="textPersonName"​
android:autofillHints="name" android:minHeight="48dp"​
android:backgroundTint="@color/primary_color" android:textColor="@color/text_color"​
android:textColorHint="@color/hint_color" android:layout_width="0dp"​
app:layout_constraintTop_toBottomOf="@id/tvRegister"​
app:layout_constraintStart_toStartOf="parent"​
app:layout_constraintEnd_toEndOf="parent"​
android:layout_marginTop="32dp" android:layout_marginBottom="8dp"/>​
<EditText​
android:id="@+id/etEmail" android:layout_width="0dp"​
android:layout_height="wrap_content"​
android:hint="@string/email" android:inputType="textEmailAddress"​
android:autofillHints="email" android:minHeight="48dp"​
android:backgroundTint="@color/primary_color" android:textColor="@color/text_color"​
android:textColorHint="@color/hint_color" android:layout_marginBottom="8dp"​
app:layout_constraintTop_toBottomOf="@id/etName"​
app:layout_constraintStart_toStartOf="parent"​
app:layout_constraintEnd_toEndOf="parent"/>​
<EditText​
android:id="@+id/etPassword" android:layout_width="0dp"​
android:layout_height="wrap_content" android:hint="@string/password"​
android:inputType="textPassword" android:autofillHints="password"​
android:minHeight="48dp" android:backgroundTint="@color/primary_color"​
android:textColor="@color/text_color" android:textColorHint="@color/hint_color"​
app:layout_constraintStart_toStartOf="parent" android:layout_marginBottom="16dp"
app:layout_constraintTop_toBottomOf="@id/etEmail"
app:layout_constraintEnd_toEndOf="parent"/>​
<Button​
android:backgroundTint="@color/accent_color"​
android:textColor="@color/button_text_color"​
android:id="@+id/btnRegister" android:layout_width="0dp"​
android:layout_height="wrap_content" android:text="@string/register"​
android:minHeight="48dp" app:layout_constraintTop_toBottomOf="@id/etPassword"​
android:contentDescription="@string/register_button_description"​
app:layout_constraintStart_toStartOf="parent"​
app:layout_constraintEnd_toEndOf="parent"/>​
</[Link]>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>​
<LinearLayout xmlns:android="[Link]
android:layout_width="match_parent"​
android:layout_height="match_parent"​
android:orientation="vertical"​
android:gravity="center"​
android:padding="16dp">​

<Button​
android:id="@+id/btnGoToRegister"​
android:layout_width="wrap_content"​
android:layout_height="wrap_content"​
android:text="Go to Register"​
android:backgroundTint="@color/primary_color"​
android:textColor="@android:color/white"/>​
</LinearLayout>

Result:

You might also like