Shopify / checkout-sheet-kit-android

Shopify’s Checkout Sheet Kit makes it simple to perform a checkout inside your Android app.
MIT License
12 stars 3 forks source link

Update sample to call preload at a more appropriate time #122

Closed kiftio closed 1 month ago

kiftio commented 3 months ago

What changes are you making?

The README states that preload() should be used responsibly as it results in background network requests and additional CPU/memory utilization for the client. And that it should only be used when there is a high likelihood that the buyer will soon request to checkout.

But the sample apps call it on each cart mutation / add to cart, which is more frequently than it needs to be called.

This updates the sample to follow the README advice, and only call preload() when a customer lands on the cart page.


It also updates an incorrect line r.e. min JDK version in the README

How to test

Click around in the sample

Before you merge

[!IMPORTANT]


Checklist for releasing a new version - [ ] I have bumped the version number in the [`build.gradle` file](https://github.com/Shopify/checkout-kit-android/blob/main/lib/build.gradle#L17) - [ ] I have added a [Changelog](https://github.com/shopify/checkout-sheet-kit-android/blob/main/CHANGELOG.md) entry. - [ ] I have updated the versions in the [README.md](https://github.com/shopify/checkout-sheet-kit-android/blob/main/README.md) for both Gradle and Maven.

[!TIP] See the Contributing documentation for instructions on how to publish a new version of the library.