Skip to content

Commit

Permalink
always download unsupported image
Browse files Browse the repository at this point in the history
Signed-off-by: parneet-guraya <[email protected]>
  • Loading branch information
parneet-guraya authored and alperozturk96 committed Sep 23, 2024
1 parent b5fa83c commit 6b5e3e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ protected void onPostExecute(Bitmap bitmap) {
}
} else {
if (fileFragment instanceof PreviewImageFragment) {
((PreviewImageFragment) fileFragment).setErrorPreviewMessage();
((PreviewImageFragment) fileFragment).handleUnsupportedImage();
}
}
}).start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,28 +721,14 @@ class PreviewImageFragment : FileFragment(), Injectable {
binding.emptyListProgress.visibility = View.GONE
}

fun setErrorPreviewMessage() {
fun handleUnsupportedImage() {
try {
if (activity != null) {
(activity as? PreviewImageActivity)?.requestForDownload(file) ?: context?.let {
Snackbar.make(
binding.emptyListView,
R.string.resized_image_not_possible_download,
resources.getString(R.string.could_not_download_image),
Snackbar.LENGTH_INDEFINITE
)
.setAction(
R.string.common_yes
) { v: View? ->
val activity = activity as PreviewImageActivity?
if (activity != null) {
activity.requestForDownload(file)
} else if (context != null) {
Snackbar.make(
binding.emptyListView,
resources.getString(R.string.could_not_download_image),
Snackbar.LENGTH_INDEFINITE
).show()
}
}.show()
).show()
}
} catch (e: IllegalArgumentException) {
Log_OC.d(TAG, e.message)
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,6 @@

<string name="sync_in_progress">Fetching most recent version of the file.</string>

<string name="resized_image_not_possible_download">No resized image available. Download full image?</string>

<string name="store_short_desc">The self-hosted productivity platform that keeps you in control</string>
<string name="store_full_desc">The self-hosted productivity platform that keeps you in control.\n\nFeatures:\n* Easy, modern interface, suited to the theme of your server\n* Upload files to your Nextcloud server\n* Share them with others\n* Keep your favorite files and folders synced\n* Search across all folders on your server\n* Auto Upload for photos and videos taken by your device\n* Keep up to date with notifications\n* Multi-account support\n* Secure access to your data with fingerprint or PIN\n* Integration with DAVx5 (formerly known as DAVdroid) for easy setup of calendar and contacts synchronization\n\nPlease report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android\n\nNew to Nextcloud? Nextcloud is a private file sync and share and communication server. It is libre software, and you can host it yourself or pay a company to do it for you. That way, you are in control of your photos, your calendar and contact data, your documents and everything else.\n\nCheck out Nextcloud at https://nextcloud.com</string>

Expand Down

0 comments on commit 6b5e3e9

Please sign in to comment.