[Android] 4.0.0-alpha.3
Pre-releaseBreaking changes
Checkout failures use a flat error model
Exception subclasses were replaced by CheckoutException with a stable CheckoutErrorCode:
-when (error) {
- is HttpException -> retry(error.statusCode)
- is CheckoutExpiredException -> recreateCart()
-}
+when (error.code) {
+ CheckoutErrorCode.HTTP_ERROR -> retry(error.httpStatusCode)
+ CheckoutErrorCode.CART_EXPIRED -> recreateCart()
+ else -> report(error)
+}Cancellation callbacks renamed to dismissal
-override fun onCheckoutCanceled() = closeCheckout()
+override fun onCheckoutDismissed() = closeCheckout()Presentation builders similarly replace onCancel with onDismiss.
Color scheme configuration replaced by appearance
ShopifyCheckoutKit.configure {
- it.colorScheme = ColorScheme.Automatic()
+ it.appearance = CheckoutAppearance.App(ColorScheme.Automatic())
}Use CheckoutAppearance.Storefront() for storefront branding. Storefront appearance is now the default.
Direct protocol handlers receive envelopes
Direct EmbeddedCheckoutProtocol handlers must read typed payloads from request and notification envelopes. The Checkout Kit facade continues projecting common checkout events.
Additive changes
Embeddable checkout view
Hosts can now create a ShopifyCheckout view and own its presentation container:
+val checkout = ShopifyCheckout(
+ context,
+ checkoutUrl,
+ listener,
+)
+container.addView(checkout)Call destroy() when permanently removing the view.
Bottom-sheet configuration
Configuration.sheet adds snap points, maximum width, corner radius, title alignment, dismissal options, close-icon styling, scrim color, and an optional drag handle.
Observable preload state
preload now returns a CheckoutPreload handle with Idle, Loading, Ready, Expired, and Failed states.
Runtime title and logging controls
Configuration now supports a runtime title; LogLevel.NONE disables SDK logging.
Behavior changes
- Checkout is presented in a customizable bottom sheet.
- Selected transient main-frame navigation failures are retried once.
- Web messages use
WebMessageListenerwhen the installed WebView supports it. - Preloaded WebViews can be reused after dismissal.
What's Changed
- Flatten Android checkout failure type by @kiftio in #536
- [Android] Add preload state observability by @markmur in #451
- Flatten webview hierarchy by @kiftio in #497
- [Android][Swift] Rename oncancel to ondismiss in swift and android by @kiftio in #482
- Retry for certain transient network errors for main frame by @kiftio in #496
- [Android] Set max-width on sheet by @kiftio in #489
- [Android] Adds title to the configure {} method for runtime changes by @kieran-osgood-shopify in #479
- [Android] Extract and expose ShopifyCheckout view by @kiftio in #456
- [Android] remove color-scheme from automatic by @kiftio in #469
- [Android] Replace JavascriptInterface with WebMessageListener by @kiftio in #424
- [Android] Add NONE log level by @markmur in #442
- [Android] Allow sheet customization by @kiftio in #382
- [Android] Render checkout in bottom sheet by @kiftio in #381
- Derive Android checkout branding from color scheme by @tiagocandido in #406
- Ensure contrast in 3 button nav by @kiftio in #422
- Move windowOpen to protocol by @markmur in #386
- Make Kotlin protocol agnostic by @markmur in #365
Full Changelog: android/4.0.0-alpha.2...android/4.0.0-alpha.3