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

AddonCollectionProvider

class AddonCollectionProvider : AddonsProvider (source)

Provide access to the collections AMO API. https://addons-server.readthedocs.io/en/latest/topics/api/collections.html

Constructors

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. https://addons-server.readthedocs.io/en/latest/topics/api/collections.html

Functions

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.