Newer
Older
MathsCalc / app / src / main / res / layout / activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/ic_page_bg"
    android:orientation="vertical"
    tools:context=".activity.MainActivity">

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

        <RelativeLayout
            android:layout_width="match_parent"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:paddingRight="10dp"
            android:layout_height="80dp">

            <TextView
                android:id="@+id/gold_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginTop="30dp"
                android:drawableLeft="@drawable/ic_gold"
                android:drawablePadding="10dp"
                android:gravity="center_vertical"
                android:paddingRight="10dp"
                android:text="0"
                android:background="@drawable/shape_white_trans_bg"
                android:textColor="@color/orange"
                android:textSize="20sp" />
        </RelativeLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:padding="15dp"
            android:text="@string/app_name"
            android:textColor="@color/green"
            android:textSize="28sp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="40dp"
            android:background="@drawable/shape_gray_border"
            android:orientation="vertical">

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

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="运算范围:" />

                <EditText
                    android:id="@+id/from_edit"
                    android:layout_width="80dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_edit_bg"
                    android:gravity="center"
                    android:inputType="number"
                    android:maxLength="5"
                    android:maxLines="1"
                    android:text="1"
                    android:textSize="24sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="\t到\t" />

                <EditText
                    android:id="@+id/to_edit"
                    android:layout_width="80dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_edit_bg"
                    android:gravity="center"
                    android:inputType="number"
                    android:maxLength="5"
                    android:maxLines="1"
                    android:text="9"
                    android:textSize="24sp" />

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="0.2dp"
                android:background="@color/line" />


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

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="运算符号:" />

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <CheckBox
                    android:id="@+id/add_checkbox"
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:text="\t+"
                    android:textColor="@color/purple"
                    android:textSize="30sp" />


                    <CheckBox
                    android:id="@+id/sub_checkbox"
                    android:layout_width="100dp"
                    android:layout_alignParentRight="true"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:text="\t-"
                    android:textColor="@color/purple"
                    android:textSize="30sp" />


                    <CheckBox
                        android:id="@+id/mult_checkbox"
                        android:layout_width="100dp"
                        android:layout_height="wrap_content"
                        android:checked="false"
                        android:layout_below="@+id/add_checkbox"
                        android:text="\tx"
                        android:textColor="@color/purple"
                        android:textSize="30sp" />


                    <CheckBox
                        android:id="@+id/divs_checkbox"
                        android:layout_width="100dp"
                        android:layout_alignParentRight="true"
                        android:layout_height="wrap_content"
                        android:checked="false"
                        android:layout_below="@+id/sub_checkbox"
                        android:layout_alignLeft="@+id/sub_checkbox"
                        android:text="\t÷"
                        android:textColor="@color/purple"
                        android:textSize="30sp" />

                </RelativeLayout>

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="0.2dp"
                android:background="@color/line" />

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


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="运算符数:" />

                <Spinner
                    android:id="@+id/spinner"
                    android:layout_width="190dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_spinner_bg"
                    android:dropDownWidth="80dp"
                    android:gravity="center"
                    android:spinnerMode="dropdown" />

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="0.2dp"
                android:background="@color/line" />

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


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="倒计时数:" />

                <Spinner
                    android:id="@+id/spinner2"
                    android:layout_width="190dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_spinner_bg"
                    android:dropDownWidth="80dp"
                    android:gravity="center"
                    android:spinnerMode="dropdown" />

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="0.2dp"
                android:background="@color/line" />

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

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="生成个数:" />

                <EditText
                    android:id="@+id/count_edit"
                    android:layout_width="190dp"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_edit_bg"
                    android:gravity="center"
                    android:inputType="number"
                    android:maxLength="5"
                    android:maxLines="1"
                    android:text="10"
                    android:textSize="24sp" />

            </LinearLayout>

        </LinearLayout>

        <TextView
            android:id="@+id/err_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:textColor="@color/purple" />

        <Button
            android:id="@+id/start_btn"
            style="@style/ButtonStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:text="开始" />

        <Button
            android:id="@+id/card_btn"
            style="@style/ButtonStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            android:text="收集卡片" />


    </LinearLayout>
</ScrollView>