muzei-api / / ProviderClient


interface ProviderClient

Interface for interacting with a MuzeiArtProvider. Methods of this interface can be used directly within a MuzeiArtProvider or you can get an instance via ProviderContract.getProviderClient.



Retrieve the content URI for the MuzeiArtProvider, allowing you to build custom queries, inserts, updates, and deletes using a ContentResolver.

abstract val contentUri: Uri


Retrieve the last added artwork from the MuzeiArtProvider.

abstract val lastAddedArtwork: Artwork?



Add a new piece of artwork to the MuzeiArtProvider.

abstract fun addArtwork(artwork: Artwork): Uri?

Add multiple artwork as a batch operation to the MuzeiArtProvider.

abstract fun addArtwork(artwork: Iterable<Artwork>): List<Uri>


Set the MuzeiArtProvider to only show the given artwork, deleting any other artwork previously added. Only in the cases where the artwork is successfully inserted will the other artwork be removed.

abstract fun setArtwork(artwork: Artwork): Uri?
abstract fun setArtwork(artwork: Iterable<Artwork>): List<Uri>

Extension Functions


Deep link into Muzei's Sources screen, automatically scrolling to the associated with this ProviderClient. If Muzei is not yet activated, users will be asked to activate Muzei before continuing onto the Sources screen.

fun ProviderClient.createChooseProviderIntent(): Intent


Checks the MuzeiContract.Sources table provided by Muzei to determine whether the associated with this ProviderClient has been selected by the user.

fun ProviderClient.isSelected(context: Context): Boolean



Base class for a Muzei Live Wallpaper artwork provider. Art providers are a way for other apps to feed wallpapers (called artworks) to Muzei Live Wallpaper.

abstract class MuzeiArtProvider : ContentProvider, ProviderClient