aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-25 23:06:20 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-25 23:06:20 +0200
commit645139eb68cb966b90d36790e5b60c0bc6727c78 (patch)
tree9633c20bd4f2e5aa1906373bdea5a07b1aacd6fc /src/eu/siacs/conversations/ui/ConversationFragment.java
parentbf2d0d5596a08872230056d056241ee906962171 (diff)
couple of more optimazations on image loading
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index d42b33c4..5ade8a53 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -301,16 +301,16 @@ public class ConversationFragment extends Fragment {
viewHolder.image.setVisibility(View.VISIBLE);
String[] params = item.getBody().split(",");
if (params.length==3) {
- int target = (int) (metrics.density * 288);
+ double target = metrics.density * 288;
int w = Integer.parseInt(params[1]);
int h = Integer.parseInt(params[2]);
int scalledW;
int scalledH;
if (w <= h) {
scalledW = (int) (w / ((double) h / target));
- scalledH = target;
+ scalledH = (int) target;
} else {
- scalledW = target;
+ scalledW = (int) target;
scalledH = (int) (h / ((double) w / target));
}
viewHolder.image.setLayoutParams(new LinearLayout.LayoutParams(scalledW, scalledH));