Skip to content

Commit

Permalink
Merge pull request #217 from Infomaniak/empty-screen
Browse files Browse the repository at this point in the history
feat: Improve empty screen when we don't select a transfer
  • Loading branch information
tevincent authored Nov 28, 2024
2 parents f320bf9 + 3ecea24 commit 1d5d9bf
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@
package com.infomaniak.swisstransfer.ui.screen.main.transfers

import android.os.Parcelable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffoldRole
import androidx.compose.material3.adaptive.navigation.ThreePaneScaffoldNavigator
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import com.infomaniak.multiplatform_swisstransfer.common.models.TransferDirection
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.components.EmptyState
import com.infomaniak.swisstransfer.ui.components.TwoPaneScaffold
import com.infomaniak.swisstransfer.ui.components.safeCurrentContent
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus
import com.infomaniak.swisstransfer.ui.images.illus.MascotSearching
import com.infomaniak.swisstransfer.ui.screen.main.received.ReceivedScreen
import com.infomaniak.swisstransfer.ui.screen.main.sent.SentScreen
import com.infomaniak.swisstransfer.ui.screen.main.transferdetails.TransferDetailsScreen
Expand Down Expand Up @@ -96,8 +95,12 @@ private fun DetailPane(navigator: ThreePaneScaffoldNavigator<DestinationContent>

@Composable
private fun NoSelectionEmptyState() {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text(text = "Select an item", color = SwissTransferTheme.colors.secondaryTextColor)
Surface {
EmptyState(
icon = AppIllus.MascotSearching,
titleRes = R.string.noTransferSelectedTitle,
descriptionRes = R.string.noTransferSelectedDescription,
)
}
}

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 @@ -48,6 +48,8 @@
<string name="noFileTitle">Keine Datei, keine Übertragung!</string>
<string name="noTransferReceivedDescription">Alle Überweisungen, die du in den letzten 30 Tagen erhältst, werden hier angezeigt.</string>
<string name="noTransferReceivedTitle">Keine Überweisungen erhalten</string>
<string name="noTransferSelectedDescription">Wähle eine Übertragung aus oder erstelle eine neue.</string>
<string name="noTransferSelectedTitle">Keine Transfers zum Anzeigen</string>
<string name="receivedFilesTitle">Empfangene Dateien</string>
<string name="receivedTitle">Empfangen</string>
<plurals name="recipientHeader">
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 @@ -48,6 +48,8 @@
<string name="noFileTitle">Si no hay archivo, no hay transferencia.</string>
<string name="noTransferReceivedDescription">Aquí aparecerán todas las transferencias recibidas en los últimos 30 días.</string>
<string name="noTransferReceivedTitle">No se han recibido transferencias</string>
<string name="noTransferSelectedDescription">Selecciona una transferencia o crea una nueva.</string>
<string name="noTransferSelectedTitle">No hay transferencias que mostrar</string>
<string name="receivedFilesTitle">Archivos recibidos</string>
<string name="receivedTitle">Recibido</string>
<plurals name="recipientHeader">
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 @@ -49,6 +49,8 @@
<string name="noFileTitle">Pas de fichier, pas de transfert !</string>
<string name="noTransferReceivedDescription">Tous les transferts que tu recevras sur les 30 derniers jours apparaitront ici.</string>
<string name="noTransferReceivedTitle">Aucun transfert reçu</string>
<string name="noTransferSelectedDescription">Sélectionne un transfert ou créé-en un nouveau.</string>
<string name="noTransferSelectedTitle">Aucun transfert à afficher</string>
<string name="receivedFilesTitle">Fichiers reçus</string>
<string name="receivedTitle">Reçu</string>
<plurals name="recipientHeader">
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 @@ -48,6 +48,8 @@
<string name="noFileTitle">Nessun file, nessun trasferimento!</string>
<string name="noTransferReceivedDescription">Qui appariranno tutti i bonifici ricevuti negli ultimi 30 giorni.</string>
<string name="noTransferReceivedTitle">Nessun trasferimento ricevuto</string>
<string name="noTransferSelectedDescription">Selezionare un trasferimento o crearne uno nuovo.</string>
<string name="noTransferSelectedTitle">Nessun trasferimento da visualizzare</string>
<string name="receivedFilesTitle">File ricevuti</string>
<string name="receivedTitle">Ricevuto</string>
<plurals name="recipientHeader">
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 @@ -52,6 +52,8 @@
<string name="noFileTitle">No file, no transfer!</string>
<string name="noTransferReceivedDescription">All transfers you receive over the last 30 days will appear here.</string>
<string name="noTransferReceivedTitle">No transfers received</string>
<string name="noTransferSelectedDescription">Select a transfer or create a new one.</string>
<string name="noTransferSelectedTitle">No transfers to display</string>
<string name="receivedFilesTitle">Received files</string>
<string name="receivedTitle">Received</string>
<plurals name="recipientHeader">
Expand Down

0 comments on commit 1d5d9bf

Please sign in to comment.