File tree Expand file tree Collapse file tree
java/com/abizer_r/quickedit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ fun MainScreen(
5959 isGranted = perms[permission] == true
6060 )
6161 }
62- if (perms.values.all { true }) {
62+ if (perms.values.all { granted -> granted }) {
6363 viewModel.permissionsGranted.value = true
6464 }
6565 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import android.os.Environment
99import android.provider.MediaStore
1010import androidx.annotation.RequiresApi
1111import androidx.core.content.FileProvider
12+ import com.abizer_r.quickedit.R
1213import java.io.File
1314import java.io.FileInputStream
1415
@@ -65,7 +66,8 @@ object FileUtils {
6566 copyFileToUri(context.contentResolver, file, uri)
6667 onSuccess()
6768 } else {
68- onFailure(null )
69+ onFailure(context.getString(R .string.fail_to_insert_uri_in_content_resolver))
70+ return
6971 }
7072 }
7173
@@ -89,6 +91,7 @@ object FileUtils {
8991 copyFile(file, externalStorageDir)
9092 } catch (e: Exception ) {
9193 onFailure(e.message)
94+ return
9295 }
9396
9497 // Make the file visible in the gallery
@@ -103,7 +106,8 @@ object FileUtils {
103106 copyFileToUri(context.contentResolver, file, uri)
104107 onSuccess()
105108 } else {
106- onFailure(null )
109+ onFailure(context.getString(R .string.fail_to_insert_uri_in_content_resolver))
110+ return
107111 }
108112 }
109113
Original file line number Diff line number Diff line change 3434 <string name =" following_permissions_are_required" >Following permissions are required to perform this action:\n</string >
3535 <string name =" perm_item_storage" >- Storage\n</string >
3636 <string name =" app_not_found" >App not found</string >
37+ <string name =" fail_to_insert_uri_in_content_resolver" >Couldn\'t insert uri in content resolver</string >
3738</resources >
You can’t perform that action at this time.
0 commit comments