Closed aritraroy closed 8 years ago
Did you try the sample app? That's not happening. Could you provide steps to reproduce it?
This is my XML
<com.flaviofaria.kenburnsview.KenBurnsView
android:id="@+id/nav_header_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cover_1" />
This is how I set the drawable programatically,
Drawable drawable = Drawable.createFromPath(fileName.getAbsolutePath());
navHeader.setImageDrawable(drawable);
This is how I am playing/pausing it,
if (isAnimOn)
navHeader.resume();
else
navHeader.pause();
Can you please point out what is the mistake here?
I have tried a lot, but still have the problem. Any help?
I used to have this issue when specifying CENTER_CROP as the scale type. Removing it solved the issue for me.
Strange because, according to the KenBurnsView.java source, .setScaleType() is not supposed to do anything.
EDIT: I still kept getting it when using Picasso to load images into a KenBurnsView. However, the issue went away when loading a bitmap into the KenBurnsView directly instead of letting Picasso do it. I think it may have something to do with drawable bounds. Try to see if setImageBitmap() fixes your issue.
When the animation plays, its perfectly fine. But when I use view.pause() then the animations stops but the image becomes very small in size.
How can this problem be solved? I need to give the users a way to stop the animation of this View if they want to.