Skip to content

Commit

Permalink
fix: added url icon to upload list
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Jun 17, 2024
1 parent 6a3d7d9 commit ed88b71
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* ownCloud Android client application
*
* @author Juan Carlos Garrote Gascón
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2023 ownCloud GmbH.
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -129,16 +130,18 @@ class TransfersAdapter(

uploadStatus.isVisible = transferItem.transfer.status != TransferStatus.TRANSFER_SUCCEEDED
uploadStatus.text = "" + holder.itemView.context.getString(transferItem.transfer.statusToStringRes())

val placeholderIcon = if (transferItem.transfer.localPath.endsWith(".url")) {
R.drawable.ic_action_open_shortcut
} else {
MimetypeIconUtil.getFileTypeIconId(
MimetypeIconUtil.getBestMimeTypeByFilename(transferItem.transfer.localPath),
fileName
)
}
Glide.with(holder.itemView)
.load(transferItem.transfer.localPath)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(
MimetypeIconUtil.getFileTypeIconId(
MimetypeIconUtil.getBestMimeTypeByFilename(transferItem.transfer.localPath),
fileName
)
)
.placeholder(placeholderIcon)
.into(thumbnail)

uploadRightButton.isVisible = transferItem.transfer.status != TransferStatus.TRANSFER_SUCCEEDED
Expand Down

0 comments on commit ed88b71

Please sign in to comment.