Merge pull request #2752 from nextcloud/bugfix/2729/fixThumbnailsInFileBrowser

Fix to show thumbnails in FileBrowser
This commit is contained in:
Marcel Hibbe 2023-02-10 13:49:29 +01:00 committed by GitHub
commit 01128b7b93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View file

@ -137,7 +137,7 @@ fun ImageView.loadThumbnail(url: String, user: User): io.reactivex.disposables.D
}
if (url.startsWith(user.baseUrl!!) &&
(url.contains("index.php/core/preview?fileId=") || url.contains("/avatar/"))
(url.contains("index.php/core/preview") || url.contains("/avatar/"))
) {
requestBuilder.addHeader(
"Authorization",
@ -163,7 +163,7 @@ fun ImageView.loadImage(url: String, user: User, placeholder: Drawable? = null):
.transformations(RoundedCornersTransformation(ROUNDING_PIXEL, ROUNDING_PIXEL, ROUNDING_PIXEL, ROUNDING_PIXEL))
if (url.startsWith(user.baseUrl!!) &&
(url.contains("index.php/core/preview?fileId=") || url.contains("/avatar/"))
(url.contains("index.php/core/preview") || url.contains("/avatar/"))
) {
requestBuilder.addHeader(
"Authorization",

View file

@ -147,7 +147,6 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe
viewModel.selectedPaths.observe(this) { selectedPaths ->
filesSelectionDoneMenuItem?.isVisible = !selectedPaths.isNullOrEmpty()
binding.recyclerView.adapter?.notifyDataSetChanged()
}
}

View file

@ -96,13 +96,13 @@ class RemoteFileBrowserItemsListViewHolder(
val path = ApiUtils.getUrlForFilePreviewWithRemotePath(
currentUser.baseUrl,
item.path,
binding.fileIcon.context.resources.getDimensionPixelSize(R.dimen.small_item_height)
fileIcon.context.resources.getDimensionPixelSize(R.dimen.small_item_height)
)
if (path.isNotEmpty()) {
binding.fileIcon.loadImage(path, currentUser, placeholder)
fileIcon.loadImage(path, currentUser, placeholder)
}
} else {
binding.fileIcon.setImageDrawable(placeholder)
fileIcon.setImageDrawable(placeholder)
}
binding.filenameTextView.text = item.displayName

View file

@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 111 warnings</span>
<span class="mdl-layout-title">Lint Report: 110 warnings</span>