Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69bbb97b2a | ||
|
|
c8adf537d4 |
@@ -92,8 +92,8 @@ android {
|
||||
applicationId = "com.example.research"
|
||||
minSdk = project.property("minSdk").toString().toInt()
|
||||
targetSdk = project.property("targetSdk").toString().toInt()
|
||||
versionCode = 4
|
||||
versionName = "1.2.0"
|
||||
versionCode = 5
|
||||
versionName = "1.2.1"
|
||||
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
@@ -114,12 +114,9 @@ android {
|
||||
abiFilters += "arm64-v8a"
|
||||
}
|
||||
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
optimization {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ class DownloadManager(
|
||||
mutableDownloadProgressState.asStateFlow()
|
||||
private val mutex = Mutex()
|
||||
private var downloadJob: Job? = null
|
||||
private var cancelCleanupJob: Job? = null
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DownloadManager"
|
||||
@@ -44,6 +45,7 @@ class DownloadManager(
|
||||
fun startDownload() {
|
||||
if (downloadState.value is DownloadState.Loading) return
|
||||
if (!downloadScope.isActive) return
|
||||
cancelCleanupJob = null
|
||||
downloadJob = downloadScope.launch {
|
||||
mutex.withLock {
|
||||
try {
|
||||
@@ -94,7 +96,7 @@ class DownloadManager(
|
||||
} catch (e: Exception) {
|
||||
if (e is CancellationException) {
|
||||
updateDownloadProgressState(DownloadState.Cancelled, 0f)
|
||||
downloadScope.launch {
|
||||
cancelCleanupJob = downloadScope.launch {
|
||||
try {
|
||||
dictionaryRepository.deleteUnprocessedFiles()
|
||||
} catch (cleanupException: Exception) {
|
||||
@@ -124,6 +126,7 @@ class DownloadManager(
|
||||
fun startDownloadForSources(sourceUrls: List<String>) {
|
||||
if (downloadState.value is DownloadState.Loading) return
|
||||
if (!downloadScope.isActive) return
|
||||
cancelCleanupJob = null
|
||||
downloadJob = downloadScope.launch {
|
||||
mutex.withLock {
|
||||
try {
|
||||
@@ -168,7 +171,7 @@ class DownloadManager(
|
||||
} catch (e: Exception) {
|
||||
if (e is CancellationException) {
|
||||
updateDownloadProgressState(DownloadState.Cancelled, 0f)
|
||||
downloadScope.launch {
|
||||
cancelCleanupJob = downloadScope.launch {
|
||||
try {
|
||||
dictionaryRepository.deleteUnprocessedFiles()
|
||||
} catch (cleanupException: Exception) {
|
||||
@@ -195,10 +198,12 @@ class DownloadManager(
|
||||
}
|
||||
}
|
||||
fun cancelDownload() {
|
||||
downloadJob?.cancel()
|
||||
val jobToCancel = downloadJob
|
||||
jobToCancel?.cancel()
|
||||
updateDownloadProgressState(DownloadState.Cancelled, 0f)
|
||||
downloadScope.launch {
|
||||
delay(TERMINAL_STATE_DURATION)
|
||||
jobToCancel?.join()
|
||||
cancelCleanupJob?.join()
|
||||
if (downloadState.value == DownloadState.Cancelled) {
|
||||
updateDownloadProgressState(DownloadState.Idle, 0f)
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
- Fixed the dictionary update card taking too long to reappear after cancelling a download
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1 @@
|
||||
- Исправлена лишняя задержка перед повторным появлением карточки обновления словаря после отмены загрузки
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
aboutlibraries = "15.0.4"
|
||||
activity_compose = "1.13.0"
|
||||
agp = "9.3.0"
|
||||
agp = "9.3.1"
|
||||
compose_bom = "2026.06.01"
|
||||
core = "1.19.0"
|
||||
datastore_preferences = "1.2.1"
|
||||
|
||||
Reference in New Issue
Block a user