From b8610f3e557b6c4dc9882b961f554a174493054f Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Tue, 24 Sep 2024 16:29:19 +0200 Subject: [PATCH] Rename Phone/Mobile into SmallWindow & Tablet into LargeWindow --- .../ui/components/BrandTobAppBar.kt | 8 ++-- .../ui/components/SwissTransferTobAppBar.kt | 8 ++-- .../ui/screen/main/MainScreen.kt | 10 ++--- .../main/components/BrandTobAppBarScaffold.kt | 4 +- .../ui/screen/main/components/MainScaffold.kt | 24 +++++------ ...old.kt => SmallWindowTopAppBarScaffold.kt} | 6 +-- .../ui/screen/main/received/ReceivedScreen.kt | 19 +++------ .../ui/screen/main/sent/SentEmptyScreen.kt | 8 ++-- .../ui/screen/main/sent/SentListScreen.kt | 8 ++-- .../ui/screen/main/sent/SentScreen.kt | 23 +++-------- .../settings/SettingsDownloadsLimitScreen.kt | 4 +- .../settings/SettingsEmailLanguageScreen.kt | 4 +- .../ui/screen/main/settings/SettingsScreen.kt | 4 +- .../main/settings/SettingsScreenWrapper.kt | 4 +- .../main/settings/SettingsThemeScreen.kt | 4 +- .../settings/SettingsValidityPeriodScreen.kt | 4 +- .../settings/components/OptionScaffold.kt | 14 +++---- .../screen/newtransfer/NewTransferScreen.kt | 8 ++-- .../importfiles/ImportFilesScreen.kt | 8 ++-- .../importfiles/TransferTypeScreen.kt | 8 ++-- .../UploadSourceChoiceBottomSheet.kt | 8 ++-- .../swisstransfer/ui/utils/MultiplePreview.kt | 40 +++++++++---------- 22 files changed, 103 insertions(+), 125 deletions(-) rename app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/{PhoneTopAppBarScaffold.kt => SmallWindowTopAppBarScaffold.kt} (90%) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTobAppBar.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTobAppBar.kt index 231ba4d2f..33b647127 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTobAppBar.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/BrandTobAppBar.kt @@ -33,8 +33,8 @@ import com.infomaniak.swisstransfer.ui.images.illus.LogoInfomaniak import com.infomaniak.swisstransfer.ui.images.illus.LogoSwissTransfer import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable @OptIn(ExperimentalMaterial3Api::class) @@ -58,8 +58,8 @@ fun BrandTobAppBar() { ) } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun BrandTobAppBarPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTobAppBar.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTobAppBar.kt index f5a2171a7..864f110b6 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTobAppBar.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTobAppBar.kt @@ -29,8 +29,8 @@ import com.infomaniak.swisstransfer.ui.images.icons.Add import com.infomaniak.swisstransfer.ui.images.icons.ArrowLeft import com.infomaniak.swisstransfer.ui.images.icons.Cross import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable @OptIn(ExperimentalMaterial3Api::class) @@ -75,8 +75,8 @@ data class TopAppBarButton( } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun SwissTransferTobAppBarPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainScreen.kt index ba4602a80..cad424f3e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainScreen.kt @@ -29,8 +29,8 @@ import com.infomaniak.swisstransfer.ui.navigation.MainNavigation import com.infomaniak.swisstransfer.ui.navigation.NavigationDestination.Companion.toDestination import com.infomaniak.swisstransfer.ui.screen.main.components.MainScaffold import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun MainScreen() { @@ -47,13 +47,13 @@ fun MainScreen() { navController = navController, currentDestination = currentDestination, windowAdaptiveInfo = windowAdaptiveInfo, - tabletTopAppBar = { BrandTobAppBar() }, + largeWindowTopAppBar = { BrandTobAppBar() }, content = { MainNavHost(navController, currentDestination, windowAdaptiveInfo) }, ) } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun MainScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/BrandTobAppBarScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/BrandTobAppBarScaffold.kt index 4d1049423..37129cc04 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/BrandTobAppBarScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/BrandTobAppBarScaffold.kt @@ -26,8 +26,8 @@ fun BrandTobAppBarScaffold( floatingActionButton: @Composable () -> Unit = {}, content: @Composable (PaddingValues) -> Unit, ) { - PhoneTopAppBarScaffold( - phoneTopAppBar = { BrandTobAppBar() }, + SmallWindowTopAppBarScaffold( + smallWindowTopAppBar = { BrandTobAppBar() }, floatingActionButton = floatingActionButton, content = content, ) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt index 9efb9fd23..0ae51efc9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/MainScaffold.kt @@ -31,8 +31,8 @@ import com.infomaniak.swisstransfer.ui.components.BrandTobAppBar import com.infomaniak.swisstransfer.ui.navigation.MainNavigation import com.infomaniak.swisstransfer.ui.navigation.NavigationItem import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow val LocalNavType = staticCompositionLocalOf { NavigationSuiteType.None } @@ -41,13 +41,13 @@ fun MainScaffold( navController: NavHostController, currentDestination: MainNavigation, windowAdaptiveInfo: WindowAdaptiveInfo, - tabletTopAppBar: @Composable () -> Unit = {}, + largeWindowTopAppBar: @Composable () -> Unit = {}, content: @Composable () -> Unit = {}, ) { val navType by rememberNavType(currentDestination, windowAdaptiveInfo) CompositionLocalProvider(LocalNavType provides navType) { - MainScaffold(navType, currentDestination, navController::navigateToSelectedItem, tabletTopAppBar, content) + MainScaffold(navType, currentDestination, navController::navigateToSelectedItem, largeWindowTopAppBar, content) } } @@ -56,11 +56,11 @@ private fun MainScaffold( navType: NavigationSuiteType, currentDestination: MainNavigation, navigateToSelectedItem: (MainNavigation) -> Unit, - tabletTopAppBar: @Composable () -> Unit, + largeWindowTopAppBar: @Composable () -> Unit, content: @Composable () -> Unit, ) { Column { - if (navType == NavigationSuiteType.NavigationRail) tabletTopAppBar() + if (navType == NavigationSuiteType.NavigationRail) largeWindowTopAppBar() AppNavigationSuiteScaffold(navType, NavigationItem.entries, currentDestination, navigateToSelectedItem) { if (navType == NavigationSuiteType.None) { content() @@ -112,29 +112,29 @@ private fun NavHostController.navigateToSelectedItem(destination: MainNavigation } } -@PreviewMobile +@PreviewSmallWindow @Composable -private fun NavigationMobilePreview() { +private fun NavigationSmallWindowPreview() { SwissTransferTheme { MainScaffold( currentDestination = MainNavigation.SentDestination, navigateToSelectedItem = {}, navType = NavigationSuiteType.NavigationBar, - tabletTopAppBar = { BrandTobAppBar() }, + largeWindowTopAppBar = { BrandTobAppBar() }, content = {}, ) } } -@PreviewTablet +@PreviewLargeWindow @Composable -private fun NavigationTabletPreview() { +private fun NavigationLargeWindowPreview() { SwissTransferTheme { MainScaffold( currentDestination = MainNavigation.SentDestination, navigateToSelectedItem = {}, navType = NavigationSuiteType.NavigationRail, - tabletTopAppBar = { BrandTobAppBar() }, + largeWindowTopAppBar = { BrandTobAppBar() }, content = {}, ) } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/PhoneTopAppBarScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/SmallWindowTopAppBarScaffold.kt similarity index 90% rename from app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/PhoneTopAppBarScaffold.kt rename to app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/SmallWindowTopAppBarScaffold.kt index b4ce72fc0..ae4c8aac0 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/PhoneTopAppBarScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/SmallWindowTopAppBarScaffold.kt @@ -23,13 +23,13 @@ import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType import androidx.compose.runtime.Composable @Composable -fun PhoneTopAppBarScaffold( - phoneTopAppBar: @Composable () -> Unit = {}, +fun SmallWindowTopAppBarScaffold( + smallWindowTopAppBar: @Composable () -> Unit = {}, floatingActionButton: @Composable () -> Unit = {}, content: @Composable (PaddingValues) -> Unit, ) { Scaffold( - topBar = { if (LocalNavType.current == NavigationSuiteType.NavigationBar) phoneTopAppBar() }, + topBar = { if (LocalNavType.current == NavigationSuiteType.NavigationBar) smallWindowTopAppBar() }, floatingActionButton = floatingActionButton, ) { contentPadding -> content(contentPadding) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt index d2db9603e..0531ea81d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt @@ -34,8 +34,8 @@ import com.infomaniak.swisstransfer.ui.screen.main.components.BrandTobAppBarScaf import com.infomaniak.swisstransfer.ui.screen.main.received.components.ReceivedEmptyFab import com.infomaniak.swisstransfer.ui.screen.main.sent.SentViewModel import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun ReceivedScreen( @@ -62,19 +62,10 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { } } -@PreviewMobile +@PreviewSmallWindow +@PreviewLargeWindow @Composable -private fun ReceivedScreenMobilePreview() { - SwissTransferTheme { - Surface { - ReceivedScreen(areTransfersEmpty = { true }) - } - } -} - -@PreviewTablet -@Composable -private fun ReceivedScreenTabletPreview() { +private fun ReceivedScreenPreview() { SwissTransferTheme { Surface { ReceivedScreen(areTransfersEmpty = { true }) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt index c33bb7b29..445c2d074 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentEmptyScreen.kt @@ -35,8 +35,8 @@ import com.infomaniak.swisstransfer.ui.images.illus.ArrowDownRightCurved import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SentEmptyScreen(modifier: Modifier) { @@ -85,8 +85,8 @@ fun SentEmptyScreen(modifier: Modifier) { } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun SentEmptyScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentListScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentListScreen.kt index e30f5656c..a5b257ae9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentListScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentListScreen.kt @@ -24,8 +24,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow import java.util.UUID @Composable @@ -39,8 +39,8 @@ fun SentListScreen( } } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun SentListScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt index f9afa22af..558263855 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/sent/SentScreen.kt @@ -30,8 +30,8 @@ import com.infomaniak.swisstransfer.ui.components.NewTransferFabType import com.infomaniak.swisstransfer.ui.screen.main.components.BrandTobAppBarScaffold import com.infomaniak.swisstransfer.ui.screen.main.components.LocalNavType import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SentScreen( @@ -65,23 +65,10 @@ private fun SentScreen(navType: NavigationSuiteType, transfers: List?) { } -@PreviewMobile +@PreviewSmallWindow +@PreviewLargeWindow @Composable -private fun SentScreenMobilePreview() { - val navType = LocalNavType.current - SwissTransferTheme { - Surface { - SentScreen( - navType = navType, - transfers = emptyList(), - ) - } - } -} - -@PreviewTablet -@Composable -private fun SentScreenTabletPreview() { +private fun SentScreenPreview() { val navType = LocalNavType.current SwissTransferTheme { Surface { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDownloadsLimitScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDownloadsLimitScreen.kt index 478f57807..a5325f87f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDownloadsLimitScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDownloadsLimitScreen.kt @@ -25,7 +25,7 @@ import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.screen.main.settings.components.OptionScaffold import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingOption import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SettingsDownloadsLimitScreen( @@ -54,7 +54,7 @@ enum class DownloadLimitOption( ONE({ "1" }), } -@PreviewMobile +@PreviewSmallWindow @Composable private fun SettingsThemeScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsEmailLanguageScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsEmailLanguageScreen.kt index 90c0f959e..68b2b944d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsEmailLanguageScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsEmailLanguageScreen.kt @@ -26,7 +26,7 @@ import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.screen.main.settings.components.OptionScaffold import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingOption import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SettingsEmailLanguageScreen( @@ -56,7 +56,7 @@ enum class EmailLanguageOption( SPANISH({ stringResource(R.string.settingsEmailLanguageValueSpanish) }, imageVectorResId = R.drawable.flag_es), } -@PreviewMobile +@PreviewSmallWindow @Composable private fun SettingsThemeScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt index 58ad0b0ab..f99382358 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreen.kt @@ -47,7 +47,7 @@ import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingIt import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingTitle import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SettingsScreen( @@ -190,7 +190,7 @@ private class DummyAppSettings( override var validityPeriod: ValidityPeriod = ValidityPeriod.THIRTY, ) : AppSettings -@PreviewMobile +@PreviewSmallWindow @Composable private fun SettingsScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreenWrapper.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreenWrapper.kt index 432ef5234..efd886170 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreenWrapper.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsScreenWrapper.kt @@ -138,8 +138,8 @@ private fun NoSelectionEmptyState() { } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun SettingsScreenWrapperPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsThemeScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsThemeScreen.kt index fb506b882..1ba15baf4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsThemeScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsThemeScreen.kt @@ -30,7 +30,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.CircleWhite import com.infomaniak.swisstransfer.ui.screen.main.settings.components.OptionScaffold import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingOption import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SettingsThemeScreen( @@ -58,7 +58,7 @@ enum class ThemeOption( DARK({ stringResource(R.string.settingsOptionThemeDark) }, AppIcons.CircleBlack), } -@PreviewMobile +@PreviewSmallWindow @Composable private fun SettingsThemeScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsValidityPeriodScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsValidityPeriodScreen.kt index d7491ef94..71a463ef9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsValidityPeriodScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsValidityPeriodScreen.kt @@ -26,7 +26,7 @@ import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.screen.main.settings.components.OptionScaffold import com.infomaniak.swisstransfer.ui.screen.main.settings.components.SettingOption import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun SettingsValidityPeriodScreen( @@ -55,7 +55,7 @@ enum class ValidityPeriodOption( ONE({ pluralStringResource(R.plurals.settingsValidityPeriodValue, 1, 1) }), } -@PreviewMobile +@PreviewSmallWindow @Composable private fun SettingsThemeScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/OptionScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/OptionScaffold.kt index fb7618c01..4f8d69509 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/OptionScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/components/OptionScaffold.kt @@ -31,11 +31,11 @@ import androidx.compose.ui.Modifier import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.components.SwissTransferTobAppBar import com.infomaniak.swisstransfer.ui.components.TopAppBarButton -import com.infomaniak.swisstransfer.ui.screen.main.components.PhoneTopAppBarScaffold +import com.infomaniak.swisstransfer.ui.screen.main.components.SmallWindowTopAppBarScaffold import com.infomaniak.swisstransfer.ui.screen.main.settings.ThemeOption import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun OptionScaffold( @@ -46,8 +46,8 @@ fun OptionScaffold( setSelectedSettingOptionPosition: (Int) -> Unit, navigateBack: (() -> Unit)?, ) { - PhoneTopAppBarScaffold( - phoneTopAppBar = { SwissTransferTobAppBar(topAppBarTitleRes, TopAppBarButton.backButton(navigateBack ?: {})) }, + SmallWindowTopAppBarScaffold( + smallWindowTopAppBar = { SwissTransferTobAppBar(topAppBarTitleRes, TopAppBarButton.backButton(navigateBack ?: {})) }, ) { paddingsValue -> Column( modifier = Modifier @@ -69,8 +69,8 @@ fun OptionScaffold( } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun OptionScaffoldPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt index 16ce58113..3b775e7ef 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt @@ -20,8 +20,8 @@ package com.infomaniak.swisstransfer.ui.screen.newtransfer import androidx.compose.runtime.Composable import androidx.navigation.compose.rememberNavController import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun NewTransferScreen(closeActivity: () -> Unit) { @@ -29,8 +29,8 @@ fun NewTransferScreen(closeActivity: () -> Unit) { NewTransferNavHost(navController, closeActivity) } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun NewTransferPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt index e7b9dd7d6..63be6ebc4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt @@ -29,8 +29,8 @@ import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus import com.infomaniak.swisstransfer.ui.images.icons.Add import com.infomaniak.swisstransfer.ui.images.illus.MascotWithMagnifyingGlass import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun ImportFilesScreen(navigateToTransferTypeScreen: () -> Unit, closeActivity: () -> Unit) { @@ -79,8 +79,8 @@ fun ImportFilesScreen(navigateToTransferTypeScreen: () -> Unit, closeActivity: ( ) } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun ImportFilesScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt index 4e4af7ea2..9e6847d62 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt @@ -40,8 +40,8 @@ import com.infomaniak.swisstransfer.ui.images.illus.WaveSignalTilted import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.components.TransferTypeButtons import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun TransferTypeScreen(navigateToTransfer: (TransferType) -> Unit, popBack: () -> Unit, closeActivity: () -> Unit) { @@ -105,8 +105,8 @@ enum class TransferType( ), } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun TransferTypeScreenPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt index 5b8ec5e90..1efa2919d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt @@ -32,8 +32,8 @@ import com.infomaniak.swisstransfer.ui.images.icons.Folder import com.infomaniak.swisstransfer.ui.images.icons.PolaroidLandscape import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.PreviewMobile -import com.infomaniak.swisstransfer.ui.utils.PreviewTablet +import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow +import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable fun UploadSourceChoiceBottomSheet( @@ -69,8 +69,8 @@ fun UploadSourceChoiceBottomSheet( } } -@PreviewMobile -@PreviewTablet +@PreviewSmallWindow +@PreviewLargeWindow @Composable private fun UploadSourceChoiceBottomSheetPreview() { SwissTransferTheme { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt index ce0e0742f..97dbec6b4 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt @@ -20,50 +20,50 @@ package com.infomaniak.swisstransfer.ui.utils import android.content.res.Configuration import androidx.compose.ui.tooling.preview.Preview -// Mobile +// Small window (ex: phone) @Preview( - name = "(1) Mobile portrait light", - group = "Mobile", + name = "(1) Small window portrait light", + group = "SmallWindow", ) @Preview( - name = "(2) Mobile portrait dark", - group = "Mobile", + name = "(2) Small window portrait dark", + group = "SmallWindow", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, ) @Preview( - name = "(3) Mobile landscape light", - group = "Mobile", + name = "(3) Small window landscape light", + group = "SmallWindow", device = "spec:parent=pixel_5,orientation=landscape", ) @Preview( - name = "(4) Mobile landscape dark", - group = "Mobile", + name = "(4) Small window landscape dark", + group = "SmallWindow", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, device = "spec:parent=pixel_5,orientation=landscape", ) -annotation class PreviewMobile +annotation class PreviewSmallWindow -// Tablet +// Large window (ex: tablet) @Preview( - name = "(1) Tablet portrait light", - group = "Tablet", + name = "(1) Large window portrait light", + group = "LargeWindow", device = "spec:width=1280dp,height=800dp,dpi=240,orientation=portrait", ) @Preview( - name = "(2) Tablet portrait dark", - group = "Tablet", + name = "(2) Large window portrait dark", + group = "LargeWindow", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, device = "spec:width=1280dp,height=800dp,dpi=240,orientation=portrait", ) @Preview( - name = "(3) Tablet landscape light", - group = "Tablet", + name = "(3) Large window landscape light", + group = "LargeWindow", device = "spec:id=reference_tablet,shape=Normal,width=1280,height=800,unit=dp,dpi=240", ) @Preview( - name = "(4) Tablet landscape dark", - group = "Tablet", + name = "(4) Large window landscape dark", + group = "LargeWindow", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL, device = "spec:id=reference_tablet,shape=Normal,width=1280,height=800,unit=dp,dpi=240", ) -annotation class PreviewTablet +annotation class PreviewLargeWindow