Muzei API 3.1.0 Alpha 1 includes a number of functional and API changes. It is compatible with Muzei 3.0.2 and higher.
- #587 allows a
MuzeiArtProvider
to implementisArtworkValid(Artwork)
to confirm that anArtwork
that being opened is still valid, even if the image is cached. - #588 ensures that
onInvalidArtwork(Artwork)
is called in cases where you return false fromisArtworkValid()
- #589 treats all non-IOExceptions (rather than just any
SecurityException
) coming fromopenFile
as permanent errors resulting in a callback toonInvalidArtwork
. - #590 - static methods in
ProviderContract.Artwork
have been deprecated, with alternatives now encapsulated in the newProviderClient
interface- Methods that took a
Class
can now be accessed by usingProviderContract.getProviderClient(Context, Class)
- Methods that took a
String authority
can now be accessed by usingProviderContract.getProviderClient(Context, String)
MuzeiArtProvider
itself now implementsProviderClient
, ensuring that the same APIs are also available directly withinMuzeiArtProvider
- The helper method
ProviderContract.Artwork.getContentUri(String authority)
is now available viaProviderContract.getContentUri(String)
.
- Methods that took a
- #591 provides an
addArtwork
API onProviderClient
that takes multiple Artwork, allowing batch inserts - #592 provides a
setArtwork
API onProviderClient
that takes multiple Artwork, automatically deleting any Artwork not in the given list
See milestone for full change details.
Include the Muzei API in your app by adding the dependency to your build.gradle
:
implementation "com.google.android.apps.muzei:muzei-api:3.1.0-alpha01"