android-components / mozilla.components.feature.top.sites / TopSiteStorage

TopSiteStorage

class TopSiteStorage (source)

A storage implementation for organizing top sites.

Constructors

Name Summary
<init> TopSiteStorage(context: <ERROR CLASS>)
A storage implementation for organizing top sites.

Functions

Name Summary
addTopSite fun addTopSite(title: String, url: String): Unit
Adds a new TopSite.
getTopSites fun getTopSites(): LiveData<List<TopSite>>
Returns a LiveData list of all the TopSite instances.
getTopSitesPaged fun getTopSitesPaged(): Factory<Int, TopSite>
Returns all TopSites as a DataSource.Factory.
removeTopSite fun removeTopSite(site: TopSite): Unit
Removes the given TopSite.

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.