Show GIF image full screen using Fresco library - android

I'm using Fresco library to show images full screen. How to show animated GIF images full screen using that library? Is there any other optimal solution?

You have to add the dependency for Animated GIF decoding to your Gradle file:
implementation 'com.facebook.fresco:animated-gif:1.12.1'
Then, simply load the image into a SimpleDraweeView:
mSimpleDraweeView.setController(Fresco.newDraweeControllerBuilder()
.setAutoPlayAnimations(true)
.setOldController(simpleDraweeView.getController())
.setUri(yourGifUrl)
.build());

Related

How to animate webp image in android

I have used one webp image url in my app via glide and set it to image view but the image which is an animated one is not getting animated. Image is showing up but not getting animated.
You can use this library to animate webp file:
GlideWebpDecoder

Loading and resizing photos using fresco library

I want to make multiply loading of photos in each cardView at my news feed, like at facebook application.
I found fresco library, but I don't have an algorithm to doing such loading and resizing.
Help me please.
First you need to simply add the following line to the dependencies section of your build.gradle file:
compile 'com.facebook.fresco:fresco:0.12.0'
You use below links for resize:
http://frescolib.org/docs/resizing-rotating.html
https://guides.codepath.com/android/Displaying-Images-with-the-Fresco-Library
Once check for Glide as well

Glide Load Image Not Complte

A loading Gif And I use Glide to load Gif, And the third bar show to me is not complete, It show white area in third bar which is not be shown.(English is poor, sorry), like thisError Showing Dear all, How can I solve it?
ScaleType="fitXY"
Glide.with(context).load(R.drawable.loading).into(imageView);
1:
use GifImageView
<pl.droidsonroids.gif.GifImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/src_anim"
android:background="#drawable/bg_anim"
/>
Android-Gif-Drawable
Steps to load Gif images from drawable
You need to move your loading Gif image tores/raw folder of your project
(
if your project don't have raw folder in resource directly then simply make one and put your gif in it )
and then you can simply load your gif with just one line of code
Glide.with(this)
.load(R.raw.loading)
.into(new GlideDrawableImageViewTarget(
(ImageView) findViewById(R.id.image)));
Edits:-
White area in Gif image could be becaouse of streatching gif this is how it look like in my device
Alternatively you can look into this open source library for loading animation
https://github.com/81813780/AVLoadingIndicatorView

Display large images without lags

I have 4 images set as a background of screens in my application and displaying them cause lags in application. They have 1280x768px and about 70kb. How can I display them without loosing performance?
To use Picasso, simply add this to your gradle:
compile 'com.squareup.picasso:picasso:2.5.2'
And then, in case you have this image on our project folder:
Picasso.with(context).load(R.drawable.landing_screen).into(imageView1);
Instead, if you're downloading the image:
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
Source: http://square.github.io/picasso/
Check google's sample project here: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

Problem with Animated gif on Android

I need some advice about animation. I have an animated GIF, but how to put in Android app to be animation. When I put it doesn't move at all. I read something about animation in Android and I need to have pictures for animation. Is there any solution for this ?
Android does not support animated GIFs much. You can use an AnimationDrawable, perhaps defined from frames using a drawable XML file.
you can do it by using GIF image in your app as Splash screen.
Android does not support animated GIFs. so extract gif to png pictures with gif2png and it works with XML.
And Other Option Adding gif image in an ImageView in android
Adding gif image in an ImageView in android
100 % Work...
1) Add Glide library dependency...
compile 'com.github.bumptech.glide:glide:4.2.0'
2)
imageView = findViewById(R.id.gifImage);
3)
Glide.with(getApplicationContext())
.asGif()
.load(R.drawable.gifImage)
.into(imageView);
just use .asGif() before .load()

Categories

Resources