是男人就下100层【第一层】——高仿微信界面(6)

2019-03-02 01:00|来源: 网路

上一篇《是男人就下100层【第一层】——高仿微信界面(5)》中完成了主界面的框架,今天我们来看看框架内部各个菜单内容的实现。

说明:下面几个界面都是简单的布局组件,如果有什么问题或者疑问请留言,这里我就不做过多啰嗦,直接贴出代码。

一、微信界面


界面布局如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#fcfcfc"
    android:orientation="vertical" >
        
        <RelativeLayout 
  			android:layout_width="fill_parent"
  			android:layout_height="45dp"
  			android:id="@+id/title" 
  			android:background="@drawable/title_bar"
  			android:gravity="center_vertical"  >  
  			
            
      		<TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content" 
        		android:text="微信"
        		android:layout_centerInParent="true"
        		android:textSize="20sp"		
				android:textColor="#ffffff" /> 
			<ImageButton 
			    android:id="@+id/right_btn"
			    android:layout_width="67dp" 
        		android:layout_height="wrap_content"
        		android:layout_alignParentRight="true" 
        		android:layout_centerVertical="true"
        		android:layout_marginRight="5dp"
        		android:src="@drawable/title_btn_function"
				android:background="@drawable/title_btn_right"
				android:onClick="btnmainright"
			    />      
		</RelativeLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:background="@drawable/search_bar_bg" >

            <EditText
                android:id="@+id/editText1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:hint="搜索"
                android:singleLine="true"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:textColor="#000"
                android:drawableLeft="@drawable/search_bar_icon_normal" 
                android:background="@drawable/search_bar_edit_bg" >               
            </EditText>
            
        </LinearLayout>
        
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:gravity="center_vertical"
            android:background="@drawable/mm_listitem"
            android:clickable="true"
            android:onClick="startchat"
             >
            
            <ImageView
                android:id="@+id/head"
                android:layout_width="55dp"
		        android:layout_height="55dp"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:paddingLeft="5dp"
                android:src="@drawable/dawanganban" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/head"
                android:padding="7dp"
                android:text="阳光小强"
                android:textColor="#000" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:padding="7dp"
                android:text="昨天 晚上"
                android:textColor="#666" />
             <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/head"
                android:layout_alignParentBottom="true"
                android:padding="7dp"
                android:text="欢迎大家关注大碗干拌(阳光小强)"
                android:textColor="#666" />  
        </RelativeLayout>
 </LinearLayout>
二、通讯录界面


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#eee"
    android:orientation="vertical" >
        
        <RelativeLayout 
  			android:layout_width="fill_parent"
  			android:layout_height="45dp"
  			android:id="@+id/title" 
  			android:background="@drawable/title_bar"
  			android:gravity="center_vertical"  >  
      		<TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content" 
        		android:text="通讯录"
        		android:layout_centerInParent="true"
        		android:textSize="20sp"		
				android:textColor="#ffffff" /> 
			<Button 
			    android:layout_width="67dp" 
        		android:layout_height="wrap_content"
        		android:layout_alignParentRight="true" 
        		android:layout_centerVertical="true"
        		android:layout_marginRight="5dp"
        		android:text="群聊"
        		android:textColor="#fff"
        		android:textSize="15dp"
				android:background="@drawable/title_btn_right"
			    />      
		</RelativeLayout>
			

 </LinearLayout>
三、朋友们界面 


<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#eee"
        android:orientation="vertical" >
        
        <LinearLayout 
  			android:layout_width="fill_parent"
  			android:layout_height="45dp"
  			android:id="@+id/title" 
  			android:background="@drawable/title_bar"
  			android:gravity="center_horizontal|center_vertical"  >  
      		<TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content" 
        		android:text="朋友们"
        		android:textSize="20sp"		
				android:textColor="#ffffff" />       
			</LinearLayout>
		<RelativeLayout      				    
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="14dp"
            android:gravity="center_vertical"
            android:clickable="true"
            android:background="@drawable/preference_single_item" >
      		<ImageView
      		    android:id="@+id/add_friend"
            	android:layout_width="wrap_content"
        		android:layout_height="wrap_content"        	     	
        		android:scaleType="matrix"
        		android:layout_centerVertical="true"
        		android:layout_alignParentLeft="true"
        		android:src="@drawable/find_more_friend_addfriend_icon" />    
            <TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content"
        		android:layout_toRightOf="@id/add_friend"
        		android:layout_centerVertical="true"
        		android:padding="8dp" 
        		android:text="添加朋友"
        		android:textSize="17sp"		
				android:textColor="#000" /> 
			<ImageView
            	android:layout_width="wrap_content"
        		android:layout_height="wrap_content"        	     	
        		android:scaleType="matrix"
        		android:layout_centerVertical="true"
        		android:layout_alignParentRight="true"
        		android:src="@drawable/mm_submenu" />      					
   		</RelativeLayout>
   		
		<RelativeLayout      				    
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="14dp"
            android:gravity="center_vertical"
            android:clickable="true"
            android:background="@drawable/preference_single_item"
            android:onClick="btn_shake" >
      		<ImageView
      		    android:id="@+id/add_friend_shake"
            	android:layout_width="wrap_content"
        		android:layout_height="wrap_content"        	     	
        		android:scaleType="matrix"
        		android:layout_centerVertical="true"
        		android:layout_alignParentLeft="true"
        		android:src="@drawable/find_more_friend_shake" />    
            <TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content"
        		android:layout_toRightOf="@id/add_friend_shake"
        		android:layout_centerVertical="true"
        		android:padding="8dp" 
        		android:text="摇一摇"
        		android:textSize="17sp"		
				android:textColor="#000" /> 
			<ImageView
            	android:layout_width="wrap_content"
        		android:layout_height="wrap_content"        	     	
        		android:scaleType="matrix"
        		android:layout_centerVertical="true"
        		android:layout_alignParentRight="true"
        		android:src="@drawable/mm_submenu" />      					
   		</RelativeLayout>

    </LinearLayout>
