From f879cdcd64ecc57e57850f2dca1a5dc83daf1c88 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 10:20:20 +0200 Subject: [PATCH 1/6] core: Add startDestination const for each navigation --- .../swisstransfer/ui/navigation/NavigationDestination.kt | 8 ++++++++ .../swisstransfer/ui/screen/main/MainNavHost.kt | 4 ++-- .../infomaniak/swisstransfer/ui/screen/main/MainScreen.kt | 6 ++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationDestination.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationDestination.kt index bff19d956..521fbfac2 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationDestination.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/navigation/NavigationDestination.kt @@ -37,6 +37,10 @@ sealed class MainNavigation : NavigationDestination() { @Serializable data object SettingsDestination : MainNavigation() + + companion object { + val startDestination = SentDestination + } } /** @@ -57,6 +61,10 @@ sealed class NewTransferNavigation : NavigationDestination() { data object UploadProgressDestination : NewTransferNavigation() @Serializable data object UploadSuccessDestination : NewTransferNavigation() + + companion object { + val startDestination = ImportFilesDestination + } } /** diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainNavHost.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainNavHost.kt index 1e6d7f1a7..61604bfa7 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainNavHost.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/MainNavHost.kt @@ -26,6 +26,7 @@ import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.toRoute +import com.infomaniak.swisstransfer.ui.navigation.MainNavigation import com.infomaniak.swisstransfer.ui.navigation.MainNavigation.* import com.infomaniak.swisstransfer.ui.screen.main.received.ReceivedScreen import com.infomaniak.swisstransfer.ui.screen.main.sent.SentScreen @@ -35,10 +36,9 @@ import com.infomaniak.swisstransfer.ui.screen.main.transferdetails.TransferDetai @Composable fun MainNavHost( navController: NavHostController, - startDestination: SentDestination, windowAdaptiveInfo: WindowAdaptiveInfo, ) { - NavHost(navController, startDestination, modifier = Modifier.safeDrawingPadding()) { + NavHost(navController, MainNavigation.startDestination, modifier = Modifier.safeDrawingPadding()) { composable { SentScreen( navigateToDetails = { navController.navigate(TransferDetailsDestination(it)) }, 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 32a8d02e0..39e89a9b1 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 @@ -26,7 +26,6 @@ import androidx.compose.runtime.remember import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import com.infomaniak.swisstransfer.ui.navigation.MainNavigation -import com.infomaniak.swisstransfer.ui.navigation.MainNavigation.SentDestination import com.infomaniak.swisstransfer.ui.navigation.NavigationDestination.Companion.toDestination import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewMobile @@ -35,19 +34,18 @@ import com.infomaniak.swisstransfer.ui.utils.PreviewTablet @Composable fun MainScreen() { val navController = rememberNavController() - val startDestination = SentDestination val windowAdaptiveInfo = currentWindowAdaptiveInfo() val navBackStackEntry by navController.currentBackStackEntryAsState() val currentDestination by remember(navBackStackEntry) { derivedStateOf { - navBackStackEntry?.toDestination() ?: startDestination + navBackStackEntry?.toDestination() ?: MainNavigation.startDestination } } MainScaffold(navController, currentDestination, windowAdaptiveInfo) { - MainNavHost(navController, startDestination, windowAdaptiveInfo) + MainNavHost(navController, windowAdaptiveInfo) } } From 154747411b30741b17e170827d4499945ffa6293 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 10:21:03 +0200 Subject: [PATCH 2/6] core: Init import files and upload screens --- .../importfiles/ImportFilesScreen.kt | 27 +++++++++++++++++++ .../importfiles/TransferOptionsScreen.kt | 27 +++++++++++++++++++ .../importfiles/TransferTypeScreen.kt | 27 +++++++++++++++++++ .../importfiles/ValidateUserEmailScreen.kt | 27 +++++++++++++++++++ .../upload/UploadProgressScreen.kt | 27 +++++++++++++++++++ .../newtransfer/upload/UploadSuccessScreen.kt | 27 +++++++++++++++++++ 6 files changed, 162 insertions(+) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferOptionsScreen.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessScreen.kt 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 new file mode 100644 index 000000000..2c84c29de --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun ImportFilesScreen() { + Text("ImportFilesScreen") +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferOptionsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferOptionsScreen.kt new file mode 100644 index 000000000..4256eeaf5 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferOptionsScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun TransferOptionsScreen() { + Text("TransferOptionsScreen") +} 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 new file mode 100644 index 000000000..5f02f61d0 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun TransferTypeScreen() { + Text("TransferTypeScreen") +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt new file mode 100644 index 000000000..0ef3bf7b4 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ValidateUserEmailScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun ValidateUserEmailScreen() { + Text("ValidateUserEmailScreen") +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt new file mode 100644 index 000000000..d1f38b11a --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.upload + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun UploadProgressScreen() { + Text("UploadProgressScreen") +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessScreen.kt new file mode 100644 index 000000000..59dd31eea --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadSuccessScreen.kt @@ -0,0 +1,27 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer.upload + +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable + +@Composable +fun UploadSuccessScreen() { + Text("UploadSuccessScreen") +} From 96aaaa80b6a1fa790f3cbeba63d52bc978e6faea Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 10:22:25 +0200 Subject: [PATCH 3/6] core: Init NewTransferNavHost and NewTransferSreen --- .../screen/newtransfer/NewTransferNavHost.kt | 60 +++++++++++++++++++ .../screen/newtransfer/NewTransferScreen.kt | 46 ++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt new file mode 100644 index 000000000..bd8851371 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt @@ -0,0 +1,60 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer + +import androidx.compose.foundation.layout.safeDrawingPadding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import com.infomaniak.swisstransfer.ui.navigation.NewTransferNavigation +import com.infomaniak.swisstransfer.ui.navigation.NewTransferNavigation.* +import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.ImportFilesScreen +import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.TransferOptionsScreen +import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.TransferTypeScreen +import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.ValidateUserEmailScreen +import com.infomaniak.swisstransfer.ui.screen.newtransfer.upload.UploadProgressScreen +import com.infomaniak.swisstransfer.ui.screen.newtransfer.upload.UploadSuccessScreen + +@Composable +fun NewTransferNavHost(navController: NavHostController, modifier: Modifier) { + + NavHost(navController, NewTransferNavigation.startDestination, modifier = modifier.safeDrawingPadding()) { + composable { + ImportFilesScreen() + } + composable { + TransferTypeScreen() + } + composable { + TransferOptionsScreen() + } + composable { + ValidateUserEmailScreen() + } + composable { + UploadProgressScreen() + } + composable { + UploadSuccessScreen() + } + } + +} 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 new file mode 100644 index 000000000..ae73d59af --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt @@ -0,0 +1,46 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui.screen.newtransfer + +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +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 + +@Composable +fun NewTransferScreen() { + val navController = rememberNavController() + + Scaffold { paddingValues -> + NewTransferNavHost(navController, modifier = Modifier.padding(paddingValues)) + } +} + +@PreviewMobile +@PreviewTablet +@Composable +private fun NewTransferPreview() { + SwissTransferTheme { + NewTransferScreen() + } +} From a012afc64bbde955547bee3c8dc6152ecbefb5d8 Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 10:23:00 +0200 Subject: [PATCH 4/6] refactor: Add BaseActivity --- .../swisstransfer/ui/BaseActivity.kt | 31 +++++++++++++++++++ .../swisstransfer/ui/MainActivity.kt | 5 +-- 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt new file mode 100644 index 000000000..2a9f7e54b --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt @@ -0,0 +1,31 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.enableEdgeToEdge + +open class BaseActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt index a9e42cbb2..5bcc4553e 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt @@ -19,17 +19,14 @@ package com.infomaniak.swisstransfer.ui import android.os.Bundle -import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.activity.enableEdgeToEdge import com.infomaniak.swisstransfer.ui.screen.main.MainScreen import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -class MainActivity : ComponentActivity() { +class MainActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - enableEdgeToEdge() setContent { SwissTransferTheme { MainScreen() From c34fe822f514af2b236be335081f94240e4be22a Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 10:23:19 +0200 Subject: [PATCH 5/6] core: Init NewTransferActivity --- app/src/main/AndroidManifest.xml | 1 + .../swisstransfer/ui/NewTransferActivity.kt | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 166bce17a..67cb97e24 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,6 +39,7 @@ + diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt new file mode 100644 index 000000000..9b67dbc9f --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt @@ -0,0 +1,33 @@ +/* + * Infomaniak SwissTransfer - 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 . + */ + +package com.infomaniak.swisstransfer.ui + +import android.os.Bundle +import androidx.activity.compose.setContent +import com.infomaniak.swisstransfer.ui.screen.newtransfer.NewTransferScreen + +class NewTransferActivity : BaseActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + NewTransferScreen() + } + } +} From 592e0b0255a7ea766c49465cc063f9532bb4c0bf Mon Sep 17 00:00:00 2001 From: Abdourahamane Boinaidi Date: Fri, 26 Jul 2024 16:17:06 +0200 Subject: [PATCH 6/6] Remove baseActivity --- .../swisstransfer/ui/BaseActivity.kt | 31 ------------------- .../swisstransfer/ui/MainActivity.kt | 5 ++- .../swisstransfer/ui/NewTransferActivity.kt | 5 ++- 3 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt deleted file mode 100644 index 2a9f7e54b..000000000 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/BaseActivity.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Infomaniak SwissTransfer - 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 . - */ - -package com.infomaniak.swisstransfer.ui - -import android.os.Bundle -import androidx.activity.ComponentActivity -import androidx.activity.enableEdgeToEdge - -open class BaseActivity : ComponentActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - } -} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt index 5bcc4553e..a9e42cbb2 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt @@ -19,14 +19,17 @@ package com.infomaniak.swisstransfer.ui import android.os.Bundle +import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import com.infomaniak.swisstransfer.ui.screen.main.MainScreen import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -class MainActivity : BaseActivity() { +class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + enableEdgeToEdge() setContent { SwissTransferTheme { MainScreen() diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt index 9b67dbc9f..70e67d086 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/NewTransferActivity.kt @@ -19,13 +19,16 @@ package com.infomaniak.swisstransfer.ui import android.os.Bundle +import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import com.infomaniak.swisstransfer.ui.screen.newtransfer.NewTransferScreen -class NewTransferActivity : BaseActivity() { +class NewTransferActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + enableEdgeToEdge() setContent { NewTransferScreen() }