<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
    android:padding="10dp"
    tools:context=".MainActivity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingTop="10dp"
        android:paddingBottom="10dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dp"
            android:text="Device Name：" />

        <Spinner
            android:id="@+id/deviceSpinner"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dp"
            android:text="Printer Name：" />

        <EditText
            android:id="@+id/deviceName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="none"
            android:text="" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:visibility="gone">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="10dp"
            android:text="Product Name：" />

        <EditText
            android:id="@+id/productName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="none"
            android:text="" />
    </LinearLayout>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="queryPrinterName_btn_click"
                    android:text="Query printer name" />

                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="setPrinterName_btn_click"
                    android:text="Set printer name" />
            </LinearLayout>

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="refresh_btn_click"
                android:text="Search USB Device" />

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="connect_btn_click"
                    android:text="Connect" />

                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="disconnect_btn_click"
                    android:text="Disconnect" />
            </LinearLayout>


            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="setup_btn_click"
                android:text="Printer Setup" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="print_cn_font_btn_click"
                android:text="Print Simplified Chinese Font 24*24" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="print_tw_font_btn_click"
                android:text="Print Traditional Chinese Font 24*24"
                android:visibility="gone" />
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="print_barcode_btn_click"
                    android:text="Print Barcode" />
                <Button
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:onClick="print_bmp_btn_click"
                    android:text="Print Download Bmp" />
            </LinearLayout>
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_monochrome_btn_click"
                android:text="Print monochrome BMP" />
            <Button
                android:id="@+id/calibration_rfid"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="calibration_rfid_btn_click"
                android:text="RFID Calibration" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_qrcode_btn_click"
                android:text="Print QRcode" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="othersettings_btn_click"
                android:text="Other Settings" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="wifi_frequency_btn_click"
                android:text="Wifi Frequency" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="rfid_setup_btn_click"
                android:text="rfid setup" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_bmp_new_btn_click"
                android:text="print bmp" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_bmp_compress_btn_click"
                android:text="print compress bmp" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_bicolor_btn_click"
                android:text="bicolor setting" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="print_block_btn_click"
                android:text="Print Block"
                android:visibility="gone" />

            <!--GEN2 SAMPLE-->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="EPC GEN2 Sample:"
                android:textColor="@color/colorAccent"
                android:textSize="18dp"/>
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="write_rfid_click"
                android:text="Write GEN2 EPC DATA" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="write_and_lock_rfid_click"
                android:text="Write DATA / Write Access PWD then Lock PWD and DATA"
                android:visibility="gone" />
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="read_uhf_btn_click"
                android:text="read GEN2 EPC Data" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="pc_uhf_btn_click"
                android:text="Write PC Value" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="readWrite_before_print_uhf_btn_click"
                android:text="Print after ReadWrite" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="readWritePrint_uhf_btn_click"
                android:text="Print with ReadWrite" />

            <EditText
                android:id="@+id/ed_read_uhf_memory"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:clickable="false"
                android:cursorVisible="false"
                android:focusable="false"
                android:hint="GEN2 EPC:"
                android:textSize="18sp" />
            <Button
                android:id="@+id/bt_query_uhf"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:onClick="bt_query_uhf_btn_click"
                android:text="Query GEN2 EPC Data" />
            <EditText
                android:id="@+id/et_query_uhf"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:clickable="false"
                android:cursorVisible="false"
                android:focusable="false"
                android:hint="GEN2 EPC:"
                android:textSize="18sp" />
            <!--GJB SAMPLE-->
            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="EPC GJB Sample:"
                android:textColor="@color/colorAccent"
                android:textSize="18dp"/>

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="set_gjb_status"
                android:text="Set GJB EPC Status" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="write_gjb_rfid_click"
                android:text="Write GJB EPC DATA" />

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:onClick="read_gjb_btn_click"
                android:text="read GJB EPC Data" />

            <EditText
                android:id="@+id/ed_read_gjb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:clickable="false"
                android:cursorVisible="false"
                android:focusable="false"
                android:hint="GJB EPC:"
                android:textSize="18sp" />

            <!--印表機狀態-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <Button
                    android:id="@+id/get_printer_status"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:onClick="get_status_btn_click"
                    android:text="Get Printer Status" />

                <EditText
                    android:id="@+id/printer_status_txt"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:layout_weight="1"
                    android:clickable="false"
                    android:cursorVisible="false"
                    android:focusable="false"
                    android:hint="Printer Status : None"
                    android:textSize="18sp" />
            </LinearLayout>

            <!--sdk version-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <Button
                    android:id="@+id/get_sdk_version"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:onClick="get_version_btn_click"
                    android:text="Get SDK Version" />

                <EditText
                    android:id="@+id/sdk_version_txt"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_weight="1"
                    android:clickable="false"
                    android:cursorVisible="false"
                    android:focusable="false"
                    android:hint="SDK Version : None"
                    android:textSize="18sp" />
            </LinearLayout>

        </LinearLayout>
    </ScrollView>
</LinearLayout>