<?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:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:background="@color/white">

    <!-- 頂部區域背景 (Surface 色調) -->
    <View
        android:id="@+id/viewHeaderBg"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/surface"
        android:elevation="8dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="@+id/headerBarrier"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- 右側背景圖示 (加入高度計算以動態增加區域高度，並防止與文字衝突) -->
    <ImageView
        android:id="@+id/ivHeaderLogo"
        android:layout_width="@dimen/header_logo_width"
        android:layout_height="@dimen/header_logo_height"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="8dp"
        android:scaleType="fitCenter"
        android:src="@drawable/vending_machine_scenario_v1_remove_background"
        android:elevation="9dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!-- 歡迎標題與提示 -->
    <LinearLayout
        android:id="@+id/layoutHeader"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="32dp"
        android:layout_marginTop="32dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="24dp"
        android:orientation="vertical"
        android:elevation="9dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/ivHeaderLogo"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/tvWelcomeTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="歡迎使用 AAT\n智能販賣機系統"
            android:textColor="@color/primary"
            android:textSize="@dimen/welcome_title_text_size"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/tvWelcomeHint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:text="請點擊右上角登入帳號"
            android:textColor="#7F7F7F"
            android:textSize="@dimen/welcome_hint_text_size" />
    </LinearLayout>

    <!-- 右上角登入狀態 -->
    <LinearLayout
        android:id="@+id/layoutLoginStatus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="24dp"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:padding="0dp"
        android:elevation="90dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent">


        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnStatusAction"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:backgroundTint="@color/primary"
            android:minWidth="80dp"
            android:text="登入"
            android:textColor="@color/white"
            android:textSize="@dimen/login_btn_text_size"
            app:cornerRadius="8dp" />
    </LinearLayout>

    <!-- 建立 Barrier 確保下方 ScrollView 包含文字、按鈕與背景圖示的物理最大高度 -->
    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/headerBarrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="layoutHeader,layoutLoginStatus,ivHeaderLogo" />

    <!-- 主要功能設定區域 -->
    <androidx.core.widget.NestedScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="16dp"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/headerBarrier">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="24dp">

            <!-- 第一群組標題 -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:layout_marginStart="12dp"
                android:layout_marginBottom="16dp">
                <com.google.android.material.card.MaterialCardView
                    android:layout_width="6dp"
                    android:layout_height="30dp"
                    app:cardBackgroundColor="@color/primary"
                    app:cardElevation="0dp"
                    app:cardCornerRadius="3dp" />
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="12dp"
                    android:text="主要功能設定"
                    android:textColor="#2B2B2B"
                    android:textSize="@dimen/group_title_text_size"
                    android:textStyle="bold" />
            </LinearLayout>

            <!-- 第一群組：主要設定 -->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/layoutGroup1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.constraintlayout.helper.widget.Flow
                    android:id="@+id/flow_group1"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:flow_wrapMode="aligned"
                    app:flow_maxElementsWrap="3"
                    app:flow_horizontalGap="4dp"
                    app:flow_verticalGap="4dp"
                    app:constraint_referenced_ids="wrap_buttonGotoSetting,wrap_buttonGotoSystemSet,wrap_buttonGotoProductList,wrap_buttonGotoSlotList,wrap_buttonGotoShoppingPlatform" />

                <!-- 1 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoSetting"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoSetting"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/binding_machine"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/binding_machine"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 2 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoSystemSet"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoSystemSet"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/system_setting"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/system_settings"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 3 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoProductList"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoProductList"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/product_list"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/product_list"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 4 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoSlotList"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoSlotList"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/cargo_lane_management"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/cargo_lane_management"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 5 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoShoppingPlatform"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoShoppingPlatform"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/shopping_platform"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/sales_page"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

            </androidx.constraintlayout.widget.ConstraintLayout>

            <!-- 間距分隔 -->
            <View
                android:id="@+id/group_divider"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginTop="48dp"
                android:layout_marginBottom="48dp"
                android:background="#E0E0E0" />

            <!-- 第二群組標題 -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:layout_marginStart="12dp"
                android:layout_marginBottom="16dp">
                <com.google.android.material.card.MaterialCardView
                    android:layout_width="6dp"
                    android:layout_height="30dp"
                    app:cardBackgroundColor="@color/primary"
                    app:cardElevation="0dp"
                    app:cardCornerRadius="3dp" />
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="12dp"
                    android:text="測試除錯"
                    android:textColor="#2B2B2B"
                    android:textSize="@dimen/group_title_text_size"
                    android:textStyle="bold" />
            </LinearLayout>

            <!-- 第二群組：檢測與除錯 -->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/layoutGroup2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.constraintlayout.helper.widget.Flow
                    android:id="@+id/flow_group2"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:flow_wrapMode="aligned"
                    app:flow_maxElementsWrap="3"
                    app:flow_horizontalGap="4dp"
                    app:flow_verticalGap="4dp"
                    app:constraint_referenced_ids="wrap_buttonGotoSettingTest,wrap_buttonGotoDebug,wrap_buttonNfcCheckout,wrap_buttonNfcReset,wrap_buttonQrCodeTest,wrap_buttonGotoXyshj,wrap_buttonGotoCash,wrap_buttonGotoXyshjTest,wrap_buttonGotoElectricControllerTest,wrap_buttonOtherTest,wrap_buttonClearAds,wrap_buttonresetapp,wrap_buttonGotoAndroidSettings" />

                <!-- 7 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoSettingTest"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoSettingTest"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/set_value_detection"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/nccc_logo"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 8 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoDebug"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoDebug"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/infor_debug_window"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/view_log_records"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 9 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonNfcCheckout"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonNfcCheckout"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/card_machine_checkout"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/card_reader_checkout"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 10 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonNfcReset"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonNfcReset"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/card_machine_restart"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/card_reader_reboot"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 11 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonQrCodeTest"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonQrCodeTest"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/scan_dock_test"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/scanner_test"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 12 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoXyshj"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoXyshj"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/slave_machine_software"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/cpu"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 13 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoCash"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoCash"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="紙鈔/現金模組"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/cash"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 14 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoXyshjTest"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoXyshjTest"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/slave_machine_detection"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/nccc_logo"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 15 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoElectricControllerTest"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoElectricControllerTest"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/electronic_controller_detection"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/nccc_logo"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 16 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonOtherTest"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonOtherTest"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="@string/other_test"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/nccc_logo"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 17 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonClearAds"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonClearAds"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="刪除本地端廣告"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@android:drawable/ic_menu_delete"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@color/error" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 18 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonresetapp"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonresetapp"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="重啟APP"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/reboot_app"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <!-- 19 -->
                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/wrap_buttonGotoAndroidSettings"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content">
                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/buttonGotoAndroidSettings"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        app:layout_constraintDimensionRatio="H,1:1"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintBottom_toBottomOf="parent"
                        android:backgroundTint="@color/surface"
                        android:text="進入安卓設定頁"
                        android:textColor="@color/black"
                        android:textSize="@dimen/menu_btn_text_size"
                        android:textStyle="bold"
                        app:strokeWidth="1dp"
                        app:strokeColor="#E0E0E0"
                        app:cornerRadius="@dimen/menu_btn_corner_radius"
                        android:insetTop="@dimen/menu_btn_inset"
                        android:insetBottom="@dimen/menu_btn_inset"
                        android:insetLeft="@dimen/menu_btn_inset"
                        android:insetRight="@dimen/menu_btn_inset"
                        app:elevation="8dp"
                        app:rippleColor="#10000000"
                        app:icon="@drawable/system_settings"
                        app:iconGravity="top"
                        app:iconSize="@dimen/menu_btn_icon_size"
                        app:iconPadding="0dp"
                        app:iconTint="@null" />
                </androidx.constraintlayout.widget.ConstraintLayout>

            </androidx.constraintlayout.widget.ConstraintLayout>

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
