Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ updates:

# Android sample app
- package-ecosystem: gradle
directory: "/platforms/android/samples/MobileBuyIntegration"
directory: "/platforms/android/samples/CheckoutKitAndroidDemo"
schedule:
interval: weekly
open-pull-requests-limit: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Build Sample App
run: ./gradlew assembleDebug
working-directory: platforms/android/samples/MobileBuyIntegration
working-directory: platforms/android/samples/CheckoutKitAndroidDemo

lint:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions platforms/android/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Shopify Checkout Kit for Android is a published AAR library (`com.shopify:checko
Two modules matter:

- **`lib/`** — the library itself. Everything here ships to consumers.
- **`samples/MobileBuyIntegration/`** — a demo app that consumes `lib/` as a source dependency. Changes here never reach consumers; this module is for internal testing and developer onboarding.
- **`samples/CheckoutKitAndroidDemo/`** — a demo app that consumes `lib/` as a source dependency. Changes here never reach consumers; this module is for internal testing and developer onboarding.

The sample is a separate Gradle composite (`samples/MobileBuyIntegration/settings.gradle`) that includes `:lib` from `../../lib`. The sample's `gradle.properties` and Gradle wrapper are independent of the root's.
The sample is a separate Gradle composite (`samples/CheckoutKitAndroidDemo/settings.gradle`) that includes `:lib` from `../../lib`. The sample's `gradle.properties` and Gradle wrapper are independent of the root's.

## Where to make changes

Expand Down Expand Up @@ -64,7 +64,7 @@ If `apiCheck` fails and you did *not* intend to change public API, the diff tell
- Lint: `./gradlew detekt lintRelease` (or `dev android lint`)
- Format: `./gradlew detekt --auto-correct` (or `dev android format`)
- Full local verification: `./gradlew :lib:clean :lib:test :lib:detekt :lib:lintRelease :lib:assembleRelease`
- Sample app build (from `samples/MobileBuyIntegration/`): `./gradlew assembleDebug`
- Sample app build (from `samples/CheckoutKitAndroidDemo/`): `./gradlew assembleDebug`

## Consumer requirements

Expand Down
4 changes: 2 additions & 2 deletions platforms/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Checkout Kit opens external HTTPS links, `mailto:`, `tel:`, and custom-scheme li

## Samples

See [samples](samples/README.md). `MobileBuyIntegration` demonstrates an Apollo Kotlin Storefront API cart flow, checkout presentation, typed protocol lifecycle events, file chooser handling, geolocation callbacks, and Customer Account API sign-in.
See [samples](samples/README.md). `CheckoutKitAndroidDemo` demonstrates an Apollo Kotlin Storefront API cart flow, checkout presentation, typed protocol lifecycle events, file chooser handling, geolocation callbacks, and Customer Account API sign-in.

## Contributing

Expand All @@ -330,7 +330,7 @@ cd platforms/android
For sample app changes, run:

```sh
cd platforms/android/samples/MobileBuyIntegration
cd platforms/android/samples/CheckoutKitAndroidDemo
./gradlew build
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MobileBuyIntegration Sample App
# CheckoutKitAndroidDemo Sample App

This sample demonstrates how to integrate Checkout Kit with the Shopify Storefront API using Apollo Kotlin.

Expand All @@ -22,7 +22,7 @@ The sample's cart flow demonstrates the Kotlin-first `ShopifyCheckoutKit.present
The app uses Apollo Kotlin for Storefront API communication. GraphQL operations are defined as `.graphql` files, and Apollo Kotlin's code generation tool produces type-safe Kotlin data classes from them.

```text
MobileBuyIntegration/
CheckoutKitAndroidDemo/
|-- app/
| |-- src/main/graphql/ Source of truth - edit these files
| | |-- schema.graphqls Storefront API schema, downloaded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ if (!storefrontDomain || !accessToken) {
}

android {
namespace = 'com.shopify.checkout_kit_mobile_buy_integration_sample'
namespace = 'com.shopify.checkout_kit_android_demo'
compileSdk = 36

defaultConfig {
applicationId "com.shopify.checkout_kit_mobile_buy_integration_sample"
applicationId "com.shopify.checkoutkit.androiddemo"
minSdk = 28
targetSdk = 36
versionCode = 34
Expand Down Expand Up @@ -157,7 +157,7 @@ dependencies {

apollo {
service("storefront") {
packageName.set("com.shopify.checkout_kit_mobile_buy_integration_sample.graphql")
packageName.set("com.shopify.checkout_kit_android_demo.graphql")
srcDir("src/main/graphql")
plugin("com.apollographql.cache:normalized-cache-apollo-compiler-plugin:$apollo_cache_version")
pluginArgument("com.apollographql.cache.packageName", packageName.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</queries>

<application
android:name=".MobileBuyIntegration"
android:name=".CheckoutKitAndroidDemo"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:enableOnBackInvokedCallback="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample
package com.shopify.checkout_kit_android_demo

import android.app.Application
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.di.setupDI
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.withCustomCloseIcon
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.PreferencesManager
import com.shopify.checkout_kit_android_demo.common.di.setupDI
import com.shopify.checkout_kit_android_demo.common.withCustomCloseIcon
import com.shopify.checkout_kit_android_demo.settings.PreferencesManager
import com.shopify.checkoutkit.LogLevel
import com.shopify.checkoutkit.ShopifyCheckoutKit
import kotlinx.coroutines.CoroutineScope
Expand All @@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import org.koin.android.ext.android.get

class MobileBuyIntegration : Application() {
class CheckoutKitAndroidDemo : Application() {

private val applicationScope = CoroutineScope(Job())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample
package com.shopify.checkout_kit_android_demo

import androidx.compose.foundation.Image
import androidx.compose.foundation.isSystemInDarkTheme
Expand Down Expand Up @@ -36,17 +36,17 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.navigation.compose.rememberNavController
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.CartViewModel
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.totalQuantity
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ObserveAsEvents
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.SnackbarController
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.navigation.BottomAppBarWithNavigation
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.navigation.CheckoutKitNavHost
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.navigation.Screen
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ui.theme.CheckoutKitSampleTheme
import com.shopify.checkout_kit_mobile_buy_integration_sample.logs.LogsViewModel
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.SettingsUiState
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.SettingsViewModel
import com.shopify.checkout_kit_android_demo.cart.CartViewModel
import com.shopify.checkout_kit_android_demo.cart.data.totalQuantity
import com.shopify.checkout_kit_android_demo.common.ObserveAsEvents
import com.shopify.checkout_kit_android_demo.common.SnackbarController
import com.shopify.checkout_kit_android_demo.common.navigation.BottomAppBarWithNavigation
import com.shopify.checkout_kit_android_demo.common.navigation.CheckoutKitNavHost
import com.shopify.checkout_kit_android_demo.common.navigation.Screen
import com.shopify.checkout_kit_android_demo.common.ui.theme.CheckoutKitSampleTheme
import com.shopify.checkout_kit_android_demo.logs.LogsViewModel
import com.shopify.checkout_kit_android_demo.settings.SettingsUiState
import com.shopify.checkout_kit_android_demo.settings.SettingsViewModel
import com.shopify.checkoutkit.ColorScheme
import kotlinx.coroutines.launch
import org.koin.androidx.compose.koinViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample
package com.shopify.checkout_kit_android_demo

import android.app.Activity.RESULT_OK
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample
package com.shopify.checkout_kit_android_demo

import android.Manifest
import android.content.pm.PackageManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart
package com.shopify.checkout_kit_android_demo.cart


import androidx.compose.foundation.layout.Arrangement
Expand All @@ -22,14 +22,14 @@ import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.shopify.checkout_kit_mobile_buy_integration_sample.R
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartLine
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.BodySmall
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.MoneyText
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.QuantitySelector
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.RemoteImage
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ui.theme.largeScreenBreakpoint
import com.shopify.checkout_kit_android_demo.R
import com.shopify.checkout_kit_android_demo.cart.data.CartLine
import com.shopify.checkout_kit_android_demo.common.ID
import com.shopify.checkout_kit_android_demo.common.components.BodySmall
import com.shopify.checkout_kit_android_demo.common.components.MoneyText
import com.shopify.checkout_kit_android_demo.common.components.QuantitySelector
import com.shopify.checkout_kit_android_demo.common.components.RemoteImage
import com.shopify.checkout_kit_android_demo.common.ui.theme.largeScreenBreakpoint

@Composable
fun CartItem(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart
package com.shopify.checkout_kit_android_demo.cart

import androidx.activity.ComponentActivity
import androidx.activity.compose.LocalActivity
Expand Down Expand Up @@ -36,18 +36,18 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavController
import com.shopify.checkout_kit_mobile_buy_integration_sample.R
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartAmount
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartLine
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartState
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.BodyMedium
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.BodySmall
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.Header2
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.MoneyText
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.components.ProgressIndicator
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ui.theme.horizontalPadding
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ui.theme.verticalPadding
import com.shopify.checkout_kit_android_demo.R
import com.shopify.checkout_kit_android_demo.cart.data.CartAmount
import com.shopify.checkout_kit_android_demo.cart.data.CartLine
import com.shopify.checkout_kit_android_demo.cart.data.CartState
import com.shopify.checkout_kit_android_demo.common.ID
import com.shopify.checkout_kit_android_demo.common.components.BodyMedium
import com.shopify.checkout_kit_android_demo.common.components.BodySmall
import com.shopify.checkout_kit_android_demo.common.components.Header2
import com.shopify.checkout_kit_android_demo.common.components.MoneyText
import com.shopify.checkout_kit_android_demo.common.components.ProgressIndicator
import com.shopify.checkout_kit_android_demo.common.ui.theme.horizontalPadding
import com.shopify.checkout_kit_android_demo.common.ui.theme.verticalPadding

@Composable
fun CartView(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart
package com.shopify.checkout_kit_android_demo.cart

import android.content.ActivityNotFoundException
import android.widget.Toast
Expand All @@ -7,18 +7,18 @@ import androidx.browser.customtabs.CustomTabsIntent
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.navigation.NavController
import com.shopify.checkout_kit_mobile_buy_integration_sample.MainActivity
import com.shopify.checkout_kit_mobile_buy_integration_sample.R
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartRepository
import com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data.CartState
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.SnackbarController
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.SnackbarEvent
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.logs.Logger
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.navigation.Screen
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.PreferencesManager
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.authentication.data.CustomerRepository
import com.shopify.checkout_kit_mobile_buy_integration_sample.settings.data.WindowOpenHandler
import com.shopify.checkout_kit_android_demo.MainActivity
import com.shopify.checkout_kit_android_demo.R
import com.shopify.checkout_kit_android_demo.cart.data.CartRepository
import com.shopify.checkout_kit_android_demo.cart.data.CartState
import com.shopify.checkout_kit_android_demo.common.ID
import com.shopify.checkout_kit_android_demo.common.SnackbarController
import com.shopify.checkout_kit_android_demo.common.SnackbarEvent
import com.shopify.checkout_kit_android_demo.common.logs.Logger
import com.shopify.checkout_kit_android_demo.common.navigation.Screen
import com.shopify.checkout_kit_android_demo.settings.PreferencesManager
import com.shopify.checkout_kit_android_demo.settings.authentication.data.CustomerRepository
import com.shopify.checkout_kit_android_demo.settings.data.WindowOpenHandler
import com.shopify.checkoutkit.Checkout
import com.shopify.checkoutkit.CheckoutProtocol
import com.shopify.checkoutkit.CheckoutException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data
package com.shopify.checkout_kit_android_demo.cart.data

import com.apollographql.apollo.api.Optional
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.client.StorefrontApiClient
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.type.CartBuyerIdentityInput
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.type.CartInput
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.type.CartLineInput
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.type.CartLineUpdateInput
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.type.CountryCode
import com.shopify.checkout_kit_android_demo.common.ID
import com.shopify.checkout_kit_android_demo.common.client.StorefrontApiClient
import com.shopify.checkout_kit_android_demo.graphql.type.CartBuyerIdentityInput
import com.shopify.checkout_kit_android_demo.graphql.type.CartInput
import com.shopify.checkout_kit_android_demo.graphql.type.CartLineInput
import com.shopify.checkout_kit_android_demo.graphql.type.CartLineUpdateInput
import com.shopify.checkout_kit_android_demo.graphql.type.CountryCode
import timber.log.Timber

class CartRepository(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data
package com.shopify.checkout_kit_android_demo.cart.data

import androidx.compose.runtime.Stable
import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_android_demo.common.ID

sealed class CartState {
data object Empty : CartState()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.shopify.checkout_kit_android_demo.cart.data

import com.apollographql.apollo.api.Optional
import com.shopify.checkout_kit_android_demo.BuildConfig
import com.shopify.checkout_kit_android_demo.graphql.type.CartBuyerIdentityInput
import com.shopify.checkout_kit_android_demo.graphql.type.CountryCode

object DemoBuyerIdentity {
internal val value = CartBuyerIdentityInput(
email = Optional.present(BuildConfig.prefillEmail),
countryCode = Optional.present(CountryCode.CA),
phone = Optional.present(BuildConfig.prefillPhone),
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.cart.data
package com.shopify.checkout_kit_android_demo.cart.data

import com.shopify.checkout_kit_mobile_buy_integration_sample.common.ID
import com.shopify.checkout_kit_mobile_buy_integration_sample.graphql.fragment.CartFragment
import com.shopify.checkout_kit_android_demo.common.ID
import com.shopify.checkout_kit_android_demo.graphql.fragment.CartFragment

internal fun CartFragment.toLocal(): CartState.Cart {
return CartState.Cart(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.common
package com.shopify.checkout_kit_android_demo.common

import com.shopify.checkout_kit_mobile_buy_integration_sample.R
import com.shopify.checkout_kit_android_demo.R
import com.shopify.checkoutkit.Color
import com.shopify.checkoutkit.ColorScheme

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.shopify.checkout_kit_android_demo.common

data class ID(val id: String)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shopify.checkout_kit_mobile_buy_integration_sample.common
package com.shopify.checkout_kit_android_demo.common

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down
Loading
Loading