Skip to content

Commit

Permalink
Bump to K2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Jun 25, 2024
1 parent a2150d2 commit af62cd1
Show file tree
Hide file tree
Showing 71 changed files with 769 additions and 523 deletions.
5 changes: 3 additions & 2 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,8 +128,6 @@ android {
buildConfig = true
}

composeOptions { kotlinCompilerExtensionVersion = Versions.kotlinCompilerExtensionVersion }

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -244,6 +243,8 @@ android {
project.tasks.assemble.dependsOn("ensureValidVersionCode")
}

composeCompiler { enableStrongSkippingMode = true }

androidComponents {
beforeVariants { variantBuilder ->
variantBuilder.enable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +18,7 @@ private fun PreviewApiAccessMethodInfoDialog() {
AppTheme { ApiAccessMethodInfoDialog(EmptyDestinationsNavigator) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun ApiAccessMethodInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun Changelog(navController: NavController, changeLog: Changelog) {
val viewModel = koinViewModel<ChangelogViewModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun ContentBlockersInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ 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
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
Expand Down Expand Up @@ -55,7 +56,7 @@ private fun PreviewCreateCustomListDialogError() {
}

@Composable
@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
fun CreateCustomList(
navigator: DestinationsNavigator,
backNavigator: ResultBackNavigator<Created>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +17,7 @@ private fun PreviewCustomDnsInfoDialog() {
CustomDnsInfoDialog(EmptyDestinationsNavigator)
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun CustomDnsInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,7 +25,7 @@ private fun PreviewDeleteApiAccessMethodConfirmationDialog() {
}

@Composable
@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
fun DeleteApiAccessMethodConfirmation(
navigator: ResultBackNavigator<Boolean>,
apiAccessMethodId: ApiAccessMethodId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +33,7 @@ private fun PreviewRemoveDeviceConfirmationDialog() {
}

@Composable
@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
fun DeleteCustomList(
navigator: ResultBackNavigator<Deleted>,
customListId: CustomListId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun DeviceNameInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun DiscardChangesDialog(resultBackNavigator: ResultBackNavigator<Boolean>) {
AlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,7 +52,7 @@ private fun PreviewDnsDialogEditAllowLanDisabled() {
AppTheme { DnsDialog(DnsDialogViewState("192.168.1.1", null, true, false, 0), {}, {}, {}, {}) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun DnsDialog(
resultNavigator: ResultBackNavigator<DnsDialogResult>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,7 +44,7 @@ private fun PreviewEditCustomListNameDialog() {
}

@Composable
@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
fun EditCustomListName(
backNavigator: ResultBackNavigator<Renamed>,
customListId: CustomListId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +18,7 @@ private fun PreviewLocalNetworkSharingInfoDialog() {
LocalNetworkSharingInfoDialog(EmptyDestinationsNavigator)
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun LocalNetworkSharingInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +17,7 @@ private fun PreviewMalwareInfoDialog() {
MalwareInfoDialog(EmptyDestinationsNavigator)
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun MalwareInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,7 +42,7 @@ private fun PreviewMtuDialog() {
AppTheme { MtuDialog(mtuInitial = Mtu(1234), EmptyResultBackNavigator()) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun MtuDialog(mtuInitial: Mtu?, navigator: ResultBackNavigator<Boolean>) {
val viewModel = koinViewModel<MtuDialogViewModel>(parameters = { parametersOf(mtuInitial) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +17,7 @@ private fun PreviewObfuscationInfoDialog() {
ObfuscationInfoDialog(EmptyDestinationsNavigator)
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun ObfuscationInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,7 +17,7 @@ private fun PreviewQuantumResistanceInfoDialog() {
QuantumResistanceInfoDialog(EmptyDestinationsNavigator)
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun QuantumResistanceInfoDialog(navigator: DestinationsNavigator) {
InfoDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -104,7 +105,7 @@ private fun PreviewRedeemVoucherDialogSuccess() {
}
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun RedeemVoucher(resultBackNavigator: ResultBackNavigator<Boolean>) {
val vm = koinViewModel<VoucherDialogViewModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,7 +40,7 @@ private fun PreviewRemoveDeviceConfirmationDialog(
AppTheme { RemoveDeviceConfirmationDialog(EmptyResultBackNavigator(), device = device) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun RemoveDeviceConfirmationDialog(navigator: ResultBackNavigator<DeviceId>, device: Device) {
AlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +30,7 @@ private fun PreviewReportProblemNoEmailDialog() {
AppTheme { ReportProblemNoEmailDialog(EmptyResultBackNavigator()) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun ReportProblemNoEmailDialog(resultBackNavigator: ResultBackNavigator<Boolean>) {
AlertDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,7 +31,7 @@ private fun PreviewResetServerIpOverridesConfirmationDialog() {
AppTheme { ResetServerIpOverridesConfirmationDialog({}, {}) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun ResetServerIpOverridesConfirmation(resultBackNavigator: ResultBackNavigator<Boolean>) {
val vm: ResetServerIpOverridesConfirmationViewModel = koinViewModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,7 +46,7 @@ private fun PreviewSaveApiAccessMethodDialog(
AppTheme { SaveApiAccessMethodDialog(state = state) }
}

@Destination(style = DestinationStyle.Dialog::class)
@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
@Composable
fun SaveApiAccessMethod(
backNavigator: ResultBackNavigator<Boolean>,
Expand Down
Loading

0 comments on commit af62cd1

Please sign in to comment.