diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 8e523ecb3991..fb5601f0d686 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -13,6 +13,7 @@ plugins { id(Dependencies.Plugin.kotlinParcelizeId) id(Dependencies.Plugin.ksp) version Versions.Plugin.ksp id(Dependencies.Plugin.junit5) version Versions.Plugin.junit5 + id(Dependencies.Plugin.composeCompiler) version Versions.kotlin } val repoRootPath = rootProject.projectDir.absoluteFile.parentFile.absolutePath @@ -127,8 +128,6 @@ android { buildConfig = true } - composeOptions { kotlinCompilerExtensionVersion = Versions.kotlinCompilerExtensionVersion } - compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -244,6 +243,8 @@ android { project.tasks.assemble.dependsOn("ensureValidVersionCode") } +composeCompiler { enableStrongSkippingMode = true } + androidComponents { beforeVariants { variantBuilder -> variantBuilder.enable = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ApiAccessMethodInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ApiAccessMethodInfoDialog.kt index 141b610d4390..8b607fe676b6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ApiAccessMethodInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ApiAccessMethodInfoDialog.kt @@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -17,7 +18,7 @@ private fun PreviewApiAccessMethodInfoDialog() { AppTheme { ApiAccessMethodInfoDialog(EmptyDestinationsNavigator) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ApiAccessMethodInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ChangelogDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ChangelogDialog.kt index 8e34ecdce4ed..609388906e2d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ChangelogDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ChangelogDialog.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.navigation.NavController import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.button.PrimaryButton @@ -27,7 +28,7 @@ import net.mullvad.mullvadvpn.viewmodel.Changelog import net.mullvad.mullvadvpn.viewmodel.ChangelogViewModel import org.koin.androidx.compose.koinViewModel -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun Changelog(navController: NavController, changeLog: Changelog) { val viewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt index 09e3d0fa6b55..9e1913b498b6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ContentBlockersInfoDialog.kt @@ -4,12 +4,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.textResource -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ContentBlockersInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt index d6eb004322a8..9e9cb5b78d61 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CreateCustomListDialog.kt @@ -16,6 +16,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.CustomListLocationsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -23,7 +25,6 @@ import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.button.PrimaryButton import net.mullvad.mullvadvpn.compose.communication.Created import net.mullvad.mullvadvpn.compose.component.CustomListNameTextField -import net.mullvad.mullvadvpn.compose.destinations.CustomListLocationsDestination import net.mullvad.mullvadvpn.compose.state.CreateCustomListUiState import net.mullvad.mullvadvpn.compose.test.CREATE_CUSTOM_LIST_DIALOG_INPUT_TEST_TAG import net.mullvad.mullvadvpn.lib.model.CustomListAlreadyExists @@ -55,7 +56,7 @@ private fun PreviewCreateCustomListDialogError() { } @Composable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) fun CreateCustomList( navigator: DestinationsNavigator, backNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt index c692b27305c9..d8e52d96cde7 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomDnsInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -16,7 +17,7 @@ private fun PreviewCustomDnsInfoDialog() { CustomDnsInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun CustomDnsInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteApiAccessMethodConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteApiAccessMethodConfirmationDialog.kt index b4a98bd82cd9..021a78e5eb09 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteApiAccessMethodConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteApiAccessMethodConfirmationDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -24,7 +25,7 @@ private fun PreviewDeleteApiAccessMethodConfirmationDialog() { } @Composable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) fun DeleteApiAccessMethodConfirmation( navigator: ResultBackNavigator, apiAccessMethodId: ApiAccessMethodId diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialog.kt index 4990296281c5..22598d3d2d66 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialog.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -32,7 +33,7 @@ private fun PreviewRemoveDeviceConfirmationDialog() { } @Composable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) fun DeleteCustomList( navigator: ResultBackNavigator, customListId: CustomListId, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt index 258af7e44a78..98d1c4a87c65 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt @@ -4,11 +4,12 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun DeviceNameInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DiscardChangesDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DiscardChangesDialog.kt index adac4935bb31..b6cb66ad9370 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DiscardChangesDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DiscardChangesDialog.kt @@ -10,12 +10,13 @@ import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.res.stringResource import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.button.PrimaryButton -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun DiscardChangesDialog(resultBackNavigator: ResultBackNavigator) { AlertDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt index be0a6eb38df9..8db8caffe567 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt @@ -16,6 +16,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -51,7 +52,7 @@ private fun PreviewDnsDialogEditAllowLanDisabled() { AppTheme { DnsDialog(DnsDialogViewState("192.168.1.1", null, true, false, 0), {}, {}, {}, {}) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun DnsDialog( resultNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialog.kt index 3b333cd8776e..42fe1cbf82eb 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialog.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -43,7 +44,7 @@ private fun PreviewEditCustomListNameDialog() { } @Composable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) fun EditCustomListName( backNavigator: ResultBackNavigator, customListId: CustomListId, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt index e67796d37e3d..9f210ead706f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/LocalNetworkSharingInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -17,7 +18,7 @@ private fun PreviewLocalNetworkSharingInfoDialog() { LocalNetworkSharingInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun LocalNetworkSharingInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MalwareInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MalwareInfoDialog.kt index a00d75b53eaf..13e6c886328c 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MalwareInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MalwareInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -16,7 +17,7 @@ private fun PreviewMalwareInfoDialog() { MalwareInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun MalwareInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt index 24020db23ddf..e3d44c0fd5ac 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.EmptyResultBackNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -41,7 +42,7 @@ private fun PreviewMtuDialog() { AppTheme { MtuDialog(mtuInitial = Mtu(1234), EmptyResultBackNavigator()) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun MtuDialog(mtuInitial: Mtu?, navigator: ResultBackNavigator) { val viewModel = koinViewModel(parameters = { parametersOf(mtuInitial) }) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt index e6e3edd3ac34..ba286e030270 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ObfuscationInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -16,7 +17,7 @@ private fun PreviewObfuscationInfoDialog() { ObfuscationInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ObfuscationInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt index 47ea8badfc65..deaa8a118006 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/QuantumResistanceInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -16,7 +17,7 @@ private fun PreviewQuantumResistanceInfoDialog() { QuantumResistanceInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun QuantumResistanceInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt index 7034e67a91b6..935cc431f6ef 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.SecureFlagPolicy import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.BuildConfig @@ -104,7 +105,7 @@ private fun PreviewRedeemVoucherDialogSuccess() { } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun RedeemVoucher(resultBackNavigator: ResultBackNavigator) { val vm = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt index 863b90e82ac3..c37bd2dbb00f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.EmptyResultBackNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -39,7 +40,7 @@ private fun PreviewRemoveDeviceConfirmationDialog( AppTheme { RemoveDeviceConfirmationDialog(EmptyResultBackNavigator(), device = device) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun RemoveDeviceConfirmationDialog(navigator: ResultBackNavigator, device: Device) { AlertDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt index b015d7c5b7e1..344ea1ca9f86 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ReportProblemNoEmailDialog.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.EmptyResultBackNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -29,7 +30,7 @@ private fun PreviewReportProblemNoEmailDialog() { AppTheme { ReportProblemNoEmailDialog(EmptyResultBackNavigator()) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ReportProblemNoEmailDialog(resultBackNavigator: ResultBackNavigator) { AlertDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ResetServerIpOverridesConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ResetServerIpOverridesConfirmationDialog.kt index 727ffeaaa20d..70489db54c03 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ResetServerIpOverridesConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ResetServerIpOverridesConfirmationDialog.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -30,7 +31,7 @@ private fun PreviewResetServerIpOverridesConfirmationDialog() { AppTheme { ResetServerIpOverridesConfirmationDialog({}, {}) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ResetServerIpOverridesConfirmation(resultBackNavigator: ResultBackNavigator) { val vm: ResetServerIpOverridesConfirmationViewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/SaveApiAccessMethodDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/SaveApiAccessMethodDialog.kt index 3ade701db4e7..19f02d4802e2 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/SaveApiAccessMethodDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/SaveApiAccessMethodDialog.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -45,7 +46,7 @@ private fun PreviewSaveApiAccessMethodDialog( AppTheme { SaveApiAccessMethodDialog(state = state) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun SaveApiAccessMethod( backNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ServerIpOverridesInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ServerIpOverridesInfoDialog.kt index a42e314991e8..777ac5d195aa 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ServerIpOverridesInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ServerIpOverridesInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -16,7 +17,7 @@ private fun PreviewServerIpOverridesInfoDialog() { ServerIpOverridesInfoDialog(EmptyDestinationsNavigator) } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun ServerIpOverridesInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/UdpOverTcpPortInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/UdpOverTcpPortInfoDialog.kt index 22a93bb4bf0b..a49380b8eeb0 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/UdpOverTcpPortInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/UdpOverTcpPortInfoDialog.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -17,7 +18,7 @@ private fun PreviewUdpOverTcpPortInfoDialog() { AppTheme { UdpOverTcpPortInfoDialog(EmptyDestinationsNavigator) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun UdpOverTcpPortInfoDialog(navigator: DestinationsNavigator) { InfoDialog( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt index 6640984a0f03..ace0be15c0d6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.EmptyResultBackNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -54,7 +55,7 @@ data class WireguardCustomPortNavArgs( val allowedPortRanges: List, ) : Parcelable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun WireguardCustomPortDialog( navArg: WireguardCustomPortNavArgs, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardPortInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardPortInfoDialog.kt index 6d497dd93ec4..0484c995fbf4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardPortInfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardPortInfoDialog.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle @@ -28,7 +29,7 @@ private fun PreviewWireguardPortInfoDialog() { @Parcelize data class WireguardPortInfoDialogArgument(val portRanges: List) : Parcelable -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun WireguardPortInfoDialog( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/PaymentDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/PaymentDialog.kt index 5af5e4305d70..6aa15bc17dd3 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/PaymentDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/PaymentDialog.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -120,7 +121,7 @@ private fun PreviewPaymentDialogPaymentAvailabilityError() { } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun Payment(productId: ProductId, resultBackNavigator: ResultBackNavigator) { val vm = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/VerificationPendingDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/VerificationPendingDialog.kt index 81a0b25b8702..6af4a328bfde 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/VerificationPendingDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/payment/VerificationPendingDialog.kt @@ -9,6 +9,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.spec.DestinationStyle import net.mullvad.mullvadvpn.R @@ -22,7 +23,7 @@ private fun PreviewVerificationPendingDialog() { AppTheme { VerificationPendingDialog(onClose = {}) } } -@Destination(style = DestinationStyle.Dialog::class) +@Destination(style = DestinationStyle.Dialog::class) @Composable fun VerificationPendingDialog(navigator: DestinationsNavigator) { VerificationPendingDialog(onClose = dropUnlessResumed { navigator.navigateUp() }) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AccountScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AccountScreen.kt index d5c921240633..9e785b78e0ad 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AccountScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AccountScreen.kt @@ -26,6 +26,13 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.DeviceNameInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.LoginDestination +import com.ramcosta.composedestinations.generated.destinations.PaymentDestination +import com.ramcosta.composedestinations.generated.destinations.RedeemVoucherDestination +import com.ramcosta.composedestinations.generated.destinations.VerificationPendingDialogDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.result.NavResult @@ -35,7 +42,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.launch import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.ExternalButton import net.mullvad.mullvadvpn.compose.button.NegativeButton import net.mullvad.mullvadvpn.compose.button.RedeemVoucherButton @@ -45,11 +51,6 @@ import net.mullvad.mullvadvpn.compose.component.MissingPolicy import net.mullvad.mullvadvpn.compose.component.NavigateBackDownIconButton import net.mullvad.mullvadvpn.compose.component.PlayPayment import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.destinations.DeviceNameInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination -import net.mullvad.mullvadvpn.compose.destinations.PaymentDestination -import net.mullvad.mullvadvpn.compose.destinations.RedeemVoucherDestination -import net.mullvad.mullvadvpn.compose.destinations.VerificationPendingDialogDestination import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.state.PaymentState import net.mullvad.mullvadvpn.compose.transitions.SlideInFromBottomTransition @@ -103,7 +104,7 @@ private fun PreviewAccountScreen() { } @OptIn(ExperimentalMaterial3Api::class) -@Destination(style = SlideInFromBottomTransition::class) +@Destination(style = SlideInFromBottomTransition::class) @Composable fun Account( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt index 1c26986fac2a..42a61e8d45f9 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreen.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.button.PrimaryButton @@ -28,9 +29,9 @@ import net.mullvad.mullvadvpn.compose.cell.TwoRowCell import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar import net.mullvad.mullvadvpn.compose.constant.ContentType -import net.mullvad.mullvadvpn.compose.destinations.ApiAccessMethodDetailsDestination -import net.mullvad.mullvadvpn.compose.destinations.ApiAccessMethodInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.EditApiAccessMethodDestination +import com.ramcosta.composedestinations.generated.destinations.ApiAccessMethodDetailsDestination +import com.ramcosta.composedestinations.generated.destinations.ApiAccessMethodInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.EditApiAccessMethodDestination import net.mullvad.mullvadvpn.compose.extensions.itemsWithDivider import net.mullvad.mullvadvpn.compose.preview.ApiAccessListUiStateParameterProvider import net.mullvad.mullvadvpn.compose.state.ApiAccessListUiState @@ -51,7 +52,7 @@ private fun PreviewApiAccessList( AppTheme { ApiAccessListScreen(state = state) } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun ApiAccessList(navigator: DestinationsNavigator) { val viewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreen.kt index 0b3902aa7c41..bce7ebca3594 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultRecipient import kotlinx.coroutines.launch @@ -44,8 +45,8 @@ import net.mullvad.mullvadvpn.compose.cell.SwitchComposeSubtitleCell import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorLarge import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.destinations.DeleteApiAccessMethodConfirmationDestination -import net.mullvad.mullvadvpn.compose.destinations.EditApiAccessMethodDestination +import com.ramcosta.composedestinations.generated.destinations.DeleteApiAccessMethodConfirmationDestination +import com.ramcosta.composedestinations.generated.destinations.EditApiAccessMethodDestination import net.mullvad.mullvadvpn.compose.preview.ApiAccessMethodDetailsUiStatePreviewParameterProvider import net.mullvad.mullvadvpn.compose.state.ApiAccessMethodDetailsUiState import net.mullvad.mullvadvpn.compose.test.API_ACCESS_DETAILS_EDIT_BUTTON @@ -75,7 +76,7 @@ private fun PreviewApiAccessMethodDetailsScreen( AppTheme { ApiAccessMethodDetailsScreen(state = state) } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun ApiAccessMethodDetails( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt index 95d5ca6dcf27..5ebdb0277863 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt @@ -49,6 +49,7 @@ import androidx.constraintlayout.compose.ConstraintLayoutScope import androidx.core.text.HtmlCompat import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import kotlinx.coroutines.launch import net.mullvad.mullvadvpn.R @@ -72,7 +73,7 @@ private fun PreviewAutoConnectAndLockdownModeScreen() { AppTheme { AutoConnectAndLockdownModeScreen() } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun AutoConnectAndLockdownMode(navigator: DestinationsNavigator) { AutoConnectAndLockdownModeScreen(onBackClick = dropUnlessResumed { navigator.navigateUp() }) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt index 36b351ddee1a..a1b04fe6126b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt @@ -47,12 +47,18 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.AccountDestination +import com.ramcosta.composedestinations.generated.destinations.DeviceRevokedDestination +import com.ramcosta.composedestinations.generated.destinations.OutOfTimeDestination +import com.ramcosta.composedestinations.generated.destinations.SelectLocationDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.result.ResultRecipient import kotlinx.coroutines.launch import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.ConnectionButton import net.mullvad.mullvadvpn.compose.button.SwitchLocationButton import net.mullvad.mullvadvpn.compose.component.ConnectionStatusText @@ -61,11 +67,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicator import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBarAndDeviceName import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar import net.mullvad.mullvadvpn.compose.component.notificationbanner.NotificationBanner -import net.mullvad.mullvadvpn.compose.destinations.AccountDestination -import net.mullvad.mullvadvpn.compose.destinations.DeviceRevokedDestination -import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination -import net.mullvad.mullvadvpn.compose.destinations.SelectLocationDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.state.ConnectUiState import net.mullvad.mullvadvpn.compose.test.CIRCULAR_PROGRESS_INDICATOR @@ -116,7 +117,7 @@ private fun PreviewConnectScreen() { } } -@Destination(style = HomeTransition::class) +@Destination(style = HomeTransition::class) @Composable fun Connect( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt index bbde96b99fb7..4d60c06b0a4e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListLocationsScreen.kt @@ -28,6 +28,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.DiscardChangesDialogDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultBackNavigator @@ -43,7 +45,6 @@ import net.mullvad.mullvadvpn.compose.component.ScaffoldWithSmallTopBar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar import net.mullvad.mullvadvpn.compose.constant.CommonContentKey import net.mullvad.mullvadvpn.compose.constant.ContentType -import net.mullvad.mullvadvpn.compose.destinations.DiscardChangesDialogDestination import net.mullvad.mullvadvpn.compose.state.CustomListLocationsUiState import net.mullvad.mullvadvpn.compose.test.CIRCULAR_PROGRESS_INDICATOR import net.mullvad.mullvadvpn.compose.test.SAVE_BUTTON_TEST_TAG @@ -68,7 +69,7 @@ private fun PreviewCustomListLocationScreen() { } @Composable -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) fun CustomListLocations( navigator: DestinationsNavigator, backNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt index 7611cfcf6bc7..dacd0d3f2127 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt @@ -25,6 +25,9 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.CreateCustomListDestination +import com.ramcosta.composedestinations.generated.destinations.EditCustomListDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultRecipient @@ -36,8 +39,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicator import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar import net.mullvad.mullvadvpn.compose.constant.ContentType -import net.mullvad.mullvadvpn.compose.destinations.CreateCustomListDestination -import net.mullvad.mullvadvpn.compose.destinations.EditCustomListDestination import net.mullvad.mullvadvpn.compose.extensions.itemsWithDivider import net.mullvad.mullvadvpn.compose.state.CustomListsUiState import net.mullvad.mullvadvpn.compose.test.CIRCULAR_PROGRESS_INDICATOR @@ -58,7 +59,7 @@ private fun PreviewCustomListsScreen() { } @Composable -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) fun CustomLists( navigator: DestinationsNavigator, editCustomListResultRecipient: ResultRecipient diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index c6d8a06d208c..94af4dad00b6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -33,6 +33,10 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.LoginDestination +import com.ramcosta.composedestinations.generated.destinations.RemoveDeviceConfirmationDialogDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.result.NavResult @@ -46,9 +50,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicator import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorMedium import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination -import net.mullvad.mullvadvpn.compose.destinations.RemoveDeviceConfirmationDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination import net.mullvad.mullvadvpn.compose.preview.DeviceListPreviewParameterProvider import net.mullvad.mullvadvpn.compose.state.DeviceItemUiState import net.mullvad.mullvadvpn.compose.state.DeviceListUiState @@ -102,7 +103,7 @@ private fun PreviewDeviceListError() { } } -@Destination(style = DefaultTransition::class) +@Destination(style = DefaultTransition::class) @Composable fun DeviceList( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceRevokedScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceRevokedScreen.kt index ac434243835b..b73a64577660 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceRevokedScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceRevokedScreen.kt @@ -23,14 +23,15 @@ import androidx.constraintlayout.compose.Dimension import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.LoginDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.DeviceRevokedLoginButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination import net.mullvad.mullvadvpn.compose.state.DeviceRevokedUiState import net.mullvad.mullvadvpn.compose.util.LaunchedEffectCollect import net.mullvad.mullvadvpn.lib.theme.AppTheme @@ -45,7 +46,7 @@ private fun PreviewDeviceRevokedScreen() { AppTheme { DeviceRevokedScreen(state = DeviceRevokedUiState.SECURED) } } -@Destination +@Destination @Composable fun DeviceRevoked(navigator: DestinationsNavigator) { val viewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditApiAccessMethodScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditApiAccessMethodScreen.kt index c6576cf21d80..f56ae3d1405f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditApiAccessMethodScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditApiAccessMethodScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.result.ResultRecipient @@ -46,8 +47,8 @@ import net.mullvad.mullvadvpn.compose.component.NavigateCloseIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithSmallTopBar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar import net.mullvad.mullvadvpn.compose.component.textResource -import net.mullvad.mullvadvpn.compose.destinations.DiscardChangesDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.SaveApiAccessMethodDestination +import com.ramcosta.composedestinations.generated.destinations.DiscardChangesDialogDestination +import com.ramcosta.composedestinations.generated.destinations.SaveApiAccessMethodDestination import net.mullvad.mullvadvpn.compose.preview.EditApiAccessMethodUiStateParameterProvider import net.mullvad.mullvadvpn.compose.state.ApiAccessMethodTypes import net.mullvad.mullvadvpn.compose.state.EditApiAccessFormData @@ -82,7 +83,7 @@ private fun PreviewEditApiAccessMethodScreen( AppTheme { EditApiAccessMethodScreen(state = state) } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun EditApiAccessMethod( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreen.kt index 779fd06b41e6..ad112edca3d3 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreen.kt @@ -23,6 +23,10 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.CustomListLocationsDestination +import com.ramcosta.composedestinations.generated.destinations.DeleteCustomListDestination +import com.ramcosta.composedestinations.generated.destinations.EditCustomListNameDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultBackNavigator @@ -34,9 +38,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicator import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar import net.mullvad.mullvadvpn.compose.component.SpacedColumn -import net.mullvad.mullvadvpn.compose.destinations.CustomListLocationsDestination -import net.mullvad.mullvadvpn.compose.destinations.DeleteCustomListDestination -import net.mullvad.mullvadvpn.compose.destinations.EditCustomListNameDestination import net.mullvad.mullvadvpn.compose.state.EditCustomListState import net.mullvad.mullvadvpn.compose.test.CIRCULAR_PROGRESS_INDICATOR import net.mullvad.mullvadvpn.compose.test.DELETE_DROPDOWN_MENU_ITEM_TEST_TAG @@ -77,7 +78,7 @@ private fun PreviewEditCustomListScreen() { } @Composable -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) fun EditCustomList( navigator: DestinationsNavigator, backNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreen.kt index 4458f8b5887b..b9a551731c99 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/FilterScreen.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.button.ApplyButton @@ -67,7 +68,7 @@ private fun PreviewFilterScreen() { } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun FilterScreen(navigator: DestinationsNavigator) { val viewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ImportOverridesByTextScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ImportOverridesByTextScreen.kt index 9e2813f59dca..6623886578ab 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ImportOverridesByTextScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ImportOverridesByTextScreen.kt @@ -23,6 +23,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.result.ResultBackNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.MullvadSmallTopBar @@ -35,7 +36,7 @@ private fun PreviewImportOverridesByText() { ImportOverridesByTextScreen({}, {}) } -@Destination(style = DefaultTransition::class) +@Destination(style = DefaultTransition::class) @Composable fun ImportOverridesByText( resultNavigator: ResultBackNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt index 80c30f6400a7..8ddade13d041 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt @@ -49,19 +49,20 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.DeviceListDestination +import com.ramcosta.composedestinations.generated.destinations.OutOfTimeDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination +import com.ramcosta.composedestinations.generated.destinations.WelcomeDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.PrimaryButton import net.mullvad.mullvadvpn.compose.button.VariantButton import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorLarge import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.DeviceListDestination -import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination -import net.mullvad.mullvadvpn.compose.destinations.WelcomeDestination import net.mullvad.mullvadvpn.compose.state.LoginError import net.mullvad.mullvadvpn.compose.state.LoginState import net.mullvad.mullvadvpn.compose.state.LoginState.Idle @@ -111,7 +112,7 @@ private fun PreviewLoginSuccess() { AppTheme { LoginScreen(state = LoginUiState(loginState = Success)) } } -@Destination(style = LoginTransition::class) +@Destination(style = LoginTransition::class) @Composable fun Login( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt index e2ee4cc240f0..f09006792308 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/MullvadApp.kt @@ -10,17 +10,17 @@ import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.testTagsAsResourceId import androidx.navigation.NavHostController import com.ramcosta.composedestinations.DestinationsNavHost +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.ChangelogDestination +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.NoDaemonScreenDestination +import com.ramcosta.composedestinations.generated.destinations.OutOfTimeDestination import com.ramcosta.composedestinations.navigation.navigate import com.ramcosta.composedestinations.navigation.popBackStack import com.ramcosta.composedestinations.rememberNavHostEngine import com.ramcosta.composedestinations.utils.destination import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map -import net.mullvad.mullvadvpn.compose.NavGraphs -import net.mullvad.mullvadvpn.compose.destinations.ChangelogDestination -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.NoDaemonScreenDestination -import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination import net.mullvad.mullvadvpn.compose.util.LaunchedEffectCollect import net.mullvad.mullvadvpn.compose.util.RequestVpnPermission import net.mullvad.mullvadvpn.viewmodel.ChangelogViewModel diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/NoDaemonScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/NoDaemonScreen.kt index 82ae16a20804..863cb632586a 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/NoDaemonScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/NoDaemonScreen.kt @@ -24,10 +24,11 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.core.app.ActivityCompat.finishAffinity import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination import net.mullvad.mullvadvpn.compose.transitions.DefaultTransition import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.Dimens @@ -41,7 +42,7 @@ private fun PreviewNoDaemonScreen() { } // Set this as the start destination of the default nav graph -@Destination(style = DefaultTransition::class) +@Destination(style = DefaultTransition::class) @Composable fun NoDaemonScreen(navigator: DestinationsNavigator) { NoDaemonScreen(dropUnlessResumed { navigator.navigate(SettingsDestination) }) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt index 58e5d4f8b3ef..c476a502c4cc 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/OutOfTimeScreen.kt @@ -25,24 +25,25 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.AccountDestination +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.PaymentDestination +import com.ramcosta.composedestinations.generated.destinations.RedeemVoucherDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination +import com.ramcosta.composedestinations.generated.destinations.VerificationPendingDialogDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultRecipient import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.NegativeButton import net.mullvad.mullvadvpn.compose.button.RedeemVoucherButton import net.mullvad.mullvadvpn.compose.button.SitePaymentButton import net.mullvad.mullvadvpn.compose.component.PlayPayment import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBarAndDeviceName import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar -import net.mullvad.mullvadvpn.compose.destinations.AccountDestination -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.PaymentDestination -import net.mullvad.mullvadvpn.compose.destinations.RedeemVoucherDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination -import net.mullvad.mullvadvpn.compose.destinations.VerificationPendingDialogDestination import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.state.OutOfTimeUiState import net.mullvad.mullvadvpn.compose.test.OUT_OF_TIME_SCREEN_TITLE_TEST_TAG @@ -107,7 +108,7 @@ private fun PreviewOutOfTimeScreenError() { } } -@Destination(style = HomeTransition::class) +@Destination(style = HomeTransition::class) @Composable fun OutOfTime( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt index 7ae7a464fcb1..b70b6c9375a2 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt @@ -35,19 +35,20 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.LoginDestination +import com.ramcosta.composedestinations.generated.destinations.SplashDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch import kotlinx.coroutines.withTimeout import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.PrimaryButton import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorMedium import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination -import net.mullvad.mullvadvpn.compose.destinations.SplashDestination import net.mullvad.mullvadvpn.compose.util.LaunchedEffectCollect import net.mullvad.mullvadvpn.compose.util.toDp import net.mullvad.mullvadvpn.constant.DAEMON_READY_TIMEOUT_MS @@ -74,7 +75,7 @@ private fun PreviewPrivacyDisclaimerScreen() { } } -@Destination +@Destination @Composable fun PrivacyDisclaimer( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt index a464a573f775..bcb29a7f61ae 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ReportProblemScreen.kt @@ -29,6 +29,9 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.ReportProblemNoEmailDialogDestination +import com.ramcosta.composedestinations.generated.destinations.ViewLogsDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultRecipient @@ -38,8 +41,6 @@ import net.mullvad.mullvadvpn.compose.button.VariantButton import net.mullvad.mullvadvpn.compose.component.MullvadCircularProgressIndicatorLarge import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.destinations.ReportProblemNoEmailDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.ViewLogsDestination import net.mullvad.mullvadvpn.compose.textfield.mullvadWhiteTextFieldColors import net.mullvad.mullvadvpn.compose.transitions.SlideInFromRightTransition import net.mullvad.mullvadvpn.compose.util.LaunchedEffectCollect @@ -94,7 +95,7 @@ private fun PreviewReportProblemErrorScreen() { } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun ReportProblem( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt index b10a41a070c6..9aeaeb5f36b1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt @@ -48,6 +48,13 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.CreateCustomListDestination +import com.ramcosta.composedestinations.generated.destinations.CustomListLocationsDestination +import com.ramcosta.composedestinations.generated.destinations.CustomListsDestination +import com.ramcosta.composedestinations.generated.destinations.DeleteCustomListDestination +import com.ramcosta.composedestinations.generated.destinations.EditCustomListNameDestination +import com.ramcosta.composedestinations.generated.destinations.FilterScreenDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultBackNavigator @@ -73,12 +80,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadModalBottomSheet import net.mullvad.mullvadvpn.compose.component.MullvadSnackbar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar import net.mullvad.mullvadvpn.compose.constant.ContentType -import net.mullvad.mullvadvpn.compose.destinations.CreateCustomListDestination -import net.mullvad.mullvadvpn.compose.destinations.CustomListLocationsDestination -import net.mullvad.mullvadvpn.compose.destinations.CustomListsDestination -import net.mullvad.mullvadvpn.compose.destinations.DeleteCustomListDestination -import net.mullvad.mullvadvpn.compose.destinations.EditCustomListNameDestination -import net.mullvad.mullvadvpn.compose.destinations.FilterScreenDestination import net.mullvad.mullvadvpn.compose.state.SelectLocationUiState import net.mullvad.mullvadvpn.compose.test.CIRCULAR_PROGRESS_INDICATOR import net.mullvad.mullvadvpn.compose.test.SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG @@ -131,7 +132,7 @@ private fun PreviewSelectLocationScreen() { } } -@Destination(style = SelectLocationTransition::class) +@Destination(style = SelectLocationTransition::class) @Suppress("LongMethod") @Composable fun SelectLocation( @@ -848,7 +849,7 @@ private fun CustomListSuccess.message(context: Context): String = } @Composable -private fun , R : CustomListSuccess> ResultRecipient +private fun ResultRecipient .OnCustomListNavResult( snackbarHostState: SnackbarHostState, performAction: (action: CustomListAction) -> Unit diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ServerIpOverridesScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ServerIpOverridesScreen.kt index 5a7c9be2a626..a067c1afb12b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ServerIpOverridesScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ServerIpOverridesScreen.kt @@ -42,6 +42,10 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.ImportOverridesByTextDestination +import com.ramcosta.composedestinations.generated.destinations.ResetServerIpOverridesConfirmationDestination +import com.ramcosta.composedestinations.generated.destinations.ServerIpOverridesInfoDialogDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultRecipient import kotlinx.coroutines.launch @@ -55,9 +59,6 @@ import net.mullvad.mullvadvpn.compose.component.MullvadModalBottomSheet import net.mullvad.mullvadvpn.compose.component.MullvadSnackbar import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.destinations.ImportOverridesByTextDestination -import net.mullvad.mullvadvpn.compose.destinations.ResetServerIpOverridesConfirmationDestination -import net.mullvad.mullvadvpn.compose.destinations.ServerIpOverridesInfoDialogDestination import net.mullvad.mullvadvpn.compose.test.SERVER_IP_OVERRIDES_IMPORT_BY_FILE_TEST_TAG import net.mullvad.mullvadvpn.compose.test.SERVER_IP_OVERRIDES_IMPORT_BY_TEXT_TEST_TAG import net.mullvad.mullvadvpn.compose.test.SERVER_IP_OVERRIDE_IMPORT_TEST_TAG @@ -93,7 +94,7 @@ private fun PreviewServerIpOverridesScreen() { } } -@Destination(style = SlideInFromRightLeafTransition::class) +@Destination(style = SlideInFromRightLeafTransition::class) @Composable fun ServerIpOverrides( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt index 03d5ede06abb..0673f0485de6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.cell.DefaultExternalLinkView @@ -28,10 +29,10 @@ import net.mullvad.mullvadvpn.compose.cell.NavigationCellBody import net.mullvad.mullvadvpn.compose.cell.NavigationComposeCell import net.mullvad.mullvadvpn.compose.component.NavigateBackDownIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar -import net.mullvad.mullvadvpn.compose.destinations.ApiAccessListDestination -import net.mullvad.mullvadvpn.compose.destinations.ReportProblemDestination -import net.mullvad.mullvadvpn.compose.destinations.SplitTunnelingDestination -import net.mullvad.mullvadvpn.compose.destinations.VpnSettingsDestination +import com.ramcosta.composedestinations.generated.destinations.ApiAccessListDestination +import com.ramcosta.composedestinations.generated.destinations.ReportProblemDestination +import com.ramcosta.composedestinations.generated.destinations.SplitTunnelingDestination +import com.ramcosta.composedestinations.generated.destinations.VpnSettingsDestination import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider import net.mullvad.mullvadvpn.compose.state.SettingsUiState import net.mullvad.mullvadvpn.compose.test.LAZY_LIST_TEST_TAG @@ -61,7 +62,7 @@ private fun PreviewSettings() { } @OptIn(ExperimentalMaterial3Api::class) -@Destination(style = SettingsTransition::class) +@Destination(style = SettingsTransition::class) @Composable fun Settings(navigator: DestinationsNavigator) { val vm = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplashScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplashScreen.kt index 2a024b7a0af3..c4c093552e33 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplashScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplashScreen.kt @@ -19,17 +19,17 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.ramcosta.composedestinations.annotation.Destination -import com.ramcosta.composedestinations.annotation.RootNavGraph +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.DeviceRevokedDestination +import com.ramcosta.composedestinations.generated.destinations.LoginDestination +import com.ramcosta.composedestinations.generated.destinations.OutOfTimeDestination +import com.ramcosta.composedestinations.generated.destinations.PrivacyDisclaimerDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.navigation.popUpTo import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.DeviceRevokedDestination -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination -import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination -import net.mullvad.mullvadvpn.compose.destinations.PrivacyDisclaimerDestination import net.mullvad.mullvadvpn.compose.transitions.DefaultTransition import net.mullvad.mullvadvpn.compose.util.CollectSideEffectWithLifecycle import net.mullvad.mullvadvpn.lib.theme.AppTheme @@ -46,8 +46,7 @@ private fun PreviewLoadingScreen() { } // Set this as the start destination of the default nav graph -@RootNavGraph(start = true) -@Destination(style = DefaultTransition::class) +@Destination(start = true, style = DefaultTransition::class) @Composable fun Splash(navigator: DestinationsNavigator) { val viewModel: SplashViewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreen.kt index 280cef18022a..84a0e6fd9c45 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreen.kt @@ -24,6 +24,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.applist.AppData @@ -85,7 +86,7 @@ private fun PreviewSplitTunnelingScreen() { } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun SplitTunneling(navigator: DestinationsNavigator) { val viewModel = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ViewLogsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ViewLogsScreen.kt index fbb0ea82ce5c..c15c6826a3f6 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ViewLogsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ViewLogsScreen.kt @@ -30,6 +30,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.navigation.DestinationsNavigator import kotlinx.coroutines.launch import net.mullvad.mullvadvpn.R @@ -60,7 +61,7 @@ private fun PreviewViewLogsLoadingScreen() { AppTheme { ViewLogsScreen(state = ViewLogsUiState()) } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable fun ViewLogs(navigator: DestinationsNavigator) { val vm = koinViewModel() diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt index 5c3bf9bb77fe..aa62123e846d 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt @@ -33,6 +33,20 @@ import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.destinations.AutoConnectAndLockdownModeDestination +import com.ramcosta.composedestinations.generated.destinations.ContentBlockersInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.CustomDnsInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.DnsDialogDestination +import com.ramcosta.composedestinations.generated.destinations.LocalNetworkSharingInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.MalwareInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.MtuDialogDestination +import com.ramcosta.composedestinations.generated.destinations.ObfuscationInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.QuantumResistanceInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.ServerIpOverridesDestination +import com.ramcosta.composedestinations.generated.destinations.UdpOverTcpPortInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.WireguardCustomPortDialogDestination +import com.ramcosta.composedestinations.generated.destinations.WireguardPortInfoDialogDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultRecipient import kotlinx.coroutines.launch @@ -55,19 +69,6 @@ import net.mullvad.mullvadvpn.compose.communication.DnsDialogResult import net.mullvad.mullvadvpn.compose.component.NavigateBackIconButton import net.mullvad.mullvadvpn.compose.component.ScaffoldWithMediumTopBar import net.mullvad.mullvadvpn.compose.component.textResource -import net.mullvad.mullvadvpn.compose.destinations.AutoConnectAndLockdownModeDestination -import net.mullvad.mullvadvpn.compose.destinations.ContentBlockersInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.CustomDnsInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.DnsDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.LocalNetworkSharingInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.MalwareInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.MtuDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.ObfuscationInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.QuantumResistanceInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.ServerIpOverridesDestination -import net.mullvad.mullvadvpn.compose.destinations.UdpOverTcpPortInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.WireguardCustomPortDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.WireguardPortInfoDialogDestination import net.mullvad.mullvadvpn.compose.dialog.WireguardCustomPortNavArgs import net.mullvad.mullvadvpn.compose.dialog.WireguardPortInfoDialogArgument import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider @@ -138,7 +139,7 @@ private fun PreviewVpnSettings() { } } -@Destination(style = SlideInFromRightTransition::class) +@Destination(style = SlideInFromRightTransition::class) @Composable @Suppress("LongMethod") fun VpnSettings( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt index f233358bfce2..6022814f5b95 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/WelcomeScreen.kt @@ -29,12 +29,12 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.annotation.RootGraph +import com.ramcosta.composedestinations.generated.NavGraphs import com.ramcosta.composedestinations.navigation.DestinationsNavigator -import com.ramcosta.composedestinations.navigation.popUpTo import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultRecipient import net.mullvad.mullvadvpn.R -import net.mullvad.mullvadvpn.compose.NavGraphs import net.mullvad.mullvadvpn.compose.button.NegativeButton import net.mullvad.mullvadvpn.compose.button.RedeemVoucherButton import net.mullvad.mullvadvpn.compose.button.SitePaymentButton @@ -42,13 +42,14 @@ import net.mullvad.mullvadvpn.compose.component.CopyAnimatedIconButton import net.mullvad.mullvadvpn.compose.component.PlayPayment import net.mullvad.mullvadvpn.compose.component.ScaffoldWithTopBar import net.mullvad.mullvadvpn.compose.component.drawVerticalScrollbar -import net.mullvad.mullvadvpn.compose.destinations.AccountDestination -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.DeviceNameInfoDialogDestination -import net.mullvad.mullvadvpn.compose.destinations.PaymentDestination -import net.mullvad.mullvadvpn.compose.destinations.RedeemVoucherDestination -import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination -import net.mullvad.mullvadvpn.compose.destinations.VerificationPendingDialogDestination +import com.ramcosta.composedestinations.generated.destinations.AccountDestination +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.DeviceNameInfoDialogDestination +import com.ramcosta.composedestinations.generated.destinations.PaymentDestination +import com.ramcosta.composedestinations.generated.destinations.RedeemVoucherDestination +import com.ramcosta.composedestinations.generated.destinations.SettingsDestination +import com.ramcosta.composedestinations.generated.destinations.VerificationPendingDialogDestination +import com.ramcosta.composedestinations.navigation.popUpTo import net.mullvad.mullvadvpn.compose.extensions.createOpenAccountPageHook import net.mullvad.mullvadvpn.compose.state.PaymentState import net.mullvad.mullvadvpn.compose.state.WelcomeUiState @@ -96,7 +97,7 @@ private fun PreviewWelcomeScreen() { } } -@Destination(style = HomeTransition::class) +@Destination(style = HomeTransition::class) @Composable fun Welcome( navigator: DestinationsNavigator, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/DefaultTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/DefaultTransition.kt index 4c02b278d0f3..fa2211ad320f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/DefaultTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/DefaultTransition.kt @@ -1,17 +1,35 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.navigation.NavBackStackEntry import com.ramcosta.composedestinations.spec.DestinationStyle -object DefaultTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = fadeIn() +object DefaultTransition : DestinationStyle.Animated() { + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + fadeIn() + } - override fun AnimatedContentTransitionScope.exitTransition() = fadeOut() + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + fadeOut() + } - override fun AnimatedContentTransitionScope.popEnterTransition() = fadeIn() + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + fadeIn() + } - override fun AnimatedContentTransitionScope.popExitTransition() = fadeOut() + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + fadeOut() + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/HomeTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/HomeTransition.kt index 93c94ecd8739..64fea22ae577 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/HomeTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/HomeTransition.kt @@ -2,30 +2,45 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.LoginDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.LoginDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS // This is used for OutOfTime, Welcome, and Connect destinations. -object HomeTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - when (this.initialState.destination()) { - is LoginDestination -> fadeIn() - else -> EnterTransition.None +object HomeTransition : DestinationStyle.Animated() { + + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + when (this.initialState.destination()) { + is LoginDestination -> fadeIn() + else -> EnterTransition.None + } } // TODO temporary hack until we have a proper solution. // https://issuetracker.google.com/issues/309506799 - override fun AnimatedContentTransitionScope.exitTransition() = - fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + } - override fun AnimatedContentTransitionScope.popEnterTransition() = - EnterTransition.None + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + EnterTransition.None + } - override fun AnimatedContentTransitionScope.popExitTransition() = fadeOut() + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + fadeOut() + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/LoginTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/LoginTransition.kt index 737f369873eb..86c6f3f0dd46 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/LoginTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/LoginTransition.kt @@ -1,33 +1,50 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.ConnectDestination +import com.ramcosta.composedestinations.generated.destinations.DeviceListDestination +import com.ramcosta.composedestinations.generated.destinations.OutOfTimeDestination +import com.ramcosta.composedestinations.generated.destinations.WelcomeDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination -import net.mullvad.mullvadvpn.compose.destinations.DeviceListDestination -import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination -import net.mullvad.mullvadvpn.compose.destinations.WelcomeDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS -object LoginTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = fadeIn() +object LoginTransition : DestinationStyle.Animated() { + override val enterTransition: + (AnimatedContentTransitionScope.() -> EnterTransition) = + { + fadeIn() + } // TODO temporary hack until we have a proper solution. // https://issuetracker.google.com/issues/309506799 - override fun AnimatedContentTransitionScope.exitTransition() = - when (this.targetState.destination()) { - is OutOfTimeDestination, - is WelcomeDestination, - is ConnectDestination, - is DeviceListDestination -> fadeOut() - else -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + when (this.targetState.destination()) { + is OutOfTimeDestination, + is WelcomeDestination, + is ConnectDestination, + is DeviceListDestination -> fadeOut() + else -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + } } - override fun AnimatedContentTransitionScope.popEnterTransition() = fadeIn() + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + fadeIn() + } - override fun AnimatedContentTransitionScope.popExitTransition() = fadeOut() + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + fadeOut() + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SettingsTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SettingsTransition.kt index 75fb7286fc57..1ec403428112 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SettingsTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SettingsTransition.kt @@ -1,6 +1,8 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut @@ -9,28 +11,41 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutHorizontally import androidx.compose.animation.slideOutVertically import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.NoDaemonScreenDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.NoDaemonScreenDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS import net.mullvad.mullvadvpn.constant.withHorizontalScalingFactor -object SettingsTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - slideInVertically(initialOffsetY = { it }) +object SettingsTransition : DestinationStyle.Animated() { - override fun AnimatedContentTransitionScope.exitTransition() = - when (targetState.destination()) { - NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) - else -> slideOutHorizontally(targetOffsetX = { -it.withHorizontalScalingFactor() }) + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + slideInVertically(initialOffsetY = { it }) } - override fun AnimatedContentTransitionScope.popEnterTransition() = - when (initialState.destination()) { - NoDaemonScreenDestination -> fadeIn(snap(0)) - else -> slideInHorizontally(initialOffsetX = { -it.withHorizontalScalingFactor() }) + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + when (targetState.destination()) { + NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + else -> slideOutHorizontally(targetOffsetX = { -it.withHorizontalScalingFactor() }) + } } - override fun AnimatedContentTransitionScope.popExitTransition() = - slideOutVertically(targetOffsetY = { it }) + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + when (initialState.destination()) { + NoDaemonScreenDestination -> fadeIn(snap(0)) + else -> slideInHorizontally(initialOffsetX = { -it.withHorizontalScalingFactor() }) + } + } + + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + slideOutVertically(targetOffsetY = { it }) + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromBottomTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromBottomTransition.kt index da802483b523..14dde875d7e1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromBottomTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromBottomTransition.kt @@ -1,6 +1,8 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut @@ -9,50 +11,74 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutHorizontally import androidx.compose.animation.slideOutVertically import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.NoDaemonScreenDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.NoDaemonScreenDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS import net.mullvad.mullvadvpn.constant.withHorizontalScalingFactor -object SlideInFromBottomTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - slideInVertically(initialOffsetY = { it }) +object SlideInFromBottomTransition : DestinationStyle.Animated() { + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition? = + { + slideInVertically(initialOffsetY = { it }) + } - override fun AnimatedContentTransitionScope.exitTransition() = - when (targetState.destination()) { - NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) - else -> fadeOut() + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition? = + { + when (targetState.destination()) { + NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + else -> fadeOut() + } } - override fun AnimatedContentTransitionScope.popEnterTransition() = - when (initialState.destination()) { - NoDaemonScreenDestination -> fadeIn(snap(0)) - else -> fadeIn() + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + when (initialState.destination()) { + NoDaemonScreenDestination -> fadeIn(snap(0)) + else -> fadeIn() + } } - override fun AnimatedContentTransitionScope.popExitTransition() = - slideOutVertically(targetOffsetY = { it }) + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + slideOutVertically(targetOffsetY = { it }) + } } -object SelectLocationTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - slideInVertically(initialOffsetY = { it }) +object SelectLocationTransition : DestinationStyle.Animated() { + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + slideInVertically(initialOffsetY = { it }) + } // TODO temporary hack until we have a proper solution. // https://issuetracker.google.com/issues/309506799 - override fun AnimatedContentTransitionScope.exitTransition() = - when (targetState.destination()) { - NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) - else -> slideOutHorizontally { -it.withHorizontalScalingFactor() } + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + when (targetState.destination()) { + NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + else -> slideOutHorizontally { -it.withHorizontalScalingFactor() } + } } - override fun AnimatedContentTransitionScope.popEnterTransition() = - when (initialState.destination()) { - NoDaemonScreenDestination -> fadeIn(snap(0)) - else -> slideInHorizontally { -it.withHorizontalScalingFactor() } + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + when (initialState.destination()) { + NoDaemonScreenDestination -> fadeIn(snap(0)) + else -> slideInHorizontally { -it.withHorizontalScalingFactor() } + } } - override fun AnimatedContentTransitionScope.popExitTransition() = - slideOutVertically(targetOffsetY = { it }) + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition? = + { + slideOutVertically(targetOffsetY = { it }) + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightLeafTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightLeafTransition.kt index 45ea74931a38..670877dfaa73 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightLeafTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightLeafTransition.kt @@ -1,30 +1,44 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.NoDaemonScreenDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.NoDaemonScreenDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS -object SlideInFromRightLeafTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - slideInHorizontally(initialOffsetX = { it }) +object SlideInFromRightLeafTransition : DestinationStyle.Animated() { + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + slideInHorizontally(initialOffsetX = { it }) + } - override fun AnimatedContentTransitionScope.exitTransition() = - when (targetState.destination()) { - NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) - else -> fadeOut() + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + when (targetState.destination()) { + NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + else -> fadeOut() + } } - override fun AnimatedContentTransitionScope.popEnterTransition() = - fadeIn(snap(0)) + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + fadeIn(snap(0)) + } - override fun AnimatedContentTransitionScope.popExitTransition() = - slideOutHorizontally(targetOffsetX = { it }) + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + slideOutHorizontally(targetOffsetX = { it }) + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightTransition.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightTransition.kt index 69baa8eb4796..6ff49210f6aa 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightTransition.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/transitions/SlideInFromRightTransition.kt @@ -1,34 +1,48 @@ package net.mullvad.mullvadvpn.compose.transitions import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.snap import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally import androidx.navigation.NavBackStackEntry +import com.ramcosta.composedestinations.generated.destinations.NoDaemonScreenDestination import com.ramcosta.composedestinations.spec.DestinationStyle import com.ramcosta.composedestinations.utils.destination -import net.mullvad.mullvadvpn.compose.destinations.NoDaemonScreenDestination import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS import net.mullvad.mullvadvpn.constant.withHorizontalScalingFactor -object SlideInFromRightTransition : DestinationStyle.Animated { - override fun AnimatedContentTransitionScope.enterTransition() = - slideInHorizontally(initialOffsetX = { it }) +object SlideInFromRightTransition : DestinationStyle.Animated() { + override val enterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + slideInHorizontally(initialOffsetX = { it }) + } - override fun AnimatedContentTransitionScope.exitTransition() = - when (targetState.destination()) { - NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) - else -> slideOutHorizontally(targetOffsetX = { -it.withHorizontalScalingFactor() }) + override val exitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + when (targetState.destination()) { + NoDaemonScreenDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS)) + else -> slideOutHorizontally(targetOffsetX = { -it.withHorizontalScalingFactor() }) + } } - override fun AnimatedContentTransitionScope.popEnterTransition() = - when (initialState.destination()) { - NoDaemonScreenDestination -> fadeIn(snap(0)) - else -> slideInHorizontally(initialOffsetX = { -it.withHorizontalScalingFactor() }) + override val popEnterTransition: + AnimatedContentTransitionScope.() -> EnterTransition = + { + when (initialState.destination()) { + NoDaemonScreenDestination -> fadeIn(snap(0)) + else -> slideInHorizontally(initialOffsetX = { -it.withHorizontalScalingFactor() }) + } } - override fun AnimatedContentTransitionScope.popExitTransition() = - slideOutHorizontally(targetOffsetX = { it }) + override val popExitTransition: + AnimatedContentTransitionScope.() -> ExitTransition = + { + slideOutHorizontally(targetOffsetX = { it }) + } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Navigation.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Navigation.kt index 231c73950041..0d08e331e92b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Navigation.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/util/Navigation.kt @@ -7,7 +7,7 @@ import com.ramcosta.composedestinations.result.ResultRecipient import com.ramcosta.composedestinations.spec.DestinationSpec @Composable -fun , V> ResultRecipient.OnNavResultValue( +fun ResultRecipient.OnNavResultValue( onValue: @DisallowComposableCalls (value: V) -> Unit ) = onNavResult { when (it) { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/NoDaemonViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/NoDaemonViewModel.kt index f8863f243375..d0c7e4113dad 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/NoDaemonViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/NoDaemonViewModel.kt @@ -8,6 +8,8 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import androidx.navigation.NavController import androidx.navigation.NavDestination +import com.ramcosta.composedestinations.generated.destinations.PrivacyDisclaimerDestination +import com.ramcosta.composedestinations.generated.destinations.SplashDestination import com.ramcosta.composedestinations.spec.DestinationSpec import com.ramcosta.composedestinations.utils.destination import kotlin.time.Duration.Companion.seconds @@ -20,8 +22,6 @@ import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.shareIn import kotlinx.coroutines.launch -import net.mullvad.mullvadvpn.compose.destinations.PrivacyDisclaimerDestination -import net.mullvad.mullvadvpn.compose.destinations.SplashDestination import net.mullvad.mullvadvpn.lib.daemon.grpc.GrpcConnectivityState import net.mullvad.mullvadvpn.lib.daemon.grpc.ManagementService @@ -31,7 +31,7 @@ class NoDaemonViewModel(managementService: ManagementService) : ViewModel(), LifecycleEventObserver, NavController.OnDestinationChangedListener { private val lifecycleFlow: MutableSharedFlow = MutableSharedFlow() - private val destinationFlow: MutableSharedFlow> = MutableSharedFlow() + private val destinationFlow: MutableSharedFlow = MutableSharedFlow() @OptIn(FlowPreview::class) val uiSideEffect = @@ -67,7 +67,7 @@ class NoDaemonViewModel(managementService: ManagementService) : private fun toDaemonState( lifecycleEvent: Lifecycle.Event, serviceState: GrpcConnectivityState, - currentDestination: DestinationSpec<*> + currentDestination: DestinationSpec ): DaemonState { // In these destinations we don't care about showing the NoDaemonScreen if (currentDestination in noServiceDestinations) { diff --git a/android/buildSrc/src/main/kotlin/Dependencies.kt b/android/buildSrc/src/main/kotlin/Dependencies.kt index 26b1a03753a2..25e2fe785db8 100644 --- a/android/buildSrc/src/main/kotlin/Dependencies.kt +++ b/android/buildSrc/src/main/kotlin/Dependencies.kt @@ -142,6 +142,7 @@ object Dependencies { "org.owasp:dependency-check-gradle:${Versions.Plugin.dependencyCheck}" const val dependencyCheckId = "org.owasp.dependencycheck" const val detektId = "io.gitlab.arturbosch.detekt" + const val composeCompiler = "org.jetbrains.kotlin.plugin.compose" const val gradleVersionsId = "com.github.ben-manes.versions" const val junit5 = "de.mannodermaus.android-junit5" const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index e9772e555cea..977ffb2e6860 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -4,8 +4,7 @@ object Versions { const val junit = "5.10.2" const val jvmTarget = "17" const val konsist = "0.14.0" - const val kotlin = "1.9.22" - const val kotlinCompilerExtensionVersion = "1.5.10" + const val kotlin = "2.0.0" const val kotlinx = "1.8.0" const val leakCanary = "2.13" const val mockk = "1.13.11" @@ -39,7 +38,7 @@ object Versions { } object Compose { - const val destinations = "1.10.2" + const val destinations = "2.0.0-beta09" const val base = "1.6.3" const val constrainLayout = "1.0.1" const val foundation = base @@ -67,7 +66,7 @@ object Versions { const val ktfmt = "0.17.0" // Ksp version is linked with kotlin version, find matching release here: // https://github.com/google/ksp/releases - const val ksp = "${kotlin}-1.0.17" + const val ksp = "${kotlin}-1.0.21" } object Koin { diff --git a/android/gradle/verification-metadata.xml b/android/gradle/verification-metadata.xml index cf167c417cb5..7fbb964ba598 100644 --- a/android/gradle/verification-metadata.xml +++ b/android/gradle/verification-metadata.xml @@ -82,6 +82,11 @@ + + + + + @@ -387,14 +392,6 @@ - - - - - - - - @@ -778,6 +775,11 @@ + + + + + @@ -791,6 +793,11 @@ + + + + + @@ -1263,6 +1270,11 @@ + + + + + @@ -1356,6 +1368,11 @@ + + + + + @@ -1486,6 +1503,11 @@ + + + + + @@ -2529,6 +2551,11 @@ + + + + + @@ -2539,9 +2566,9 @@ - - - + + + @@ -2552,25 +2579,33 @@ - - - + + + + + + - - - + + + - - + + + + + + + - - - + + + - - + + @@ -3324,28 +3359,28 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -4238,19 +4273,22 @@ + + + + + + + + - - - - - - - - + + + @@ -4271,9 +4309,14 @@ - - - + + + + + + + + @@ -4281,9 +4324,9 @@ - - - + + + @@ -4291,9 +4334,9 @@ - - - + + + @@ -4316,14 +4359,24 @@ + + + + + - - - + + + + + + + + @@ -4331,9 +4384,9 @@ - - - + + + @@ -4351,6 +4404,11 @@ + + + + + @@ -4359,12 +4417,12 @@ - - - + + + - - + + @@ -4372,9 +4430,9 @@ - - - + + + @@ -4388,12 +4446,15 @@ - - - + + + - - + + + + + @@ -4404,12 +4465,12 @@ - - - + + + - - + + @@ -4417,9 +4478,9 @@ - - - + + + @@ -4430,12 +4491,12 @@ - - - + + + - - + + @@ -4443,9 +4504,9 @@ - - - + + + @@ -4453,9 +4514,9 @@ - - - + + + @@ -4463,9 +4524,14 @@ - - - + + + + + + + + @@ -4473,19 +4539,19 @@ - - - + + + - - - + + + - - - + + + @@ -4493,11 +4559,6 @@ - - - - - @@ -4513,6 +4574,11 @@ + + + + + @@ -4546,14 +4612,19 @@ + + + + + - - - + + + @@ -4561,9 +4632,9 @@ - - - + + + @@ -4571,9 +4642,9 @@ - - - + + + @@ -4581,9 +4652,9 @@ - - - + + + @@ -4623,9 +4694,6 @@ - - - @@ -4634,13 +4702,21 @@ - - - + + + + + + + + + + + @@ -4676,9 +4752,9 @@ - - - + + + @@ -4794,48 +4870,41 @@ - - - - - - + + + - - - - + + - - - - + + - - - + + + - - - + + + - - - + + + - - + + - - - + + + - - + + @@ -4843,9 +4912,9 @@ - - - + + + @@ -4853,9 +4922,9 @@ - - - + + + @@ -4863,9 +4932,9 @@ - - - + + + @@ -4945,6 +5014,11 @@ + + + + + @@ -5169,6 +5243,11 @@ + + + + + diff --git a/android/lib/map/build.gradle.kts b/android/lib/map/build.gradle.kts index 7ca04c16da8c..df7234f50fc1 100644 --- a/android/lib/map/build.gradle.kts +++ b/android/lib/map/build.gradle.kts @@ -1,32 +1,27 @@ plugins { id(Dependencies.Plugin.kotlinAndroidId) id(Dependencies.Plugin.androidLibraryId) + id(Dependencies.Plugin.composeCompiler) version Versions.kotlin } android { namespace = "net.mullvad.mullvadvpn.lib.map" compileSdk = Versions.Android.compileSdkVersion - defaultConfig { - minSdk = Versions.Android.minSdkVersion - } + defaultConfig { minSdk = Versions.Android.minSdkVersion } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = Versions.jvmTarget - } + kotlinOptions { jvmTarget = Versions.jvmTarget } buildFeatures { compose = true buildConfig = true } - composeOptions { kotlinCompilerExtensionVersion = Versions.kotlinCompilerExtensionVersion } - lint { lintConfig = file("${rootProject.projectDir}/config/lint.xml") abortOnError = true @@ -36,7 +31,7 @@ android { dependencies { - //Model + // Model implementation(project(Dependencies.Mullvad.modelLib)) implementation(Dependencies.Compose.ui) diff --git a/android/lib/theme/build.gradle.kts b/android/lib/theme/build.gradle.kts index dbf80a3b9820..33f094fba487 100644 --- a/android/lib/theme/build.gradle.kts +++ b/android/lib/theme/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id(Dependencies.Plugin.androidLibraryId) id(Dependencies.Plugin.kotlinAndroidId) + id(Dependencies.Plugin.composeCompiler) version Versions.kotlin } android { @@ -11,8 +12,6 @@ android { buildFeatures { compose = true } - composeOptions { kotlinCompilerExtensionVersion = Versions.kotlinCompilerExtensionVersion } - compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17