<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:animateLayoutChanges="true" >

    <SurfaceView
        android:id="@+id/opposite_surface"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <RelativeLayout
        android:id="@+id/ll_btns"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:paddingLeft="20dp"
        android:paddingRight="20dp" >

        <LinearLayout
            android:id="@+id/ll_top_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_marginTop="5dp"
            android:gravity="center_horizontal"
            android:orientation="vertical" >

            <ImageView
                android:id="@+id/switch_btn"
                android:layout_width="45dip"
                android:layout_height="45dip"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:background="@drawable/camera_switch_pressed"
                android:visibility="visible" />            
            
            <TextView
                android:id="@+id/tv_call_state"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingLeft="12dp"
                android:paddingRight="12dp"
                android:textColor="@color/white"
                android:textSize="18sp"
                android:visibility="visible" />

            <Chronometer
                android:id="@+id/chronometer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Chronometer"
                android:textColor="#fff"
                android:visibility="invisible" />

            <TextView
                android:id="@+id/tv_nick"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:text="张三"
                android:textColor="@android:color/white"
                android:textSize="20sp" />
        </LinearLayout>

        <SurfaceView
            android:id="@+id/local_surface"
            android:layout_width="100dp"
            android:layout_height="120dp"
            android:layout_above="@+id/ll_surface_baseline"
            android:layout_alignParentRight="true" />

        <LinearLayout
            android:id="@+id/ll_surface_baseline"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="vertical"
            android:paddingTop="8dp" >

            <View
                android:layout_width="match_parent"
                android:layout_height="1px" />

            <LinearLayout
                android:id="@+id/ll_bottom_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingBottom="18dp" >

                <LinearLayout
                    android:id="@+id/ll_voice_control"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" >

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <ImageView
                            android:id="@+id/iv_mute"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:scaleType="fitCenter"
                            android:src="@drawable/icon_mute_normal" />

                        <TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="3dp"
                            android:gravity="center"
                            android:text="静音"
                            android:textColor="#666167" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <ImageView
                            android:id="@+id/iv_handsfree"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:scaleType="fitCenter"
                            android:src="@drawable/icon_speaker_normal" />

                        <TextView
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="3dp"
                            android:gravity="center"
                            android:text="免提"
                            android:textColor="#666167" />
                    </LinearLayout>
                </LinearLayout>

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp" >

                    <Button
                        android:id="@+id/btn_hangup_call"
                        android:layout_width="fill_parent"
                        android:layout_height="45dp"
                        android:background="@drawable/btn_bg_red2"
                        android:gravity="center"
                        android:text="挂断"
                        android:textColor="@android:color/white"
                        android:textSize="20sp"
                        android:visibility="invisible" />

                    <LinearLayout
                        android:id="@+id/ll_coming_call"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" 
                        android:paddingBottom="10dp">

                        <Button
                            android:id="@+id/btn_refuse_call"
                            android:layout_width="wrap_content"
                            android:layout_height="45dp"
                            android:layout_weight="1"
                            android:background="@drawable/btn_bg_red2"
                            android:gravity="center"
                            android:text="拒绝"
                            android:textColor="@android:color/white"
                            android:textSize="20sp" />

                        <Button
                            android:id="@+id/btn_answer_call"
                            android:layout_width="wrap_content"
                            android:layout_height="45dp"
                            android:layout_marginLeft="30dp"
                            android:layout_weight="1"
                            android:background="@drawable/btn_bg_blue2"
                            android:gravity="center"
                            android:text="接听"
                            android:textColor="@android:color/white"
                            android:textSize="20sp" />
                    </LinearLayout>
                </FrameLayout>
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>