diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-03-31 11:15:31 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-03-31 11:15:31 +0200 |
commit | 0aadf62cd597662493a26a1d0d522670a805578a (patch) | |
tree | 4d32386ef503db98410b96fe264547dbdce7ec31 /src/main/java/de/pixart/messenger/ui/adapter | |
parent | 061771300e0b85463e149366293a0e59d01e6bdf (diff) |
rework max file upload size in server info
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 8 |
1 files changed, 1 insertions, 7 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 be483a5f6..203b3a343 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -221,13 +221,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie && message.getMergedStatus() <= Message.STATUS_RECEIVED; if (message.isFileOrImage() || transferable != null) { FileParams params = message.getFileParams(); - if (params.size > (1 * 1024 * 1024)) { - filesize = Math.round(params.size * 1f / (1024 * 1024)) + " MiB"; - } else if (params.size >= (1 * 1024)) { - filesize = Math.round(params.size * 1f / 1024) + " KiB"; - } else if (params.size > 0) { - filesize = params.size + " B"; - } + filesize = params.size > 0 ? UIHelper.filesizeToString(params.size) : null; if (transferable != null && transferable.getStatus() == Transferable.STATUS_FAILED) { error = true; } |