diff options
-rw-r--r-- | build.gradle | 7 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 26 |
2 files changed, 29 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle index 89a310282..4ca246e98 100644 --- a/build.gradle +++ b/build.gradle @@ -45,6 +45,13 @@ dependencies { compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.android.support:multidex:1.0.0' + + compile 'com.squareup.picasso:picasso:2.4.0' + compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0' + + compile 'com.github.bumptech.glide:glide:3.5.2' + compile 'com.android.support:support-v4:22.0.0' + playstoreCompile 'com.google.android.gms:play-services-gcm:8.4.0' } diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 478bd5f05..6bb3459c8 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -42,7 +42,6 @@ import android.preference.PreferenceManager; import android.text.InputType; import android.util.DisplayMetrics; import android.util.Log; -import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; @@ -53,12 +52,15 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; +import com.bumptech.glide.Glide; +import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import com.squareup.picasso.Picasso; import net.java.otr4j.session.SessionID; @@ -67,8 +69,6 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.RunnableFuture; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; @@ -1206,6 +1206,24 @@ public abstract class XmppActivity extends Activity { } public void loadBitmap(Message message, ImageView imageView) { + //new + /*Picasso.with(this) + .load(xmppConnectionService.getFileBackend().getFile(message, true)) + .resize(300, 300) + .centerCrop() + .into(imageView); + Log.d(Config.LOGTAG,"Load image with picasso");*/ + + Glide.with(this) + .load(xmppConnectionService.getFileBackend().getFile(message, true)) + .override(288, 288) + .fitCenter() + .diskCacheStrategy(DiskCacheStrategy.RESULT) + .into(imageView); + //Log.d(Config.LOGTAG,"Load image with glide"); + + + /*old Bitmap bm; try { bm = xmppConnectionService.getFileBackend().getThumbnail(message, @@ -1231,7 +1249,7 @@ public abstract class XmppActivity extends Activity { ignored.printStackTrace(); } } - } + }*/ } public static boolean cancelPotentialWork(Message message, ImageView imageView) { |