Head Repository
Module repository, it contains all the methods required for the Main app to get data from the Module, abstract functions infoPage and sourceData are required, all other functions are optional.
Sample usage
class Repository : HeadRepository(){
override fun infoPage(link: String, bypassModel: BypassModel): Flow<InfoModel?> {
return flow {
emit(null)
}
}
override fun sourceData(link: String, bypassModel: BypassModel): Flow<SourceData?> {
return flow { emit(null) }
}
override suspend fun recentsPager(bypassModel: BypassModel): Flow<PagingData<RecentModel>> {
return Pager(
config = PagingConfig(
pageSize = 20,
enablePlaceholders = false
),
pagingSourceFactory = { RecentsSource() }
).flow
}
}
Functions
This function is called only if HeadConfig.analyticsSettings is declared, it's used to load a list of recommendations based on the user behaviour and the module configuration.
This function is called only if HeadConfig.isCalendarEnabled is enabled, it's used to create a daily calendar.
Declare custom Home sections
This function is used to declare the custom filters to be used in directoryPagerData.
This function is called only if HeadConfig.isDirectoryAvailable is enabled, it's used to load the directory of items.
Load a filtered list of the directory based on the payload from ClickAction.ExtraDirectory or Tag.payload
This function is called when loading the information page for any of this items:
This function is called only if HeadConfig.isRecentsAvailable and HeadConfig.isNotifyRecentsEnabled are enabled, it's used to get the latest sublist of recents.
This function is called only if HeadConfig.isRecentsAvailable is enabled, it's used for loading the recents section in Home.
This function is used to declare the custom filters to be used in searchPagerData.
This function is called only if HeadConfig.isSearchAvailable is enabled, it's used to search items in the module.
This function is called only if HeadConfig.isSearchSuggestionsAvailable is enabled, it's used for search autocompletion.
This function is called only if HeadConfig.reviewConfig is declared, it's called whe the user sends a review.
This function is called when loading the sources for a ContentItemModel it can be a VideoSource, GallerySource or a WebSource.
Load a profile with custom sections declared in the ProfileModel.