android-components / mozilla.components.feature.addons.amo / AddonCollectionProvider


class AddonCollectionProvider : AddonsProvider (source)

Provide access to the collections AMO API.


Name Summary
<init> AddonCollectionProvider(context: <ERROR CLASS>, client: Client, serverURL: String = DEFAULT_SERVER_URL, collectionName: String = DEFAULT_COLLECTION_NAME, maxCacheAgeInMinutes: Long = -1)
Provide access to the collections AMO API.


Name Summary
getAddonIconBitmap suspend fun getAddonIconBitmap(addon: Addon): <ERROR CLASS>?
Fetches given Addon icon from the url and returns a decoded Bitmap
getAvailableAddons suspend fun getAvailableAddons(allowCache: Boolean): List<Addon>
Interacts with the collections endpoint to provide a list of available add-ons. May return a cached response, if available, not expired (see maxCacheAgeInMinutes) and allowed (see allowCache).

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.