Package-level declarations
Albums management.
Albums
This guide describes methods for working with albums. The guide is logically divided into two parts
Album Actions and Album Content Actions.
Read Album List From Backend
To get started with the albums, first of all get information about the family albums from the backend.
Important. Since the download procedure takes some time (and, on the other hand, does not require permission from the user), it should be started as soon as the user is logged into the application.
For getting the list of albums from the backend, use the fetchAlbums() method. You need to pass a list of album types that you want to retrieve. All supported album types are listed in AlbumType data class. Example code:
val photoManager: PhotoManager
val userId: Long
lifecycleScope.launch {
photoManager.albums.fetchAlbums(
types = setOf(
AlbumType.SIMPLE,
AlbumType.FLASHBACK,
AlbumType.PLACES,
),
userId = userId
)
}Get Albums List
The Photos SDK provides information about albums for the client application as a paged list of AlbumItem objects.
To request a list of albums, you need to use the createPagingAlbumsFlow() method. This method creates a Flow that emits PagingData of AlbumItem every time there is a change to the local database. The method takes the following parameters:
albumTypes - a list of album types that you want to retrieve. All supported album types are listed in the AlbumType class. The default value is listOf(AlbumType.SIMPLE, AlbumType.SHARED).
minItemCount - the minimum number of items in an album for it to be included in the list. The default value is 0.
limit - the number of items to retrieve. The default value is null. To display the paginated list in the RecyclerView, you must use PagingDataAdapter from the Android Paging Library.
The Cloudike Photos SDK uses the following Android Paging Library.