diff --git a/app/src/main/kotlin/com/syncflow/ui/files/FilesScreen.kt b/app/src/main/kotlin/com/syncflow/ui/files/FilesScreen.kt index cd8b671..d4a77fb 100644 --- a/app/src/main/kotlin/com/syncflow/ui/files/FilesScreen.kt +++ b/app/src/main/kotlin/com/syncflow/ui/files/FilesScreen.kt @@ -39,8 +39,9 @@ fun FilesScreen( val selectedPair by vm.selectedPair.collectAsState() val files by vm.files.collectAsState() val isDownloading by vm.isDownloading.collectAsState() - val isSelectionMode by vm.isSelectionMode.collectAsState() - val selectedCount by vm.selectedCount.collectAsState() + val selectedKeys by vm.selectedKeys.collectAsState() + val isSelectionMode = selectedKeys.isNotEmpty() + val selectedCount = selectedKeys.size val context = LocalContext.current val snackbarHostState = remember { SnackbarHostState() } val scope = rememberCoroutineScope() @@ -252,12 +253,11 @@ fun FilesScreen( } } items(dirFiles, key = { "${it.syncPairId}_${it.relativePath}" }) { file -> - val selected = vm.isSelected(file) FileRow( file = file, isInSubDir = dir.isNotEmpty() && !isSelectionMode, isSelectionMode = isSelectionMode, - isSelected = selected, + isSelected = vm.fileKey(file) in selectedKeys, vm = vm, ) HorizontalDivider( diff --git a/app/src/main/kotlin/com/syncflow/ui/files/FilesViewModel.kt b/app/src/main/kotlin/com/syncflow/ui/files/FilesViewModel.kt index 5cd172c..250564f 100644 --- a/app/src/main/kotlin/com/syncflow/ui/files/FilesViewModel.kt +++ b/app/src/main/kotlin/com/syncflow/ui/files/FilesViewModel.kt @@ -60,6 +60,7 @@ class FilesViewModel @Inject constructor( val isDownloading: StateFlow = _isDownloading private val _selectedKeys = MutableStateFlow>(emptySet()) + val selectedKeys: StateFlow> = _selectedKeys val isSelectionMode: StateFlow = _selectedKeys.map { it.isNotEmpty() } .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), false) val selectedCount: StateFlow = _selectedKeys.map { it.size } @@ -152,7 +153,7 @@ class FilesViewModel @Inject constructor( } } - private fun fileKey(file: SyncFileStateEntity) = "${file.syncPairId}:${file.relativePath}" + fun fileKey(file: SyncFileStateEntity) = "${file.syncPairId}:${file.relativePath}" // ── Download-then-open/share ────────────────────────────────────────────── diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index 102fd6a..5f03c4d 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,10 +1,36 @@ - - - + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 3e10f6e..6a3233f 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -6,45 +6,65 @@ android:viewportWidth="108" android:viewportHeight="108"> - - - + + + + + + + + android:endColor="#00BFA5"/> - - + + - + - - + + diff --git a/version.properties b/version.properties index d31376a..f2bd8c8 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -VERSION_NAME=1.0.25 -VERSION_CODE=26 +VERSION_NAME=1.0.26 +VERSION_CODE=27