aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-04-05 20:28:08 +0200
committerChristian Schneppe <christian@pix-art.de>2017-04-05 22:21:41 +0200
commit04a060761699fc82440dcc79b716c2071973877c (patch)
tree2363c51dd6a6790dc373185351597567a7290fa7 /src/main/java/de/pixart
parentbb22bc712f537294ea4b444999e454ab0b3504f6 (diff)
show file size for files smaller 1024 bytes
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 4c62bb1e6..533bbf880 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -175,7 +175,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
}
}
- private void displayStatus(ViewHolder viewHolder, final Message message, int type, boolean darkBackground, boolean inValidSession) {
+ private void displayStatus(ViewHolder viewHolder, Message message, int type, boolean darkBackground) {
String filesize = null;
String info = null;
boolean error = false;
@@ -197,10 +197,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
FileParams params = message.getFileParams();
if (params.size > (1 * 1024 * 1024)) {
filesize = params.size / (1024 * 1024) + " MiB";
- } else if (params.size > (1 * 1024)) {
+ } else if (params.size >= (1 * 1024)) {
filesize = params.size / 1024 + " KiB";
- } else if (params.size > 0) {
- filesize = "1 KiB";
+ } else {
+ filesize = params.size + " B";
}
if (message.getTransferable() != null && message.getTransferable().getStatus() == Transferable.STATUS_FAILED) {
error = true;
@@ -979,7 +979,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
}
}
- displayStatus(viewHolder, message, type, darkBackground, isInValidSession);
+ displayStatus(viewHolder, message, type, darkBackground);
return view;
}