wait for mediascanner at some callbacks

This commit is contained in:
tibbi 2016-12-05 23:17:02 +01:00
parent 609cfbd580
commit d0e81a3410
2 changed files with 8 additions and 6 deletions

View file

@ -91,9 +91,10 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
updatedFiles.add(destination)
}
context.scanFiles(updatedFiles) {}
dismiss()
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
context.scanFiles(updatedFiles) {
dismiss()
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
}
}
}
})

View file

@ -4,9 +4,9 @@ import android.app.AlertDialog
import android.view.LayoutInflater
import android.view.WindowManager
import com.simplemobiletools.filepicker.extensions.*
import com.simplemobiletools.gallery.helpers.Config
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.helpers.Config
import kotlinx.android.synthetic.main.rename_file.view.*
import java.io.File
@ -73,7 +73,8 @@ class RenameFileDialog(val activity: SimpleActivity, val file: File, val callbac
private fun sendSuccess(currFile: File, newFile: File) {
val changedFiles = arrayListOf(currFile, newFile)
activity.scanFiles(changedFiles) {}
callback.invoke(newFile)
activity.scanFiles(changedFiles) {
callback.invoke(newFile)
}
}
}