How RevenueCat Paywalls Handle Android Folding, Resizing and Selection State
Brief
RevenueCat’s Android paywalls use window size classes and paywall-specific bounds for different layout decisions. The article also identifies a selection-reset scenario tied to dynamically recreated Compose color schemes.
Sizing and layout
- Window size classes describe the app window; numeric window rules use the space actually given to the paywall, which can differ in a dialog or pane.
- Size-class overrides accumulate: wider classes also match narrower-class conditions, and later declared overrides take precedence.
- Window rules shipped in SDK 10.21.0. Minimum and maximum sizes for Fill layouts shipped in 10.25.0.
Selection across window changes
- The SDK stores loaded paywall state, including the selected package, in a ViewModel. The selection generally survives activity recreation, but can reset if a recreated Compose theme produces a new color scheme and the ViewModel rebuilds its state.
- In SDK 10.21.0 through 11.0.0, a package hidden by a window rule could remain selected and purchasable. Reconciliation shipped in 11.0.1.
- When a selected package becomes unavailable, the resolver can choose another package; it does not switch back automatically when the original package reappears.
Theme-related reset and testing
- The article reports that an embedded paywall can reset selection when a Compose theme creates a new dynamic ColorScheme during composition; comparing color values instead of object references kept the selection in the reported tests.
- The article includes an unresolved fix-status placeholder, so it does not state a fix release or PR.
- For fold and resize testing, select a non-default package first and check the purchase button afterward. The article describes using a Pixel Fold emulator to switch between 411 dp and 841 dp widths.
Generated by AI from the original article. Check the source for full details.