chromium/chrome/browser/autofill/android/java/res/layout/autofill_local_card_editor.xml

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<merge
    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">

    <!-- Credit card number -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/credit_card_number_label"
        android:labelFor="@+id/credit_card_number_edit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/pref_autofill_field_large_top_margin"
        android:layout_marginBottom="@dimen/pref_autofill_field_bottom_margin"
        app:errorTextAppearance="@style/TextAppearance.ErrorCaption">

        <!-- TODO(crbug.com/40600572): Fix and remove lint ignore -->
        <EditText
            tools:ignore="Autofill,LabelFor"
            android:id="@+id/credit_card_number_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="@dimen/min_touch_target_size"
            android:imeOptions="flagNoExtractUi"
            android:inputType="phone"
            android:digits="0123456789- "
            android:hint="@string/autofill_credit_card_editor_number" />

    </com.google.android.material.textfield.TextInputLayout>

    <!-- Expiration date -->
    <TextView
        android:id="@+id/credit_card_expiration_label"
        android:labelFor="@+id/credit_card_expiration_month"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
        android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
        android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
        android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
        android:text="@string/autofill_credit_card_editor_expiration_date" />

    <LinearLayout
        android:id="@+id/credit_card_expiration_spinner_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
        android:layout_marginBottom="@dimen/pref_autofill_dropdown_bottom_margin"
        android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
        android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
        android:orientation="horizontal"
        android:baselineAligned="false">

        <LinearLayout
            android:id="@+id/credit_card_expiration_month"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginEnd="@dimen/editor_dialog_section_large_spacing"
            android:orientation="vertical">

            <androidx.appcompat.widget.AppCompatSpinner
                android:id="@+id/autofill_credit_card_editor_month_spinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/min_touch_target_size" />

            <View style="@style/PreferenceSpinnerUnderlineView" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <androidx.appcompat.widget.AppCompatSpinner
                android:id="@+id/autofill_credit_card_editor_year_spinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/min_touch_target_size" />

            <View style="@style/PreferenceSpinnerUnderlineView"  />

        </LinearLayout>
    </LinearLayout>

    <!--- Expiration date & CVC -->
    <RelativeLayout
        android:id="@+id/credit_card_expiration_and_cvc_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/credit_card_expiration_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/credit_card_expiration_month_and_year_label"
                android:labelFor="@+id/expiration_month_and_year"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
                android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
                android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
                android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
                android:text="@string/autofill_credit_card_editor_expiration_date" />

            <EditText
                android:id="@+id/expiration_month_and_year"
                android:width="@dimen/local_card_expiration_date_editor_width"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:digits="0123456789/"
                android:gravity="start"
                android:hint="@string/autofill_credit_card_editor_expiration_date_hint"
                android:imeOptions="actionNext"
                android:inputType="number"
                android:maxLength="5"
                android:minHeight="@dimen/min_touch_target_size"
                android:textAppearance="@style/TextAppearance.TextLarge.Primary"
                tools:ignore="Autofill,LabelFor" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/credit_card_security_code_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_toStartOf="@id/cvc_hint_image">

            <TextView
                android:id="@+id/credit_card_security_code_label"
                android:labelFor="@+id/cvc"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
                android:layout_marginStart="@dimen/pref_autofill_field_horizontal_padding"
                android:layout_marginEnd="@dimen/pref_autofill_field_horizontal_padding"
                android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
                android:text="@string/autofill_credit_card_editor_security_code" />

            <EditText
                android:id="@+id/cvc"
                android:width="@dimen/local_card_cvc_editor_width"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="start"
                android:hint="@string/autofill_optional_tag"
                android:imeOptions="actionNext"
                android:inputType="number"
                android:minHeight="@dimen/min_touch_target_size"
                android:textAppearance="@style/TextAppearance.TextLarge.Primary"
                tools:ignore="Autofill,LabelFor" />
        </LinearLayout>

        <ImageView
            android:id="@+id/cvc_hint_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/local_card_cvc_image_horizontal_margin"
            android:layout_marginEnd="@dimen/local_card_cvc_image_large_horizontal_margin"
            android:layout_centerInParent="true"
            android:layout_alignParentEnd="true"
            android:src="@drawable/cvc_icon"
            tools:ignore="ContentDescription" />

    </RelativeLayout>

    <!-- Name -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/credit_card_name_label"
        android:labelFor="@+id/credit_card_name_edit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/pref_autofill_field_top_margin"
        android:layout_marginBottom="@dimen/pref_autofill_field_bottom_margin">

        <!-- TODO(crbug.com/40600572): Fix and remove lint ignore -->
        <EditText
            tools:ignore="Autofill,LabelFor"
            android:id="@+id/credit_card_name_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="@dimen/min_touch_target_size"
            android:imeOptions="flagNoExtractUi"
            android:inputType="textCapWords"
            android:hint="@string/autofill_credit_card_editor_name" />

    </com.google.android.material.textfield.TextInputLayout>

    <include layout="@layout/autofill_billing_address_dropdown" />

    <!-- Nickname -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/credit_card_nickname_label"
        android:labelFor="@+id/credit_card_nickname_edit"
        app:counterMaxLength="25"
        app:errorEnabled="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/pref_autofill_field_extra_large_top_margin"
        android:layout_marginBottom="@dimen/pref_autofill_field_bottom_margin">

        <EditText
            tools:ignore="Autofill,LabelFor"
            android:id="@+id/credit_card_nickname_edit"
            android:maxLength="25"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="@dimen/min_touch_target_size"
            android:imeOptions="flagNoExtractUi"
            android:inputType="textCapWords"
            android:hint="@string/autofill_credit_card_editor_nickname" />

    </com.google.android.material.textfield.TextInputLayout>
</merge>