日韩欧美人妻无码精品白浆,www.大香蕉久久网,狠狠的日狠狠的操,日本好好热在线观看

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

Android 開發(fā)即時聊天工具 YQ :(七) 氣泡聊天

admin
2013年2月25日 14:27 本文熱度 4749

首先看看效果:






實現(xiàn)方式還是listview自定義adapter,只不過用了兩個布局文件,左邊的一種布局,右邊的一種布局,在消息實體類中添加一個變量,用來判斷是發(fā)出的消息還是收到的消息,從而在adapter的getView()中,決定采用哪種布局。




chat_listview_item_left.xml





[html]


  1. <?xml version="1.0" encoding="utf-8"?>  

  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  

  3.     android:layout_width="wrap_content"  

  4.     android:layout_height="wrap_content" >  

  5.     <ImageView  

  6.         android:id="@+id/avatar_chat_left"  

  7.         android:layout_width="wrap_content"  

  8.         android:layout_height="wrap_content"  

  9.         android:src="@drawable/avatar_default" />  

  10.     <RelativeLayout   

  11.         android:id="@+id/rl_chat_left"  

  12.         android:layout_width="wrap_content"  

  13.         android:layout_height="wrap_content"  

  14.         android:layout_toRightOf="@id/avatar_chat_left"  

  15.         android:background="@drawable/chat_left">  

  16.     <TextView  

  17.         android:id="@+id/message_chat_left"  

  18.         android:layout_width="wrap_content"  

  19.         android:layout_height="wrap_content"  

  20.         android:maxWidth="160dip"/>  

  21.     </RelativeLayout>  

  22.     <TextView  

  23.         android:id="@+id/sendtime_chat_left"  

  24.         android:layout_width="wrap_content"  

  25.         android:layout_height="wrap_content"  

  26.         android:layout_toRightOf="@id/avatar_chat_left"  

  27.         android:layout_below="@id/rl_chat_left"  

  28.         android:textSize="10sp" />  

  29. </RelativeLayout>  


chat_listview_item_right.xml





[html]


  1. <?xml version="1.0" encoding="utf-8"?>  

  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  

  3.     android:layout_width="wrap_content"  

  4.     android:layout_height="wrap_content" >  

  5.     <ImageView  

  6.         android:id="@+id/avatar_chat_right"  

  7.         android:layout_width="wrap_content"  

  8.         android:layout_height="wrap_content"  

  9.         android:layout_alignParentRight="true"  

  10.         android:layout_alignParentTop="true"  

  11.         android:src="@drawable/avatar_default" />  

  12.     <RelativeLayout  

  13.         android:id="@+id/rl_chat_right"  

  14.         android:layout_width="wrap_content"  

  15.         android:layout_height="wrap_content"  

  16.         android:layout_toLeftOf="@+id/avatar_chat_right"  

  17.         android:background="@drawable/chat_right" >  

  18.     <TextView  

  19.         android:id="@+id/message_chat_right"  

  20.         android:layout_width="wrap_content"  

  21.         android:layout_height="wrap_content"  

  22.         android:maxWidth="160dip" />  

  23.     </RelativeLayout>  

  24.     <TextView  

  25.         android:id="@+id/sendtime_chat_right"  

  26.         android:layout_width="wrap_content"  

  27.         android:layout_height="wrap_content"  

  28.         android:layout_below="@id/rl_chat_right"  

  29.         android:layout_toLeftOf="@+id/avatar_chat_right"  

  30.         android:textSize="10sp"/>  

  31. </RelativeLayout>  





在adapter中判斷消息是發(fā)出的還是收到的:




[java]


  1. if(ce.isLeft()){  

  2.     convertView = inflater.inflate(R.layout.chat_listview_item_left, null);  

  3.       

  4. }else{  

  5.     convertView=inflater.inflate(R.layout.chat_listview_item_right, null);  

  6.   

  7. }  



別的都和以前的差不多,知道了原理其實挺簡單的。


 


該文章在 2013/2/25 14:27:24 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調(diào)度、堆場、車隊、財務(wù)費用、相關(guān)報表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點,圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務(wù)都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

99久久精品免费电影| 国产日韩欧美综合一区| 人妻精品一区二区三区| 日本AV情爱·com| AV资源中字在线| 你肏我肏综合网| 少妇人人凹凸XX凹凸爽凹凸| 久久美女做爰高图片看看| 黄片试看欧美| 欧美精品精品在线一区| 欧美调教一区二区| 久久91字幕| 999久久久精品免费毛片| 国产精品久久毛片| 天天躁狠狠躁夜躁| 日韩欧美性爱视频一区二区| 国产综合夫妻| 日本不卡精品中文字幕| 无码专区久久综合久中文字幕| 97se亚洲综合自在线尤物| 久久久无码精品亚洲日韩人妖| 国产色哟哟| 777yyy亚洲精品一区二区| 丁香婷婷深情五月亚洲小说漫画| 乱码视频亚欧洲| 后入少妇91亚洲一区| 久久中文字幕无码一区二区| 91日韩约| 沙特王储曾称中国崩了全世界都要崩| 丝袜美女被操一区| 日韩一区二区强奸伦理电影| 国产99长久久久| 泰av在线| 国产精品自拍人妻一区二区在线观看| 精品偷拍无码乱码一区二区| 麻豆视频ABB| 青青操精品视频在线观看| 天天日涩区| 先锋av资源| 午夜精品激情视频| 日韩aaa久|