aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-09-20 19:55:53 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-09-20 19:55:53 +0200
commitd806923d571c2ad8f12446df32e251195cb13db8 (patch)
treefd0eb102ce059067d6531fcdde1d2fa4527cdbcc /src/eu/siacs/conversations/ui
parent37aacbeb74919524138e5ab0d25f656f9a9f1b7d (diff)
parenta86a09ab5b81f39c4d56c37af65e630539e85ffe (diff)
Merge pull request #460 from betheg/receipts
indicates received messages with a tick.
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java4
-rw-r--r--src/eu/siacs/conversations/ui/adapter/MessageAdapter.java16
2 files changed, 20 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index f58b4ddd..03d034d9 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -790,6 +790,10 @@ public class ConversationActivity extends XmppActivity implements
return getPreferences().getBoolean("send_button_status", false);
}
+ public boolean indicateReceived() {
+ return getPreferences().getBoolean("indicate_received", false);
+ }
+
@Override
public void onAccountUpdate() {
final ConversationFragment fragment = (ConversationFragment) getFragmentManager()
diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index acf6ac3f..2392bbcf 100644
--- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -96,6 +96,9 @@ public class MessageAdapter extends ArrayAdapter<Message> {
String filesize = null;
String info = null;
boolean error = false;
+ if (viewHolder.indicatorReceived != null) {
+ viewHolder.indicatorReceived.setVisibility(View.GONE);
+ }
boolean multiReceived = message.getConversation().getMode() == Conversation.MODE_MULTI
&& message.getMergedStatus() <= Message.STATUS_RECEIVED;
if (message.getType() == Message.TYPE_IMAGE) {
@@ -117,6 +120,16 @@ public class MessageAdapter extends ArrayAdapter<Message> {
case Message.STATUS_OFFERED:
info = getContext().getString(R.string.offering);
break;
+ case Message.STATUS_SEND_RECEIVED:
+ if (activity.indicateReceived()) {
+ viewHolder.indicatorReceived.setVisibility(View.VISIBLE);
+ }
+ break;
+ case Message.STATUS_SEND_DISPLAYED:
+ if (activity.indicateReceived()) {
+ viewHolder.indicatorReceived.setVisibility(View.VISIBLE);
+ }
+ break;
case Message.STATUS_SEND_FAILED:
info = getContext().getString(R.string.send_failed);
error = true;
@@ -337,6 +350,8 @@ public class MessageAdapter extends ArrayAdapter<Message> {
.findViewById(R.id.message_body);
viewHolder.time = (TextView) view
.findViewById(R.id.message_time);
+ viewHolder.indicatorReceived = (ImageView) view
+ .findViewById(R.id.indicator_received);
view.setTag(viewHolder);
break;
case RECEIVED:
@@ -515,6 +530,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
protected Button download_button;
protected ImageView image;
protected ImageView indicator;
+ protected ImageView indicatorReceived;
protected TextView time;
protected TextView messageBody;
protected ImageView contact_picture;