aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-01-30 18:44:17 +0100
committerChristian Schneppe <christian@pix-art.de>2017-01-30 18:44:17 +0100
commit4a38942f3bb2d56517146ea2a26661ddf4f5809d (patch)
tree413ccf3dcafa2a255e76fc6b6cf957f395816b92 /src/main
parent8340212dc47f2c941fbb28bc4b14002f08797088 (diff)
play gif files in fullscreen
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
index a8253fd1c..b78dec72a 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
@@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
-import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
@@ -19,8 +18,9 @@ import android.widget.ImageView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.animation.GlideAnimation;
-import com.bumptech.glide.request.target.BitmapImageViewTarget;
+import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
import com.github.rtoshiro.view.video.FullscreenVideoLayout;
import java.io.File;
@@ -172,15 +172,15 @@ public class ShowFullscreenMessageActivity extends Activity {
try {
Glide.with(this)
.load(file)
- .asBitmap()
- .into(new BitmapImageViewTarget(mImage) {
+ .into(new GlideDrawableImageViewTarget(mImage) {
@Override
- public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
- super.onResourceReady(resource, glideAnimation);
+ public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
+ super.onResourceReady(resource, animation);
mAttacher.update();
}
});
} catch (Exception e) {
+ Toast.makeText(this, getString(R.string.error_file_corrupt), Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
@@ -228,6 +228,7 @@ public class ShowFullscreenMessageActivity extends Activity {
mVideo.setShouldAutoplay(true);
} catch (IOException e) {
+ Toast.makeText(this, getString(R.string.error_file_corrupt), Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}