如何创建与泡沫时间戳聊天活动 [英] How to create a chat activity with the time stamp in bubble

查看:136
本文介绍了如何创建与泡沫时间戳聊天活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个聊天活动中,用户可以发送和接收消息。
在右边的泡沫发件人的邮件带有时间戳和对留在布雷与时间戳接收的消息。

I want to create a chat activity in which user can send and receive messages. Sender messages on right in bubble with time stamp and received messages on left in buble with time stamp.

什么是迄今为止我所做的是,我已经创建了做工精细一个聊天应用程序,我得到我的正确的信息并收到了离开的消息,但我不知道如何添加时间戳泡沫就像WhatsApp的。

What I have done so far is that I have created a chat application its working fine, i get my messages on right and received messages on left but I don't know how to add time stamp in bubble just like whatsapp.

请帮助其对我来说很重要。

Please help its very important for me.

推荐答案

我已经下载从androidhive链接code
你必须改变以下两个布局文件

I have downloaded the code from the androidhive link you have to change following two layout files

list_item_message_right.xml. 
list_item_message_left.xml.

在上面的布局文件添加一个新的TextView时间戳,然后设置 MessageListAdapter 及其值的时间戳值类

add a new textview for timestamp in above layout files and then set their values time stamp values in MessageListAdapter class

    lblFrom.setText(m.getFromName());

//set time stamp here

这篇关于如何创建与泡沫时间戳聊天活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