mirror of
https://github.com/nextcloud/android.git
synced 2024-12-20 07:52:18 +03:00
add comments to do functions
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
edee06d0d8
commit
8a727202e9
1 changed files with 10 additions and 0 deletions
|
@ -39,6 +39,9 @@ class SyncWorker(
|
|||
|
||||
private var downloadingFilePaths = ArrayList<String>()
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
|
Loading…
Reference in a new issue