From 8a727202e9179194ded9b1b8bc9dccaad739e388 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Thu, 12 Dec 2024 15:40:49 +0100 Subject: [PATCH] add comments to do functions Signed-off-by: alperozturk --- .../java/com/nextcloud/client/jobs/sync/SyncWorker.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/nextcloud/client/jobs/sync/SyncWorker.kt b/app/src/main/java/com/nextcloud/client/jobs/sync/SyncWorker.kt index f7e4c6b439..777fa5e9e6 100644 --- a/app/src/main/java/com/nextcloud/client/jobs/sync/SyncWorker.kt +++ b/app/src/main/java/com/nextcloud/client/jobs/sync/SyncWorker.kt @@ -39,6 +39,9 @@ class SyncWorker( private var downloadingFilePaths = ArrayList() + /** + * It is used to add the sync icon next to the file in the folder. + */ fun isDownloading(path: String): Boolean { return downloadingFilePaths.contains(path) } @@ -112,6 +115,9 @@ class SyncWorker( } } + /** + * It is used to remove the sync icon next to the file in the folder. + */ private fun sendFileDownloadCompletionBroadcast(path: String) { val intent = Intent(FILE_DOWNLOAD_COMPLETION_BROADCAST).apply { putExtra(FILE_PATH, path) @@ -120,6 +126,10 @@ class SyncWorker( LocalBroadcastManager.getInstance(context).sendBroadcast(intent) } + /** + * This function is called when the download of all files in a folder is complete. + * It is used to add a green tick icon next to the files after the download process is finished. + */ private fun sendSyncWorkerCompletionBroadcast() { val intent = Intent(SYNC_WORKER_COMPLETION_BROADCAST) LocalBroadcastManager.getInstance(context).sendBroadcast(intent)