aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <kriztan@users.noreply.github.com>2016-10-18 13:21:57 +0200
committerGitHub <noreply@github.com>2016-10-18 13:21:57 +0200
commit31d2252043acaeccdc8b7af088524fa795c35a1a (patch)
treedad5bdf8dcdfd3a036ceeaddcfbeaae93cbf23e2 /src/main/java/de/pixart/messenger
parent94a45d8458ac8e02c994a16023ecf026210a2bad (diff)
don't show 0 KiB if filesize is smaller than 1 KiB
and show MiB also if filesize is > 1x1024x1024 bytes
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java6
1 files changed, 4 insertions, 2 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 f0db05626..e3e77c589 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -158,10 +158,12 @@ public class MessageAdapter extends ArrayAdapter<Message> {
&& message.getMergedStatus() <= Message.STATUS_RECEIVED;
if (message.getType() == Message.TYPE_IMAGE || message.getType() == Message.TYPE_FILE || message.getTransferable() != null) {
FileParams params = message.getFileParams();
- if (params.size > (1.5 * 1024 * 1024)) {
+ if (params.size > (1 * 1024 * 1024)) {
filesize = params.size / (1024 * 1024)+ " MiB";
- } else if (params.size > 0) {
+ } else if (params.size > (1 * 1024)) {
filesize = params.size / 1024 + " KiB";
+ } else if (params.size > 0) {
+ filesize = "1 KiB";
}
if (message.getTransferable() != null && message.getTransferable().getStatus() == Transferable.STATUS_FAILED) {
error = true;