<?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"
    android:background="@color/transparent">

    <LinearLayout
        android:id="@+id/cardView"
        android:layout_width="540dp"
        android:layout_height="wrap_content"
        android:background="@drawable/bg_rounded_surface"
        android:clipToOutline="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:orientation="vertical"
            android:paddingTop="32dp"
            android:paddingBottom="24dp">

            <TextView
                android:id="@+id/textView"
                android:layout_width="match_parent"
                android:layout_height="65dp"
                android:gravity="center"
                android:text="@string/enter_pickup_code"
                android:textColor="@color/black"
                android:textSize="36sp"
                android:textStyle="bold" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:gravity="center_vertical"
                android:visibility="gone"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/textStatus"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:gravity="center"
                    android:text="@string/enter_pickup_code_or_scan"
                    android:textColor="@color/primary"
                    android:textSize="24sp"
                    android:textStyle="bold" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/linearMark1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:clipChildren="false"
                android:clipToPadding="false"
                android:paddingBottom="20dp"
                android:orientation="vertical">

                <LinearLayout
                    android:id="@+id/layoutInputModeSwitch"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:layout_marginBottom="24dp"
                    android:background="@drawable/bg_segmented_container"
                    android:padding="4dp"
                    android:elevation="2dp"
                    android:translationZ="3dp"
                    android:outlineProvider="background"
                    android:gravity="center"
                    android:orientation="horizontal">

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnModeKeypad"
                        style="@style/Widget.App.InputModeButton"
                        android:text="@string/keyboard_input" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/btnModeScan"
                        style="@style/Widget.App.InputModeButton"
                        android:text="@string/scan_barcode" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="24dp"
                    android:gravity="center"
                    android:orientation="horizontal">

                    <EditText
                        android:id="@+id/editTextNumber"
                        android:layout_width="320dp"
                        android:layout_height="60dp"
                        android:textSize="28sp"
                        android:hint="@string/enter_pickup_code"
                        android:background="@drawable/bg_input_outline"
                        android:paddingStart="16dp"
                        android:paddingEnd="16dp"
                        android:textColor="@color/black"
                        android:gravity="center"
                        android:inputType="number"
                        android:maxLength="8" />
                </LinearLayout>

                <!-- Number pads & QRCode -->
                <LinearLayout
                    android:id="@+id/linearNumpad"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:gravity="center"
                        android:clipChildren="false"
                        android:clipToPadding="false"
                        android:orientation="horizontal">

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button11"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="1" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button12"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="2" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button13"
                        style="@style/Widget.App.KeypadButton"
                        android:text="3" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:gravity="center"
                    android:clipChildren="false"
                    android:clipToPadding="false"
                    android:orientation="horizontal">

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button14"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="4" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button15"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="5" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button16"
                        style="@style/Widget.App.KeypadButton"
                        android:text="6" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:gravity="center"
                    android:clipChildren="false"
                    android:clipToPadding="false"
                    android:orientation="horizontal">

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button17"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="7" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button18"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="8" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button19"
                        style="@style/Widget.App.KeypadButton"
                        android:text="9" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:clipChildren="false"
                    android:clipToPadding="false"
                    android:orientation="horizontal">

                    <!-- 清空 -->
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonC1"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        app:icon="@drawable/close_24" />

                    <!-- 0 -->
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/button10"
                        style="@style/Widget.App.KeypadButton"
                        android:layout_marginEnd="12dp"
                        android:text="0" />

                    <!-- 退格 -->
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonR1"
                        style="@style/Widget.App.KeypadButton"
                        app:icon="@drawable/keyboard_backspace_24" />
                </LinearLayout>

                </LinearLayout>

                <ImageView
                    android:id="@+id/imageViewScanHint"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:adjustViewBounds="true"
                    android:src="@drawable/pay_show_qr_barcode"
                    android:scaleType="fitCenter"
                    android:visibility="gone" />

            </LinearLayout>

            <!-- 底部按鈕 -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:layout_marginTop="16dp"
                android:gravity="center"
                android:clipChildren="false"
                android:clipToPadding="false"
                android:orientation="horizontal">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/buttonCancel"
                    style="@style/Widget.MaterialComponents.Button"
                    android:layout_width="160dp"
                    android:layout_height="64dp"
                    android:layout_marginEnd="24dp"
                    app:backgroundTint="@color/warning"
                    android:elevation="8dp"
                    app:elevation="8dp"
                    android:translationZ="3dp"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:insetLeft="0dp"
                    android:insetRight="0dp"
                    android:padding="0dp"
                    android:text="@string/cancel"
                    android:textSize="26sp"
                    app:cornerRadius="12dp"
                    android:textColor="@color/white" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/buttonFinish"
                    style="@style/Widget.MaterialComponents.Button"
                    android:layout_width="160dp"
                    android:layout_height="64dp"
                    app:backgroundTint="@color/primary"
                    app:rippleColor="#33FFFFFF"
                    android:elevation="8dp"
                    app:elevation="8dp"
                    android:translationZ="3dp"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:insetLeft="0dp"
                    android:insetRight="0dp"
                    android:padding="0dp"
                    android:text="@string/confirm"
                    android:textSize="26sp"
                    app:cornerRadius="12dp"
                    android:textColor="@color/white" />
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
