From 447b25025e9e3964307578ef8adca412335a1e38 Mon Sep 17 00:00:00 2001 From: dawidfiruzek Date: Wed, 30 Nov 2016 10:50:31 +0100 Subject: [PATCH 1/2] Changed adjusting photo to ImageView fit() photo is changed to centerInside(), because of problem with scale. When proportions of the photo are different than ImageView's, photo is distorted while using fit() method. When we use centerInside() it is adjusted to at least one ImageView's dimension and it keeps the photo ratio. --- src/android/PhotoActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/PhotoActivity.java b/src/android/PhotoActivity.java index ed651e6..d35b633 100644 --- a/src/android/PhotoActivity.java +++ b/src/android/PhotoActivity.java @@ -138,7 +138,7 @@ private void loadImage() { if( imageUrl.startsWith("http") ) { Picasso.with(this) .load(imageUrl) - .fit() + .centerInside() .into(photo, new com.squareup.picasso.Callback() { @Override public void onSuccess() { From 4a2725b0c3ca815bf194cace5e4955d65d26f6cc Mon Sep 17 00:00:00 2001 From: dawidfiruzek Date: Wed, 30 Nov 2016 12:21:06 +0100 Subject: [PATCH 2/2] Added back fit() combined with centerInside() Added fit() method back combined with centerInside(), because of case with huge images. When that case is present, photo is scalled down and then it will be center inside ImageView just like explained in previous commit. --- src/android/PhotoActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/PhotoActivity.java b/src/android/PhotoActivity.java index d35b633..9a17c0c 100644 --- a/src/android/PhotoActivity.java +++ b/src/android/PhotoActivity.java @@ -138,6 +138,7 @@ private void loadImage() { if( imageUrl.startsWith("http") ) { Picasso.with(this) .load(imageUrl) + .fit() .centerInside() .into(photo, new com.squareup.picasso.Callback() { @Override