Add the send pending deletion icon (#503)

This commit is contained in:
David Perez
2024-01-05 12:49:17 -06:00
committed by Álison Fernandes
parent 273763b219
commit 2be770d5fc
4 changed files with 37 additions and 6 deletions

View File

@@ -28,4 +28,8 @@ enum class SendStatusIcon(
iconRes = R.drawable.ic_send_max_access_count_reached,
contentDescription = R.string.maximum_access_count_reached.asText(),
),
PENDING_DELETE(
iconRes = R.drawable.ic_send_pending_delete,
contentDescription = R.string.pending_delete.asText(),
),
}

View File

@@ -35,16 +35,19 @@ private fun List<SendView>.toSendContent(): SendState.ViewState.Content {
SendType.FILE -> SendState.ViewState.Content.SendItem.Type.FILE
},
iconList = listOfNotNull(
SendStatusIcon.EXPIRED.takeIf {
sendView.expirationDate?.isBefore(Instant.now()) == true
},
SendStatusIcon.DISABLED.takeIf { sendView.disabled },
sendView.password?.let { SendStatusIcon.PASSWORD },
SendStatusIcon.MAX_ACCESS_COUNT_REACHED.takeIf {
sendView.maxAccessCount?.let { maxCount ->
sendView.accessCount >= maxCount
} == true
},
SendStatusIcon.DISABLED.takeIf { sendView.disabled },
SendStatusIcon.EXPIRED.takeIf {
sendView.expirationDate?.isBefore(Instant.now()) == true
},
SendStatusIcon.PENDING_DELETE.takeIf {
sendView.deletionDate.isBefore(Instant.now())
},
),
)
}