mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Use AttachmentSaver to save image editor files to device storage.
This commit is contained in:
committed by
Cody Henthorne
parent
b1ff5dc5ef
commit
f0bb74a187
@@ -11,6 +11,8 @@ import android.widget.CheckBox
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import io.reactivex.rxjava3.core.Completable
|
||||
import kotlinx.coroutines.rx3.rxCompletable
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.signal.core.ui.view.AlertDialogResult
|
||||
import org.signal.core.ui.view.awaitResult
|
||||
@@ -52,6 +54,8 @@ class AttachmentSaver(private val host: Host) {
|
||||
saveAttachments(attachments)
|
||||
}
|
||||
|
||||
fun saveAttachmentsRx(attachments: Set<SaveAttachment>): Completable = rxCompletable { saveAttachments(attachments) }
|
||||
|
||||
suspend fun saveAttachments(attachments: Set<SaveAttachment>) {
|
||||
if (checkIsSaveWarningAccepted(attachmentCount = attachments.size) == SaveToStorageWarningResult.ACCEPTED) {
|
||||
if (checkCanWriteToMediaStore() == RequestPermissionResult.GRANTED) {
|
||||
|
||||
Reference in New Issue
Block a user