diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-04-05 20:28:08 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-04-05 22:21:41 +0200 |
commit | 04a060761699fc82440dcc79b716c2071973877c (patch) | |
tree | 2363c51dd6a6790dc373185351597567a7290fa7 /src/main/java/de/pixart/messenger/ui | |
parent | bb22bc712f537294ea4b444999e454ab0b3504f6 (diff) |
show file size for files smaller 1024 bytes
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 10 |
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; } |