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