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

What version of fresco first supported Vito? #2781

Open
snijsure opened this issue Jul 29, 2024 · 3 comments
Open

What version of fresco first supported Vito? #2781

snijsure opened this issue Jul 29, 2024 · 3 comments

Comments

@snijsure
Copy link

Description

I have looked through fresco release notes and unfortunately haven't found first release where Vito support was first added.

I am looking to migrate large project from Glide to Fresco. The simpleviewee change is going to complicate things. Then watched one of the old droidcon presentations that mentioned Vito. So very much interested in knowing what version fresco first supported Vito.

Also lot of documentation still refers to simpleviewee, is there documentation around use of Vito?

Thanks for any help!!

Additional Information

  • Fresco version: [FILL THIS OUT]
  • Platform version: [FILL THIS OUT: specific to a particular Android version? Device?]
@oprisnik
Copy link
Contributor

Hey! Thanks for reaching out.

The first Vito version was part of 2.5.0, but as an alpha: https://repo.maven.apache.org/maven2/com/facebook/fresco/vito-view/

So you'd have to specify the version as [2.5.0-alpha/](https://repo.maven.apache.org/maven2/com/facebook/fresco/vito-view/2.5.0-alpha/)

I would recommend to use more recent versions since we made significant improvements to Vito since then.

Regarding migrating from Drawee to Vito, we've started to update our sample apps, and you can look at the migration changes for example for Showcase. such as this one: 0bb6fee

@snijsure snijsure closed this as completed Aug 5, 2024
@snijsure
Copy link
Author

snijsure commented Aug 5, 2024

Thanks for the pointer. Curious to know how calls like these will look like when using Vito objects. I will keep an eye on the samples.

            val roundingParams = RoundingParams.asCircle()
            imageView.hierarchy.roundingParams = roundingParams

Also to execute image request like this when using Vito.


            val imageRequestBuilder =
                ImageRequestBuilder
                    .newBuilderWithSource(Uri.parse(url))
                    .setProgressiveRenderingEnabled(true)

            val imageRequest = imageRequestBuilder.build()
            val controller =
                Fresco
                    .newDraweeControllerBuilder()
                    .setImageRequest(imageRequest)
                    .setOldController(imageView.controller)
                    .setTapToRetryEnabled(true)
                    .build()
            imageView.setController(controller)

@snijsure snijsure reopened this Aug 5, 2024
@oprisnik
Copy link
Contributor

oprisnik commented Aug 7, 2024

For the first case, rounding options:

val imageOptions = ImageOptions.create().round(RoundingOptions.asCircle()).build()

VitoView.show(uri, imageOptions, imageView)

For the second case:

// Ideally you'd only create this once and pass the same imageOptions object to all images
val imageOptions = ImageOptions.create().progressiveRendering(true).build()

VitoView.show(Uri.parse(url), imageOptions, imageView)

With the caveat that the tap to retry handling is only available for Litho at the moment via FrescoVitoTapToRetryImageSpec:

* This source code is licensed under the MIT license found in the

Since Vito is directly operating on ImageView.

However, adding a custom ImageListener as shown in FrescoVitoTapToRetryImageSpec and tracking whether the image is loaded and handling the tap accordingly should be straightforward. If you'd like to contribute, this is a good opportunity to create a simple TapToRetryImageView based on the Litho variant.

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

No branches or pull requests

2 participants