Skip to content

Commit

Permalink
Add forward and reply icons on threads
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyDL-Infomaniak committed Jun 26, 2024
1 parent 2324cc3 commit 700399c
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ class ThreadListAdapter @Inject constructor(

draftPrefix.isVisible = hasDrafts

if (thread.isAnswered) {
iconReply.isVisible = true
} else if (thread.isForwarded) {
iconForward.isVisible = true
}

iconAttachment.isVisible = hasAttachments
iconCalendar.isGone = true // TODO: See with API when we should display this icon
iconFavorite.isVisible = isFavorite
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/res/drawable/ic_forward_arrow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M14.385,7.8C14.385,7.8 1.057,6.132 0.059,19.385C0.028,19.801 0.596,19.963 0.831,19.618C5.801,12.322 14.385,15 14.385,15V19.145C14.385,19.402 14.687,19.54 14.881,19.372L23.653,11.799C23.837,11.641 23.838,11.357 23.657,11.197L14.884,3.441C14.69,3.27 14.385,3.407 14.385,3.666V7.8Z" />
</vector>
26 changes: 26 additions & 0 deletions app/src/main/res/drawable/ic_reply_arrow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
~ Infomaniak Mail - Android
~ Copyright (C) 2024 Infomaniak Network SA
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M9.615,7.8C9.615,7.8 22.943,6.132 23.941,19.385C23.972,19.801 23.404,19.963 23.169,19.618C18.199,12.322 9.615,15 9.615,15V19.145C9.615,19.402 9.313,19.54 9.119,19.372L0.347,11.799C0.163,11.641 0.162,11.357 0.343,11.197L9.116,3.441C9.31,3.27 9.615,3.407 9.615,3.666V7.8Z" />
</vector>
40 changes: 37 additions & 3 deletions app/src/main/res/layout/cardview_thread_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,40 @@
app:layout_constraintTop_toTopOf="@id/expeditor"
tools:text="@tools:sample/date/hhmm" />

<FrameLayout
android:id="@+id/iconReplyOrForwardLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
app:layout_constraintBottom_toBottomOf="@id/mailSubject"
app:layout_constraintEnd_toStartOf="@+id/mailSubject"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/mailSubject"
tools:visibility="visible">

<ImageView
android:id="@+id/iconForward"
android:layout_width="@dimen/mediumIconSize"
android:layout_height="@dimen/mediumIconSize"
android:layout_marginEnd="@dimen/marginStandardSmall"
android:contentDescription="@string/contentDescriptionIconForward"
android:src="@drawable/ic_forward_arrow"
android:visibility="gone"
app:tint="@color/iconColorPrimaryText"
tools:visibility="visible" />

<ImageView
android:id="@+id/iconReply"
android:layout_width="@dimen/mediumIconSize"
android:layout_height="@dimen/mediumIconSize"
android:layout_marginEnd="@dimen/marginStandardSmall"
android:contentDescription="@string/contentDescriptionIconReply"
android:src="@drawable/ic_reply_arrow"
android:visibility="gone"
app:tint="@color/iconColorPrimaryText" />

</FrameLayout>

<TextView
android:id="@+id/mailSubject"
style="@style/Body"
Expand All @@ -221,9 +255,9 @@
android:layout_marginTop="@dimen/marginStandardVerySmall"
android:ellipsize="end"
android:lines="1"
app:layout_constraintEnd_toStartOf="@id/folderNameCompactMode"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/expeditor"
app:layout_constraintEnd_toStartOf="@+id/folderNameCompactMode"
app:layout_constraintStart_toEndOf="@+id/iconReplyOrForwardLayout"
app:layout_constraintTop_toBottomOf="@+id/expeditor"
tools:text="@tools:sample/lorem[10]" />

<TextView
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@
<string name="contentDescriptionIconCalendar">Hat Kalender Ereignis</string>
<string name="contentDescriptionIconFavorite">Ist Favorit</string>
<string name="contentDescriptionIconFolderSelected">Ordner ausgewählt</string>
<string name="contentDescriptionIconForward">Weitergeleitet</string>
<string name="contentDescriptionIconInvalidPassword">E-Mail-Adresse entsperren</string>
<string name="contentDescriptionIconNewMail">Neu</string>
<string name="contentDescriptionIconReply">Antwort</string>
<string name="contentDescriptionIconStorage">Speicherstatus</string>
<string name="contentDescriptionOpenMailActions">Mail-Aktionen öffnen</string>
<string name="contentDescriptionSelectedItem">Ausgewählte</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@
<string name="contentDescriptionIconCalendar">Tiene evento Calendario</string>
<string name="contentDescriptionIconFavorite">Es favorito</string>
<string name="contentDescriptionIconFolderSelected">Carpeta seleccionada</string>
<string name="contentDescriptionIconForward">Reenviado</string>
<string name="contentDescriptionIconInvalidPassword">Desbloquear la dirección de correo electrónico</string>
<string name="contentDescriptionIconNewMail">Nuevo</string>
<string name="contentDescriptionIconReply">Respuesta</string>
<string name="contentDescriptionIconStorage">Estado de almacenamiento</string>
<string name="contentDescriptionOpenMailActions">Acciones de mensajes abiertos</string>
<string name="contentDescriptionSelectedItem">Selección</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,10 @@
<string name="contentDescriptionIconCalendar">Contient un évènement Calendar</string>
<string name="contentDescriptionIconFavorite">Est favori</string>
<string name="contentDescriptionIconFolderSelected">Dossier sélectionné</string>
<string name="contentDescriptionIconForward">Transféré</string>
<string name="contentDescriptionIconInvalidPassword">Débloquer l’adresse</string>
<string name="contentDescriptionIconNewMail">Nouveau</string>
<string name="contentDescriptionIconReply">Réponse</string>
<string name="contentDescriptionIconStorage">État du stockage</string>
<string name="contentDescriptionOpenMailActions">Ouvrir les actions du message</string>
<string name="contentDescriptionSelectedItem">Sélectionné</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@
<string name="contentDescriptionIconCalendar">Ha un evento di calendario</string>
<string name="contentDescriptionIconFavorite">È il preferito</string>
<string name="contentDescriptionIconFolderSelected">Cartella selezionata</string>
<string name="contentDescriptionIconForward">Inoltrato</string>
<string name="contentDescriptionIconInvalidPassword">Sbloccare l’indirizzo e-mail</string>
<string name="contentDescriptionIconNewMail">Nuovo</string>
<string name="contentDescriptionIconReply">Risposta</string>
<string name="contentDescriptionIconStorage">Stato di conservazione</string>
<string name="contentDescriptionOpenMailActions">Azioni di apertura dei messaggi</string>
<string name="contentDescriptionSelectedItem">Selezionato</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@
<string name="contentDescriptionIconCalendar">Has Calendar event</string>
<string name="contentDescriptionIconFavorite">Is favorite</string>
<string name="contentDescriptionIconFolderSelected">Folder selected</string>
<string name="contentDescriptionIconForward">Forwarded</string>
<string name="contentDescriptionIconInvalidPassword">Unblock mailbox</string>
<string name="contentDescriptionIconNewMail">New</string>
<string name="contentDescriptionIconReply">Reply</string>
<string name="contentDescriptionIconStorage">Storage status</string>
<string name="contentDescriptionOpenMailActions">Open mail actions</string>
<string name="contentDescriptionSelectedItem">Selected</string>
Expand Down

0 comments on commit 700399c

Please sign in to comment.