Compose sample app#1056
Conversation
There was a problem hiding this comment.
I copied this from the existing MagicWeather to be able to run it with both Google and Amazon.
There was a problem hiding this comment.
I tried to do this in a way that it could be extracted to a library in the future if needed 😏 . Made an assumption by using architecture component view models, which we could potentially remove, but this is how I imagine a view that can just be used by anyone using jetpack compose. cc @RevenueCat/coresdk
There was a problem hiding this comment.
asks ChatGPT what "architecture component view models" means
There was a problem hiding this comment.
All this is mostly copied from the existing MagicWeather
Codecov Report
@@ Coverage Diff @@
## main #1056 +/- ##
=======================================
Coverage 85.86% 85.86%
=======================================
Files 179 179
Lines 6362 6362
Branches 876 876
=======================================
Hits 5463 5463
Misses 557 557
Partials 342 342 |
There was a problem hiding this comment.
Ideally we would improve the UI to also display free trials and what not. But as a sample app it's functional for now.,
There was a problem hiding this comment.
we can always iterate as we feel the need
There was a problem hiding this comment.
This are the default app icons for a template app. Could customize them but don't want to dedicate more time to a sample app
There was a problem hiding this comment.
this is pretty much exactly like SwiftUI, love it
There was a problem hiding this comment.
asks ChatGPT what "architecture component view models" means
There was a problem hiding this comment.
hard for me to convey how much I love this ❤️
There was a problem hiding this comment.
we can always iterate as we feel the need
There was a problem hiding this comment.
Not a blocker, but do you think there's a way we can remove the number of parameters of this function?
There was a problem hiding this comment.
Well, thinking about it, we definitely should add a listener of some sort, instead of adding all those callbacks. Might do that in a different PR. That would join 4 parameters into 1. As for the others, I think they need to be there, but we can think of ways to refactor.
There was a problem hiding this comment.
We could add another one here that gets the active entitlements by doing active.keys
There was a problem hiding this comment.
Well, I think that makes sense, but we are currently not displaying the active entitlements anywhere, only whether a user has any active entitlements or not.
We could add a place where it displays the active entitlements, and checks that it has the correct one instead, as we do in the current magic weather, this just seemed a simpler approach, but I'm ok changing it. Thoughts? @vegaro
There was a problem hiding this comment.
we can use the gradle library catalogs, but we can do it in another PR
There was a problem hiding this comment.
Yeah I thought about that. Going to make that change in another PR, so we are using catalogs everywhere
6a26294 to
8ceb316
Compare
**This is an automatic release.** ### Bugfixes * Default customer info schema version to latest known by SDK (#1080) via Toni Rico (@tonidero) * Handle other diagnostics-related exceptions (#1076) via Toni Rico (@tonidero) * Return error in queryPurchases if error connecting to billing client (#1072) via Toni Rico (@tonidero) ### Other Changes * Fix offline entitlements integration tests (#1085) via Toni Rico (@tonidero) * Add defaultsRelease variant tests run configuration (#1074) via Toni Rico (@tonidero) * Compose sample app: move to gradle catalog (#1081) via Toni Rico (@tonidero) * Compose sample app: automate builds (#1082) via Toni Rico (@tonidero) * Compose sample app (#1056) via Toni Rico (@tonidero) * Migrate to Gradle version catalog (#1059) via Cesar de la Vega (@vegaro) * Trusted entitlements: Add logs with verification mode (#1067) via Toni Rico (@tonidero) * Sync pending purchases before getting customer info (#1073) via Toni Rico (@tonidero) * Refactor syncing pending transactions logic out of `Purchases` (#1058) via Toni Rico (@tonidero) * Refactor CustomerInfo listener and cache logic into CustomerInfoUpdater (#1052) via Toni Rico (@tonidero) * Trusted entitlements: Add integration tests (#1071) via Toni Rico (@tonidero) * Trusted entitlements: Add internal mechanism to force signing errors for tests (#1070) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Description
This PR adds a new sample app
MagicWeatherCompose, very similar to the existingMagicWeatherbut using Jetpack Compose. Many things are copied over fromMagicWeatherincluding the actual weather change logic and the purchase SDK setup. It does change how we interact with the SDK from there.To better understand the code, this app has 2 main screens:
The
Mainscreen has a bottom navigation view and has 2 subscreens,WeatherandUser.This can be a better sample for more modern android development. Things remaining:
getCustomerInfo, so we can use it to listen to the customer info listener.device-2023-06-07-170206.mp4