Skip to content

Commit

Permalink
Merge pull request #12950 from nextcloud/feature/media-deletion-on-pr…
Browse files Browse the repository at this point in the history
…eview-screen-feedback

Give better feedback to the user for UNHANDLED_HTTP_CODE in PreviewMediaActivity
  • Loading branch information
alperozturk96 committed May 8, 2024
2 parents 033867d + 07d30bc commit 7492277
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ class PreviewMediaActivity :
override fun onRemoteOperationFinish(operation: RemoteOperation<*>?, result: RemoteOperationResult<*>?) {
super.onRemoteOperationFinish(operation, result)
if (operation is RemoveFileOperation) {
DisplayUtils.showSnackMessage(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, resources))
val errorMessage = ErrorMessageAdapter.getErrorCauseMessage(result, operation, resources)
DisplayUtils.showSnackMessage(this, errorMessage)

val removedFile = operation.file
val fileAvailable: Boolean = storageManager.fileExists(removedFile.fileId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ String getMessageForRemoveFileOperation(RemoteOperationResult result, Resources

} else {
if (result.getCode() == ResultCode.FORBIDDEN) {
// Error --> No permissions
return String.format(res.getString(R.string.forbidden_permissions),
res.getString(R.string.forbidden_permissions_delete));
return String.format(res.getString(R.string.forbidden_permissions), res.getString(R.string.forbidden_permissions_delete));
} else if (result.getCode() == ResultCode.LOCKED) {
return res.getString(R.string.preview_media_unhandled_http_code_message);
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@
<string name="instant_upload_path">/InstantUpload</string>
<string name="auto_upload_path">/AutoUpload</string>

<string name="preview_media_unhandled_http_code_message">File is currently locked by another user or process and therefore not deletable. Please try again later.</string>

<string name="preview_sorry">Sorry</string>
<string name="preview_image_description">Image preview</string>
<string name="preview_image_error_unknown_format">Unable to show image</string>
Expand Down
28 changes: 28 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5746,6 +5746,14 @@
<sha256 value="66afb9f2eea39427f6f03c14c5b82ca240157e22b8b2a764f0a7c8ad87cb2d3e" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="f6420365513febcb22f143dcaeed07a9d9d550d5">
<artifact name="android-library-f6420365513febcb22f143dcaeed07a9d9d550d5.aar">
<sha256 value="57ab4fd7c922875a7e0b5feac20aa27ab5df0fd3b4e042f92ed727c0b6316e81" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-f6420365513febcb22f143dcaeed07a9d9d550d5.module">
<sha256 value="c49ca5ef5c559b6ff33cff96ea4a484b95d60a5d47c6d7fc51532bbe67895c24" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="fb3552a4322c83ed32bbbdfa988fa2c16dba529a">
<artifact name="android-library-fb3552a4322c83ed32bbbdfa988fa2c16dba529a.aar">
<sha256 value="bdc44e874f1e14338213ae5723e71710940a31416ff1c52c9eb2f282e5d3f29a" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -9099,6 +9107,11 @@
<sha256 value="5b84b15cf2eef3e59eb91bc22784833100b09df9911e3319030c3bc648bd8b0b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.build" version="0.8.12">
<artifact name="org.jacoco.build-0.8.12.pom">
<sha256 value="250dcc9a1003e82095933f64869237752f36e70cb8a63f2cdf99b0c9613c09b9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.core" version="0.8.11">
<artifact name="org.jacoco.core-0.8.11.jar">
<sha256 value="fcd188c688473fc8dcc0c6caaf355e7b389502243527c33b9597a3ec28791f47" origin="Generated by Gradle"/>
Expand All @@ -9107,6 +9120,11 @@
<sha256 value="bb6135f10a36349cb84a5600fd8cf73fc1296a135b2f14adcd83de8cf24cabb1" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.core" version="0.8.12">
<artifact name="org.jacoco.core-0.8.12.pom">
<sha256 value="aa0b2773786886d51d188d7ed1a43f676efa21278520445bfef0ccb5d8cbe717" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.report" version="0.8.11">
<artifact name="org.jacoco.report-0.8.11.jar">
<sha256 value="8393295ae24680ed10cad8333907040f928b871332491581ca5bc784e2cb4fbe" origin="Generated by Gradle"/>
Expand All @@ -9115,6 +9133,11 @@
<sha256 value="8e3b734779d5e3fd683ec015413d52f961984c50cb9045fda2b23bff5eb42381" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jacoco" name="org.jacoco.report" version="0.8.12">
<artifact name="org.jacoco.report-0.8.12.pom">
<sha256 value="b7abd47a94e297f4befd10ad7aac51484b123e8fcca8e2d514d883e7543c8008" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.javassist" name="javassist" version="3.28.0-GA">
<artifact name="javassist-3.28.0-GA.jar">
<sha256 value="57d0a9e9286f82f4eaa851125186997f811befce0e2060ff0a15a77f5a9dd9a7" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -10319,6 +10342,11 @@
<sha256 value="8a0e5f624fe2930b7a8d69956f438e45ef532996b4d64409b616c4aef4b1ac4e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-bom" version="9.7">
<artifact name="asm-bom-9.7.pom">
<sha256 value="8c8651f3be043b3578dd28a15c0161861b15eb039b7f5247679c0cc0dbf07787" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.ow2.asm" name="asm-commons" version="9.2">
<artifact name="asm-commons-9.2.jar">
<sha256 value="be4ce53138a238bb522cd781cf91f3ba5ce2f6ca93ec62d46a162a127225e0a6" origin="Generated by Gradle"/>
Expand Down

0 comments on commit 7492277

Please sign in to comment.