<?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:background="@color/chat_bgcolor" >

    <RelativeLayout
        android:id="@+id/top_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/height_top_bar"
        android:background="@color/chat_topbar_bgcolor"
        android:gravity="center_vertical" >

        <include layout="@layout/commom_back_btn" />

        <TextView
            android:id="@+id/name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textColor="#ffffff"
            android:textSize="20sp" />

        <RelativeLayout
            android:id="@+id/container_remove"
            android:layout_width="50dp"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:background="@drawable/common_tab_bg"
            android:onClick="emptyHistory" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginRight="9dp"
                android:scaleType="centerInside"
                android:src="@drawable/icon_chat_user" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/container_to_group"
            android:layout_width="50dp"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:background="@drawable/common_tab_bg"
            android:onClick="toGroupDetails"
            android:visibility="gone" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:scaleType="centerInside"
                android:src="@drawable/icon_groupinfo" />
        </RelativeLayout>
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/bar_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="vertical"
        android:paddingBottom="2dip"
        android:paddingTop="2dip" >
        <View android:layout_width="match_parent" 
             android:layout_height="0.5dp" 
             android:background="@color/chat_divider_color"/>
        <LinearLayout
            android:id="@+id/rl_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/chat_input_bgcolor"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingTop="4dp" >

            <Button
                android:id="@+id/btn_set_mode_voice"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:layout_marginLeft="6dp"
                android:background="@drawable/chatting_setmode_voice_btn"
                android:onClick="setModeVoice"
                android:visibility="visible" />

            <Button
                android:id="@+id/btn_set_mode_keyboard"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:layout_marginLeft="6dp"
                android:background="@drawable/chatting_setmode_keyboard_btn"
                android:onClick="setModeKeyboard"
                android:visibility="gone" />

            <LinearLayout
                android:id="@+id/btn_press_to_speak"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="6dp"
                android:layout_marginRight="6dp"
                android:layout_marginTop="6dp"
                android:layout_marginBottom="6dp"
                android:layout_weight="1"
                android:background="@drawable/chat_press_speak_btn"
                android:gravity="center"
                android:visibility="gone" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dp"
                    android:text="@string/button_pushtotalk"
                    android:textColor="#666666"
                    android:textSize="16sp" />
            </LinearLayout>

            <RelativeLayout
                android:id="@+id/edittext_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="6dp"
                android:layout_marginRight="6dp"
                android:layout_marginBottom="3dp"
                android:gravity="bottom"
                android:layout_weight="1"
                >

                <com.lianxin.pubqq.chat.widght.PasteEditText
                    android:id="@+id/et_sendmessage"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="35dip"
                    android:background="@null"
                    android:maxLines="3"
                    android:minHeight="40dp"
                    android:onClick="editClick"
                    android:paddingLeft="1dp"
                    android:paddingTop="3dp"
                    android:paddingRight="1dp"
                    android:paddingBottom="3dp"
                    android:textSize="18sp" >
                </com.lianxin.pubqq.chat.widght.PasteEditText>

                <ImageView
                    android:id="@+id/iv_emoticons_normal"
                    android:layout_width="24dip"
                    android:layout_height="24dip"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:layout_gravity="center_vertical|right"
                    android:layout_margin="1dip"
                    android:scaleType="fitCenter"
                    android:src="@drawable/chatting_biaoqing_btn_normal"
                    android:visibility="visible" />

                <ImageView
                    android:id="@+id/iv_emoticons_checked"
                    android:layout_width="24dip"
                    android:layout_height="24dip"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:layout_gravity="center_vertical|right"
                    android:layout_margin="1dip"
                    android:scaleType="fitCenter"
                    android:src="@drawable/chatting_biaoqing_btn_enable"
                    android:visibility="invisible" />
            </RelativeLayout>

            <Button
                android:id="@+id/btn_more"
                android:layout_width="32dip"
                android:layout_height="32dip"
                android:layout_marginRight="10dp"
                android:layout_marginLeft="4dp"
                android:background="@drawable/type_select_btn"
                android:onClick="more" />

            <Button
                android:id="@+id/btn_send"
                android:layout_width="42dp"
                android:layout_height="32dp"
                android:layout_marginRight="4dp"
                android:background="@drawable/chat_send_btn_selector"
                android:onClick="onClick"
                android:text="@string/button_send"
                android:textColor="#666666"
                android:textSize="16sp"
                android:visibility="gone" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/more"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/chat_frame_bgcolor"
            android:orientation="vertical"
            android:visibility="gone" >

            <!-- 表情图片 -->

            <LinearLayout
                android:id="@+id/ll_face_container"
                android:layout_width="match_parent"
                android:layout_height="190dp"
                android:orientation="vertical"
                android:visibility="gone" >
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="172dp"
                 >                
                 <android.support.v4.view.ViewPager
                    android:id="@+id/vPager"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />   
               </LinearLayout>
        <LinearLayout
            android:id="@+id/emo_pager"            
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
        	android:layout_marginBottom="5dp"  
      	          
        	android:gravity="center_horizontal"     >
            
            <ImageView
            	android:id="@+id/page0"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content"        	     	
        		android:scaleType="matrix"
       		
        		android:src="@drawable/page_now" />
            <ImageView
            	android:id="@+id/page1"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content"
        		android:layout_marginLeft="10dp"        	     	
        		android:scaleType="matrix"
        		android:src="@drawable/page" />
            <ImageView
            	android:id="@+id/page2"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content"
        		android:layout_marginLeft="10dp"           	     	
        		android:scaleType="matrix"
        		android:src="@drawable/page" />
            <ImageView
            	android:id="@+id/page3"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content" 
        		android:layout_marginLeft="10dp"          	     	
        		android:scaleType="matrix"
        		android:src="@drawable/page" />
            <ImageView
            	android:id="@+id/page4"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content" 
        		android:layout_marginLeft="10dp"          	     	
        		android:scaleType="matrix"
        		android:src="@drawable/page" />
            <ImageView
            	android:id="@+id/page5"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content" 
        		android:layout_marginLeft="10dp"          	     	
        		android:scaleType="matrix"
        		android:src="@drawable/page" />           
            
        </LinearLayout> 
               
            </LinearLayout>

            <!-- 图片，表情，名片等按钮 -->

            <LinearLayout
                android:id="@+id/ll_btn_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:visibility="gone" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="4dp"
                    android:layout_marginTop="6dp"
                    android:weightSum="4" >

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

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_camera_picture"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:background="@drawable/chat_takepic_selector"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/attach_take_pic"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>

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

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_picture"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:background="@drawable/chat_image_selector"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/attach_picture"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>

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

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_location"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter"
                                android:src="@drawable/chat_location_selector" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/attach_location"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>

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

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_video"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter"
                                android:src="@drawable/chat_video_selector" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="视频"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="4dp"
                    android:layout_marginTop="6dp"
                    android:weightSum="4" >

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

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_file"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:background="@drawable/chat_file_selector"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/attach_file"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>
                   <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_video_call"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter"
                                android:src="@drawable/chat_video_call_selector" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="视频电话"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>
                   <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_audio_call"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter"
                                android:src="@drawable/chat_voice_call_selector" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="语音电话"
                            android:textColor="@color/chat_more_textcolor" />
                    </LinearLayout>
                                                            
                 <!--  新增按钮
                  <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <RelativeLayout
                            android:layout_width="64dp"
                            android:layout_height="64dp" >

                            <ImageView
                                android:id="@+id/btn_picture"
                                android:layout_width="56dp"
                                android:layout_height="56dp"
                                android:layout_centerInParent="true"
                                android:background="@drawable/chat_image_selector"
                                android:clickable="true"
                                android:onClick="onClick"
                                android:scaleType="fitCenter" />
                        </RelativeLayout>

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:text="@string/attach_picture"
                            android:textColor="#727171" />
                    </LinearLayout> --> 
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/bar_bottom"
        android:layout_below="@id/top_bar" >

        <ProgressBar
            android:id="@+id/pb_load_more"
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:layout_centerHorizontal="true"
            android:visibility="gone" />

        <ListView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/pb_load_more"
            android:cacheColorHint="#00000000"
            android:divider="@null"
            android:dividerHeight="5dp"
            android:listSelector="#00000000"
            android:scrollbarStyle="outsideOverlay"
            android:transcriptMode="normal" />

        <RelativeLayout
            android:id="@+id/recording_container"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/recording_hint_bg"
            android:padding="10dp"
            android:visibility="invisible" >

            <ImageView
                android:id="@+id/mic_image"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:src="@drawable/record_animate_01" />

            <TextView
                android:id="@+id/recording_hint"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/mic_image"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="5dp"
                android:padding="2dp"
                android:text="@string/move_up_to_cancel"
                android:textSize="10sp" />
        </RelativeLayout>
    </RelativeLayout>

</RelativeLayout>