mirror of
https://github.com/bitwarden/android.git
synced 2026-05-22 22:24:37 -05:00
Add the send pending deletion icon (#503)
This commit is contained in:
committed by
Álison Fernandes
parent
273763b219
commit
2be770d5fc
@@ -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(),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
22
app/src/main/res/drawable/ic_send_pending_delete.xml
Normal file
22
app/src/main/res/drawable/ic_send_pending_delete.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="16dp"
|
||||
android:viewportHeight="16"
|
||||
android:viewportWidth="16">
|
||||
<group>
|
||||
<clip-path android:pathData="M0,0h16v16h-16z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M10.5,5C10.224,5 10,5.224 10,5.5V11.5C10,11.776 10.224,12 10.5,12C10.776,12 11,11.776 11,11.5V5.5C11,5.224 10.776,5 10.5,5Z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M5,5.5C5,5.224 5.224,5 5.5,5C5.776,5 6,5.224 6,5.5V11.5C6,11.776 5.776,12 5.5,12C5.224,12 5,11.776 5,11.5V5.5Z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M8,5C7.724,5 7.5,5.224 7.5,5.5V11.5C7.5,11.776 7.724,12 8,12C8.276,12 8.5,11.776 8.5,11.5V5.5C8.5,5.224 8.276,5 8,5Z" />
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M5.329,1.724C5.244,1.893 5.071,2 4.882,2H0.5C0.224,2 0,2.224 0,2.5C0,2.776 0.224,3 0.5,3H2.08C2.08,3.051 2.082,3.102 2.086,3.153L2.932,14.153C3.012,15.195 3.881,16 4.926,16H11.074C12.119,16 12.988,15.195 13.068,14.153L13.914,3.153C13.918,3.102 13.92,3.051 13.92,3H15.5C15.776,3 16,2.776 16,2.5C16,2.224 15.776,2 15.5,2H11.118C10.929,2 10.755,1.893 10.671,1.724L10.224,0.829C9.97,0.321 9.45,0 8.882,0H7.118C6.55,0 6.03,0.321 5.776,0.829L5.329,1.724ZM7.118,1C6.929,1 6.756,1.107 6.671,1.276L6.309,2H9.691L9.329,1.276C9.244,1.107 9.071,1 8.882,1H7.118ZM3.08,3H12.92C12.92,3.025 12.919,3.051 12.917,3.077L12.071,14.077C12.031,14.598 11.597,15 11.074,15H4.926C4.403,15 3.969,14.598 3.929,14.077L3.083,3.077C3.081,3.051 3.08,3.025 3.08,3Z" />
|
||||
</group>
|
||||
</vector>
|
||||
@@ -55,9 +55,10 @@ class SendDataExtensionsTest {
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
type = SendState.ViewState.Content.SendItem.Type.FILE,
|
||||
iconList = listOf(
|
||||
SendStatusIcon.EXPIRED,
|
||||
SendStatusIcon.PASSWORD,
|
||||
SendStatusIcon.MAX_ACCESS_COUNT_REACHED,
|
||||
SendStatusIcon.EXPIRED,
|
||||
SendStatusIcon.PENDING_DELETE,
|
||||
),
|
||||
),
|
||||
SendState.ViewState.Content.SendItem(
|
||||
@@ -66,9 +67,10 @@ class SendDataExtensionsTest {
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
type = SendState.ViewState.Content.SendItem.Type.TEXT,
|
||||
iconList = listOf(
|
||||
SendStatusIcon.EXPIRED,
|
||||
SendStatusIcon.PASSWORD,
|
||||
SendStatusIcon.MAX_ACCESS_COUNT_REACHED,
|
||||
SendStatusIcon.EXPIRED,
|
||||
SendStatusIcon.PENDING_DELETE,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user