File tree Expand file tree Collapse file tree
app/src/main/java/app/grapheneos/camera/ui/composable/screen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ package app.grapheneos.camera.ui.composable.screen
22
33import android.content.ActivityNotFoundException
44import android.content.Intent
5- import android.provider.DocumentsContract
6- import android.provider.MediaStore
75import android.util.Log
86import android.widget.Toast
97import androidx.compose.animation.animateColorAsState
@@ -141,18 +139,7 @@ fun GalleryScreen(
141139 deletionItem = itemToBeDeleted,
142140 onDeleteAction = { item ->
143141 coroutineScope.launch {
144- var result = false
145-
146- val uri = item.uri
147- try {
148- result = if (uri.authority == MediaStore .AUTHORITY ) {
149- context.contentResolver.delete(uri, null , null ) > 0
150- } else {
151- DocumentsContract .deleteDocument(context.contentResolver, uri)
152- }
153- } catch (e: Exception ) {
154- e.printStackTrace()
155- }
142+ val result = item.delete(context)
156143
157144 if (result) {
158145 capturedItems.remove(item)
You can’t perform that action at this time.
0 commit comments