Expanded folder sync functionality to support multiple folders and improved performance. (#47)
- Added `SyncedFolder` data class and transitioned from a single `syncedFolderUri` to a list of `syncedFolders`. - Implemented logic to add, remove, and persist multiple synced folders using JSON in shared preferences, including a migration path for legacy single-folder settings. - Updated `FolderSyncWorker` to iterate through all registered folders and added an annotation sidecar preloading optimization to reduce file I/O during sync. - Redesigned the "Folder Sync" UI in `LibraryScreen` to display a list of active folders with individual management options and a 3-folder limit. - Refined permission handling to request both read and write access for synced folders.
This commit is contained in:
parent
76780bff31
commit
6ea414c9b2
6 changed files with 426 additions and 298 deletions
|
|
@ -345,16 +345,15 @@ fun HomeScreen(
|
|||
onRefresh = { viewModel.refreshLibrary() },
|
||||
isRefreshing = uiState.isRefreshing,
|
||||
isSyncEnabled = uiState.isSyncEnabled,
|
||||
hasSyncedFolder = uiState.syncedFolderUri != null
|
||||
hasSyncedFolder = uiState.syncedFolders.isNotEmpty()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Loading Indicator Overlay
|
||||
if (uiState.isLoading) {
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background.copy(alpha = 0.7f) // Semi-transparent overlay
|
||||
color = MaterialTheme.colorScheme.background.copy(alpha = 0.7f)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue