Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected exit tranisition animation with zoom #179

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

KirkBushman
Copy link
Contributor

Hi,
I'm committing what we discussed in #176,
I've fixed the sample app, divided in two activities, and fixed the exit out animation while zoomed in the second activity.

We can delay the exit animation using finishAfterTransition() and un-zooming with some controls that I added to BIV.

Check it out, and let me know if it's good to commit. I want to try this in my app.

PS: I see some distorsion on Fresco, I see it has it's own animations method, we should try that,
I think, this lib should not fix the weirdness of Fresco, we integrated well with transition animation, that should be the end of it.

@Piasy
Copy link
Owner

Piasy commented Oct 22, 2019

Hi @KirkBushman , thanks for your contribution!

The code looks fine to me, but I did some test, the result seems depend on the image, please test with this setting:

    companion object {
        private const val THUMB_URL =
                "http://img1.imgtn.bdimg.com/it/u=1520386803,778399414&fm=21&gp=0.jpg"
        private const val SOURCE_URL =
                "https://youimg1.c-ctrip.com/target/tg/773/732/734/7ca19416b8cd423f8f6ef2d08366b7dc.jpg"
    }

@KirkBushman
Copy link
Contributor Author

It happens because the height of the image is greater than the height of the view, so it tries to fit it using scale type, but the thumbnail scaleType and the mainView scaleType are not the same.

For a better result we should use ScaleType fixXY on both, but since SSIV extends View and not ImageView, our hands are tied.

it happens differently with this:

private const val THUMB_URL =
"https://preview.redd.it/k18ckrkhrzt31.jpg?width=640&crop=smart&auto=webp&s=32ee988aaf9dd0af480cc2df104e38fd8ce73b03"
private const val SOURCE_URL =
"https://i.redd.it/k18ckrkhrzt31.jpg"

We should find a way to handle the scale type in SSIV, but the project is dead, no commits since may of last year, ignored all issues. We should evaluate using a fork that handles scale type the standard way. What do you think.

@Piasy
Copy link
Owner

Piasy commented Oct 24, 2019

Forking SSIV sounds not bad, you can try that :)

@KirkBushman
Copy link
Contributor Author

Wait, I can't tell if you're joking, I already have a fork of that, will you switch to a fork?

@Piasy
Copy link
Owner

Piasy commented Oct 24, 2019

I'm not joking...

If the issue could be fixed properly, I think it's okay to switch to another fork, at least for a special branch of BIV.

@KirkBushman
Copy link
Contributor Author

Ok, this is a more broad and complicated task, I'll do it as soon as I have time free

@KirkBushman
Copy link
Contributor Author

Hi @Piasy, long time no see, I was very busy during this month...

I started getting back to solve this problem once and for all, reworking SSIV, but I'm encountering difficulties: since SSIV is extending View directly and not ImageView, it's very different, and I always end up with some problem at the end.
I'll keep trying, and if desperate I'll move all the subsampling code in an external class that is working with ImageView like https://github.com/chrisbanes/PhotoView

But if anyone wants a quick fix for this type of problem, that works with both tall and wide images, you can watch my fork.

Since SSIV, by default uses a scale implementation very similar to fit center, and only works well with that, if you set both thumbnail to android:scaleType="fitCenter" you should see it working.

@KirkBushman
Copy link
Contributor Author

Hey it's me again.
I'm having some troubles with custom ImageViewFactory at the moment, can you read #187 and tell me what you think?

Maybe merge this till we can figure something out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants