Migrate from Android SDK v1 to v2

Learn what you need to change to migrate from v1 to v2 of the Android SDK.

Migrating from version 1.x.x of the SDK

If you're migrating to version 2.x.x from version 1.x.x of the SDK, you need to update your project for the following changes.

If you were processing a payment with a Jetpack Compose integration please remove the following code from your activity hosting. This code was required in previous versions, but will now cause user interface issues.

WindowCompat.setDecorFitsSystemWindows(window, false) 
 @Suppress("DEPRECATION")
 window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)

There are some naming changes. The following classes and functions have been moved.

Old locationNew location
com.truelayer.payments.ui.models.PaymentContextcom.truelayer.payments.ui.screens.processor.ProcessorContext.PaymentContext
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorResultcom.truelayer.payments.ui.screens.processor.ProcessorResult
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorActivityContractcom.truelayer.payments.ui.screens.processor.ProcessorActivityContract
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorActivitycom.truelayer.payments.ui.screens.processor.ProcessorActivity
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorcom.truelayer.payments.ui.screens.processor.Processor
com.truelayer.payments.ui.models.PaymentUseCasecom.truelayer.payments.ui.screens.processor.PaymentUseCase
com.truelayer.payments.ui.models.PaymentContext.Preferencescom.truelayer.payments.ui.screens.processor.ProcessorContext.PaymentPreferences
PaymentContext.paymentIdPaymentContext.id

The SDK now uses Kotlin version 1.7.0, with a minimum Android SDK version 24.

The SDK has removed its dependency on com.google.android.material:material, replacing it with androidx.compose.material3:material3.

The dependency on com.google.accompanist:accompanist-insets has been removed.