Interface LibraryManager
public interface LibraryManager
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The interface that should be implemented to listen for completion ofdeleteItem(String, DeleteItemListener)
.static interface
The interface that should be implemented to listen for completion ofgetItem(String, GetItemListener)
.static interface
static interface
The interface that should be implemented to listen for modifications of the library.static interface
The interface that should be implemented to listen for completion ofsetItemLockState(String, LibraryItemLockState, SetItemLockStateListener)
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(LibraryManager.Listener listener) Adds a listener that will be notified when the library is modified.void
deleteItem
(LibraryItem item, LibraryManager.DeleteItemListener listener) void
deleteItem
(String id, LibraryManager.DeleteItemListener listener) void
getItem
(String id, LibraryManager.GetItemListener listener) Fetches an item by its identifier.void
getItems
(LibraryItemFilterType filter, LibraryItemOrderByField orderByField, boolean sortAscending, LibraryManager.GetItemsListener listener) Fetches a list of items matching the specified criteria.androidx.documentfile.provider.DocumentFile
long
long
long
Returns the amount of space remaining for library items, taking the value returned fromgetMaxDiskUsage()
into account.void
removeListener
(LibraryManager.Listener listener) Removes the specified listener.void
setItemLockState
(LibraryItem item, LibraryItemLockState lockState, LibraryManager.SetItemLockStateListener listener) Sets the lock state of the specified item.void
setItemLockState
(String id, LibraryItemLockState lockState, LibraryManager.SetItemLockStateListener listener) Sets the lock state of the specified item.void
setLibraryPath
(androidx.documentfile.provider.DocumentFile path) Sets the path to the library.void
setMaxDiskUsage
(long maxDiskUsageBytes) Sets the maximum disk space the library is allowed to use.
-
Method Details
-
getMaxDiskUsage
long getMaxDiskUsage()- Returns:
- The maximum disk usage in bytes.
- See Also:
-
setMaxDiskUsage
void setMaxDiskUsage(long maxDiskUsageBytes) Sets the maximum disk space the library is allowed to use.When total size of all library items reaches this value, old unlocked items will be automatically removed.
- Parameters:
maxDiskUsageBytes
- Maximum disk space in bytes.
-
getLibraryPath
androidx.documentfile.provider.DocumentFile getLibraryPath()- Returns:
- The path to the library.
-
setLibraryPath
Sets the path to the library.- Parameters:
path
- The path.- Throws:
IOException
- The library couldn't be initialized using the specified path.
-
getLibrarySize
long getLibrarySize()- Returns:
- Total size of all videos and images in bytes.
-
getRemainingSpace
long getRemainingSpace()Returns the amount of space remaining for library items, taking the value returned fromgetMaxDiskUsage()
into account.- Returns:
- The remaining space in bytes.
-