<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:auto="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="org.xing.android.MainActivity" >

    <LinearLayout
        android:id="@+id/backgroundLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:background="@color/colorBackground" >

        <!-- 计算结果显示区 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            >
            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:background="@android:color/transparent"
                android:orientation="horizontal" >

                <EditText
                    android:id="@+id/input"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:paddingLeft="5dp"
                    android:background="@android:color/transparent"
                    android:inputType="textPersonName"
                    android:textIsSelectable="true"
                    android:layout_alignParentTop="true"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:textColor="@color/colorText"
                    android:typeface="serif"
                    android:text="0"
                    android:textSize="45dp"
                    android:duplicateParentState="false" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:orientation="vertical"
                    android:layout_gravity="right"
                    android:gravity="center"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    >
                    <Button
                            android:id="@+id/stateButton"
                            android:layout_height="30dp"
                            android:layout_width="30dp"
                            android:background="@mipmap/input_sleep"
                            android:layout_alignParentRight="true"
                            android:layout_alignParentEnd="true"
                            android:layout_alignBottom="@+id/input" />
                </LinearLayout>
            </FrameLayout>

            <ProgressBar
                    style="@android:style/Widget.ProgressBar.Horizontal"
                    android:id="@+id/recordDynamic"
                    android:max="100"
                    android:progress="0"
                    android:visibility="visible"
                    android:alpha="50"
                    android:layout_height="2dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:indeterminate="false"
                    android:layout_width="match_parent"
                    android:paddingLeft="2dp"
                    android:paddingRight="2dp"
                    android:progressDrawable="@drawable/record_progress" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:layout_weight="90"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:background="@android:color/transparent"
            >
            <!-- 计算历史显示区 -->
                <WebView
                    android:id="@+id/historylist"
                    android:layout_width="match_parent"
                    android:background="@android:color/transparent"
                    android:layout_height="0dp"
                    android:layout_weight="97"
                    android:layout_margin="5dp"
                    android:layout_gravity="center"
                    android:layerType="software" />

            <!-- 控制和状态显示区 -->
            <FrameLayout
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:layout_alignParentTop="true" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="3dip"
                    android:orientation="horizontal"
                    android:layout_gravity="bottom"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:background="@android:color/transparent" >

                    <TextView
                        android:id = "@+id/msg"
                        android:layout_width="0dp"
                        android:layout_weight="45"
                        android:layout_height="wrap_content"
                        android:textColor="#777777"
                        android:textSize="12dp"
                        android:padding="1dip"
                        android:gravity="bottom"
                        android:background="@android:color/transparent"
                        android:layout_gravity="bottom" />

                    <Button
                        android:id = "@+id/ctrl_start"
                        android:layout_width="60dp"
                        android:layout_height="60dp"
                        android:clickable="true"
                        android:background="@mipmap/start"
                        android:gravity="center"
                        android:layout_gravity="center_horizontal" />


                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_weight="45"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:layout_gravity="bottom"
                        android:gravity="right"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:background="@android:color/transparent" >
                            <Button
                                android:id = "@+id/share_mark"
                                android:layout_width="25dp"
                                android:layout_height="25dp"
                                android:textColor="#777777"
                                android:clickable="true"
                                android:layout_marginRight="5dp"
                                android:background="@drawable/textview_share_selector"
                                android:gravity="center" />

                            <Button
                                android:id = "@+id/help_mark"
                                android:layout_width="25dp"
                                android:layout_height="25dp"
                                android:textColor="#777777"
                                android:clickable="true"
                                android:background="@drawable/textview_help_selector"
                                android:gravity="center" />
                    </LinearLayout>
                </LinearLayout>

                <!-- 分享操作区 -->
                <LinearLayout
                    android:id="@+id/share_board"
                    android:layout_marginTop="10dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/share_boder"
                    android:visibility="gone"
                    android:orientation="vertical" >

                    <TextView
                        android:id = "@+id/share_title"
                        android:layout_width="match_parent"
                        android:layout_height="25dp"
                        android:layout_marginLeft="5dp"
                        android:layout_marginTop="5dp"
                        android:textColor="#777777"
                        android:textSize="15dp"
                        android:text="分享到" />

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

                        <ImageView
                            android:id="@+id/share_weixin"
                            android:layout_width="60dp"
                            android:layout_height="60dp"
                            android:background="@drawable/image_selector"
                            android:src = "@mipmap/socialize_wechat" />

                        <ImageView
                            android:id="@+id/share_pengyouquan"
                            android:layout_width="60dp"
                            android:layout_height="60dp"
                            android:background="@drawable/image_selector"
                            android:src = "@mipmap/socialize_wxcircle" />

                        <ImageView
                            android:id="@+id/share_qq"
                            android:layout_width="60dp"
                            android:layout_height="60dp"
                            android:background="@drawable/image_selector"
                            android:src = "@mipmap/socialize_qq" />

                        <ImageView
                            android:id="@+id/share_kongjian"
                            android:layout_width="60dp"
                            android:layout_height="60dp"
                            android:background="@drawable/image_selector"
                            android:src = "@mipmap/socialize_qzone" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal" >
                        <Button
                            android:id="@+id/cancel_btn"
                            android:layout_width="match_parent"
                            android:layout_height="40dp"
                            android:background="#eeeeee"
                            android:textSize="16dp"
                            android:text="取消" />
                    </LinearLayout>
                </LinearLayout>
            </FrameLayout>
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>
