Factotum-sdp/Factotum

View on GitHub
app/src/main/res/layout/fragment_contact_creation.xml

Summary

Maintainability
Test Coverage
<RelativeLayout
    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:id="@+id/contact_creation_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.directory.ContactCreationFragment">

    <RelativeLayout
        android:id="@+id/basic_contact_info"
        android:layout_margin="12dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:orientation="vertical"
            tools:ignore="UselessParent">

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/editTextName"
                    android:layout_marginBottom="12dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="name"
                    android:hint="@string/name"
                    android:inputType="textPersonName" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/editTextSurname"
                    android:layout_marginBottom="12dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="surname"
                    android:hint="@string/surname"
                    android:inputType="textPersonName" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/editTextUsername"
                    android:layout_marginBottom="12dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:autofillHints="username"
                    android:hint="@string/textUsername"
                    android:inputType="textPersonName" />
            </com.google.android.material.textfield.TextInputLayout>

        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/basic_contact_info"
        android:layout_margin="12dp"
        android:orientation="vertical">

        <androidx.appcompat.widget.SearchView
            android:id="@+id/contactCreationAddress"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:iconifiedByDefault="false"
            app:queryHint="Search Address..." />

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/contactCreationPhoneNumber"
                android:layout_marginBottom="12dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="phone"
                android:hint="@string/phone_number"
                android:inputType="phone" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/contactCreationNotes"
                android:layout_marginBottom="12dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/notes"
                android:importantForAutofill="no"
                android:inputType="textCapSentences|textMultiLine"
                android:maxLength="2000"
                android:maxLines="4" />
        </com.google.android.material.textfield.TextInputLayout>

        <Spinner
            android:id="@+id/roles_spinner"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"/>

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/editTextSuperClientUsername"
                android:layout_marginBottom="12dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:autofillHints="username"
                android:hint="@string/super_client_username"
                android:inputType="textPersonName"
                android:visibility="gone"/>
        </com.google.android.material.textfield.TextInputLayout>

    </LinearLayout>

    <com.google.android.material.button.MaterialButton
        android:id="@+id/confirm_form"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="50dp"
        android:text="@string/create_contact_text" />
</RelativeLayout>