aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/dialogs
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-04-17 21:08:14 +0200
committersteckbrief <steckbrief@chefmail.de>2016-04-17 21:08:14 +0200
commitd94eb9309b4ab3ee1dfd3cee637b47a52223e15b (patch)
treea8904048cdc7200addba3a715357a55dc38f7100 /src/main/java/de/thedevstack/conversationsplus/ui/dialogs
parentc854f659dbf03ac92f3cb5539b4b424a993acfac (diff)
DatabaseBackend updated to serve Conversatiosn Database version and Conversations+ Database version
HttpUpload Flag introduced for message to identify if a link was sent after httpupload message hint for httpupload added (message parsing and message generating)
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/dialogs')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
index dfa3147d..e1c30a56 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
@@ -13,6 +13,7 @@ import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Conversation;
import de.thedevstack.conversationsplus.entities.Message;
import de.thedevstack.conversationsplus.utils.UIHelper;
+import de.thedevstack.conversationsplus.utils.ui.TextViewUtil;
/**
* Fills the contents to the message details dialog.
@@ -59,11 +60,11 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
view.findViewById(R.id.dlgMsgDetFileTable).setVisibility(View.VISIBLE);
if (null != message.getFileParams()) {
Message.FileParams params = message.getFileParams();
- TextView tvFilesize = (TextView) view.findViewById(R.id.dlgMsgDetFileSize);
- tvFilesize.setText(UIHelper.getHumanReadableFileSize(params.size));
+ TextViewUtil.setText(view, R.id.dlgMsgDetFileSize, UIHelper.getHumanReadableFileSize(params.size));
}
- TextView mimetype = (TextView) view.findViewById(R.id.dlgMsgDetFileMimeType);
- mimetype.setText(message.getMimeType());
+ TextViewUtil.setText(view, R.id.dlgMsgDetFileMimeType, message.getMimeType());
+
+ TextViewUtil.setText(view, R.id.dlgMsgDetFileHttpUploaded, message.isHttpUploaded() ? R.string.cplus_yes : R.string.cplus_no);
}
}
@@ -107,7 +108,6 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
* @param message the message to display in dialog
*/
protected void displayMessageTypeInfo(View view, Message message) {
- TextView msgTypeTextView = (TextView) view.findViewById(R.id.dlgMsgDetMsgType);
int msgTypeResId;
switch (message.getType()) {
case Message.TYPE_PRIVATE:
@@ -126,7 +126,7 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
default:
msgTypeResId = R.string.dlg_msg_details_msg_type_text;
}
- msgTypeTextView.setText(msgTypeResId);
+ TextViewUtil.setText(view, R.id.dlgMsgDetMsgType, msgTypeResId);
}
/**
@@ -146,10 +146,8 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
if (conversation.getMode() == Conversation.MODE_MULTI) {
// Change label of sending and receiving party to MUC terminology
- TextView senderLabel = (TextView) view.findViewById(R.id.dlgMsgDetLblSender);
- senderLabel.setText(R.string.dlg_msg_details_sender_nick);
- TextView receipientLabel = (TextView) view.findViewById(R.id.dlgMsgDetLblReceipient);
- receipientLabel.setText(R.string.dlg_msg_details_receipient_nick);
+ TextViewUtil.setText(view, R.id.dlgMsgDetLblSender, R.string.dlg_msg_details_sender_nick);
+ TextViewUtil.setText(view, R.id.dlgMsgDetLblReceipient, R.string.dlg_msg_details_receipient_nick);
// Get own nick for MUC
me = conversation.getMucOptions().getActualNick();
@@ -173,7 +171,6 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
* @param message the message to display in dialog
*/
protected void displayMessageSentTime(View view, Message message) {
- TextView timeSent = (TextView) view.findViewById(R.id.dlgMsgDetTimeSent);
- timeSent.setText(DateFormat.format("dd.MM.yyyy kk:mm:ss", new Date(message.getTimeSent())));
+ TextViewUtil.setText(view, R.id.dlgMsgDetTimeSent, DateFormat.format("dd.MM.yyyy kk:mm:ss", new Date(message.getTimeSent())));
}
}