Krisenvorrat Inventar-App – Android-App (Kotlin) zur Verwaltung eines Krisenvorrats-Inventars
SettingsScreen: Added import button that opens the system file picker (ActivityResultContracts.OpenDocument) filtered to application/json. After file selection, a confirmation dialog warns that existing data will be overwritten. Import result is shown in a success/error dialog. SettingsViewModel: Added onImportFileSelected(uri), onImportConfirmed(), onImportDismissed(), onImportResultDismissed() methods. The import reads the file via contentResolver.openInputStream() and delegates to the existing ImportExportRepository.importFromJson(). Settings are reloaded after successful import. SettingsUiState: Extended with isImporting, importResult (sealed interface ImportResult with Success/Error), and pendingImportUri for the confirmation dialog flow. SettingsViewModelTest: Added 6 unit tests covering import success, invalid JSON error, empty file, null input stream, dialog state management, and result dismissal. Closes #38 |
||
|---|---|---|
| .github | ||
| .vscode | ||
| Anforderungen | ||
| app | ||
| gradle | ||
| memories/repo | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| settings.gradle.kts | ||