四、设置界面


<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#eee"
        android:orientation="vertical" >
        
        <LinearLayout 
  			android:layout_width="fill_parent"
  			android:layout_height="45dp"
  			android:id="@+id/title" 
  			android:background="@drawable/title_bar"
  			android:gravity="center_horizontal|center_vertical"  >  
      		<TextView
        		android:layout_width="wrap_content" 
        		android:layout_height="wrap_content" 
        		android:text="设置"
        		android:textSize="20sp"		
				android:textColor="#ffffff" />       
			</LinearLayout>
		<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    		xmlns:tools="http://schemas.android.com/tools"
    		android:layout_width="fill_parent"
    		android:layout_height="fill_parent"
    		android:scrollbarStyle="outsideOverlay" 
    		 >
        	<LinearLayout
            	android:layout_width="fill_parent"
            	android:layout_height="wrap_content"
            	android:orientation="vertical" >
            		<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_first_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="个人信息"
        					android:textSize="17sp"		
							android:textColor="#000" />
            			<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:clickable="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="二维码名片"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="腾讯微博"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_last_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="二维码名片"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				
      				<!--   ********************************************************************   -->
      				
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_first_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="我的帐号"
        					android:textSize="17sp"		
							android:textColor="#000" />
            			<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_last_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="手机通讯录匹配"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				
      				<!--   ***********************************************************************   -->
      				<RelativeLayout      				    
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_single_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="聊天背景"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				
      				<!--   ***********************************************************************   -->
      				<RelativeLayout      				    
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_first_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="通用"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="插件"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="黑名单"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="隐私"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="系统通知"
        					android:textSize="17sp"		
							android:textColor="#000" />      
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" /> 					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_last_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="流量统计"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				<!--   ********************************************************************   -->
      				
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_first_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="帮助与反馈"
        					android:textSize="17sp"		
							android:textColor="#000" />
            			<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				<RelativeLayout
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_last_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="关于微信"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
						<ImageView
            				android:layout_width="wrap_content"
        					android:layout_height="wrap_content"        	     	
        					android:scaleType="matrix"
        					android:layout_centerVertical="true"
        					android:layout_alignParentRight="true"
        					android:src="@drawable/mm_submenu" />      					
      				</RelativeLayout>
      				
      				<!--   ***********************************************************************   -->
      				<RelativeLayout      				    
            			android:layout_width="fill_parent"
            			android:layout_height="wrap_content"
            			android:layout_marginTop="14dp"
            			android:gravity="center_vertical"
            			android:clickable="true"
            			android:background="@drawable/preference_single_item" >
            			<TextView
        					android:layout_width="wrap_content" 
        					android:layout_height="wrap_content"
        					android:padding="8dp" 
        					android:text="清空聊天记录"
        					android:textSize="17sp"		
							android:textColor="#000" /> 
									
      				</RelativeLayout>
      				<!--   ***********************************************************************   -->
      				
      				<Button 
      				    android:layout_width="fill_parent" 
        				android:layout_height="wrap_content"
        				android:layout_marginTop="14dp"
        				android:layout_marginBottom="14dp"
        				android:layout_marginLeft="12dp"
        				android:layout_marginRight="12dp"
        				android:padding="4dp" 
        				android:text="退出登录"
        				android:textSize="18sp"		
						android:textColor="#fff"
						android:gravity="center"
						android:background="@drawable/btn_style_red"
						android:onClick="exit_settings"
      				    />     	
        	
        	</LinearLayout>
    </ScrollView>
</LinearLayout>


源代码下载:http://download.csdn.net/detail/lxq_xsyu/6988513




转自:http://www.cnblogs.com/lizhanglong/p/3646558

相关问答

更多