From 95f4317eafb583e7e4a84a9b9a5d51622bdda01d Mon Sep 17 00:00:00 2001 From: OneWay Date: Mon, 21 Sep 2026 09:00:12 +0800 Subject: [PATCH] fix: honest indexing progress and preparing phase label --- .../example/research/common/progress/DictionaryProgressModel.kt | 2 +- .../research/data/repository/LocalDictionaryRepository.kt | 2 +- app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/research/common/progress/DictionaryProgressModel.kt b/app/src/main/java/com/example/research/common/progress/DictionaryProgressModel.kt index cdc14c0..9073975 100644 --- a/app/src/main/java/com/example/research/common/progress/DictionaryProgressModel.kt +++ b/app/src/main/java/com/example/research/common/progress/DictionaryProgressModel.kt @@ -109,7 +109,7 @@ object DictionaryProgressModel { return Snapshot( progress = p, percent = (p * 100f).toInt().coerceIn(0, 100), - titleRes = R.string.notification_indexing_title, + titleRes = R.string.notification_preparing_indexing_title, ) } diff --git a/app/src/main/java/com/example/research/data/repository/LocalDictionaryRepository.kt b/app/src/main/java/com/example/research/data/repository/LocalDictionaryRepository.kt index be7d581..1033d58 100644 --- a/app/src/main/java/com/example/research/data/repository/LocalDictionaryRepository.kt +++ b/app/src/main/java/com/example/research/data/repository/LocalDictionaryRepository.kt @@ -182,7 +182,7 @@ class LocalDictionaryRepository( progressTracker = ProgressTracker(filesToScan) existingDictionaries.forEach { dict -> - progressTracker?.updateFileProgress(dict.name, 1.0f) + progressTracker?.updateFileProgress(File(dict.path).name, 1.0f) } mutableIndexingProgress.emit( diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index bd511f0..55dd6c7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -47,6 +47,7 @@ Ошибка загрузки Не удалось скачать словари Индексация словарей + Подготовка словарей к индексации Не удалось открыть исходный файл Не удалось создать выходной файл Не удалось удалить файл: %1$s diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2a03b5a..7c151db 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -47,6 +47,7 @@ Download error Failed to download dictionaries Indexing dictionaries + Preparing dictionaries for indexing Failed to open source file Failed to create output file Failed to delete file: %1$s