Skip to content

Fixes double padding in PaywallActivity on Android 15+ when edgeToEdge parameter is false#3227

Merged
vegaro merged 3 commits into
mainfrom
cesar/pw-1128-fix-double-padding-in-paywallactivity-on-android-15
Mar 13, 2026
Merged

Fixes double padding in PaywallActivity on Android 15+ when edgeToEdge parameter is false#3227
vegaro merged 3 commits into
mainfrom
cesar/pw-1128-fix-double-padding-in-paywallactivity-on-android-15

Conversation

@vegaro

@vegaro vegaro commented Mar 12, 2026

Copy link
Copy Markdown
Member

The Paywall composable has always handled its own window insets internally, legacy templates use StatusBarSpacer() and V2 component paywalls use windowInsetsPadding(systemBars) in StackComponentView. The Scaffold in PaywallActivity was also applying inset-based paddingValues, doubling the insets.

This was originally identified and fixed in 9371b6b, which skipped the Scaffold padding on Android 15+. However, d1904a8 replaced that API-level guard with the edgeToEdge flag check, re-introducing the double padding on Android 15+ when edgeToEdge = false.

We have to:

  • Set contentWindowInsets = WindowInsets(0, 0, 0, 0) on the Scaffold so it doesn't add inset padding. The Paywall composable is the single source of truth for inset handling
  • Remove the conditional padding(paddingValues) that was causing the duplication
Scenario Before (bug) After (fix)
14, edgeToEdge = false image image
14, edgeToEdge = true image image
16, edgeToEdge = false image image
16, edgeToEdge = true image image
15, windowOptOutEdgeToEdgeEnforcement = true, edgeToEdge = false image image
15, windowOptOutEdgeToEdgeEnforcement = true, edgeToEdge = true image image
15, windowOptOutEdgeToEdgeEnforcement = false, edgeToEdge = false image image
15, windowOptOutEdgeToEdgeEnforcement = false, edgeToEdge = true image image

Note

Medium Risk
Adjusts window-inset handling for the paywall activity, which can change visual layout across Android versions (especially 15+). Scoped to UI composition/inset behavior with no data or security impact.

Overview
Fixes double window-inset padding in PaywallActivity by making the Scaffold apply no insets (contentWindowInsets = WindowInsets(0,0,0,0)) and removing the conditional padding(paddingValues) so Paywall is the single source of truth for inset handling.

Updates the edgeToEdge parameter documentation in PaywallActivityLauncher and PaywallActivityLaunchOptions to reflect Android 15 default edge-to-edge behavior and Android 16+ enforcement.

Written by Cursor Bugbot for commit b7b4807. This will update automatically on new commits. Configure here.

@vegaro vegaro requested a review from a team as a code owner March 12, 2026 12:39
@vegaro vegaro added the pr:fix A bug fix label Mar 12, 2026
@vegaro

vegaro commented Mar 12, 2026

Copy link
Copy Markdown
Member Author

actually, I think "15+, edgeToEdge = false" is wrong. It's doing edge to edge after the fix 🤔

@vegaro vegaro marked this pull request as draft March 12, 2026 12:44
@vegaro vegaro marked this pull request as ready for review March 12, 2026 13:57
@vegaro vegaro requested a review from tonidero March 12, 2026 13:57

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment about the docs... But I think it makes sense!

* Only available for original template paywalls. Ignored for v2 Paywalls.
* @param edgeToEdge Whether to display the paywall in edge-to-edge mode.
* Default is true for Android 15+, false otherwise.
* On Android 15+, edge-to-edge is enforced by the system regardless of this setting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not completely right... On android 15, it's enabled by default, but not enforced. On android 16 it is enforced (same for the other comments).

I guess it's true that with the change here, even if a user disables edge to edge in android 15, however, it wouldn't make it "not edge-to-edge" though... so maybe you're referring to that? But this would be misleading since it's not enforced by the system I guess.

@vegaro vegaro enabled auto-merge March 13, 2026 11:47
@vegaro vegaro added this pull request to the merge queue Mar 13, 2026
@codecov

codecov Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.19%. Comparing base (56d8a66) to head (b7b4807).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3227   +/-   ##
=======================================
  Coverage   79.19%   79.19%           
=======================================
  Files         356      356           
  Lines       14272    14272           
  Branches     1945     1945           
=======================================
  Hits        11302    11302           
  Misses       2165     2165           
  Partials      805      805           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Merged via the queue into main with commit dec91ef Mar 13, 2026
29 checks passed
@vegaro vegaro deleted the cesar/pw-1128-fix-double-padding-in-paywallactivity-on-android-15 branch March 13, 2026 12:07
github-merge-queue Bot pushed a commit that referenced this pull request Mar 16, 2026
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* Fix & Standardize Galaxy Date Parsing Edge Cases (#3216) via Will
Taylor (@fire-at-will)
* Fix addSuccessfullyPostedToken for new purchases in
PostPendingTransactionsHelper (#3239) via Facundo Menzella
(@facumenzella)
* [Galaxy]: Fix race condition when fetching Galaxy products (#3213) via
Will Taylor (@fire-at-will)
* Fixes double padding in PaywallActivity on Android 15+ when
`edgeToEdge` parameter is false (#3227) via Cesar de la Vega (@vegaro)

## RevenueCatUI SDK
### 🐞 Bugfixes
* Fix bold text not rendering in Markdown lists (#3228) via Cesar de la
Vega (@vegaro)
* Fix: Clear in-memory offerings cache on locale override to prevent
stale paywall data (#3225) via Antonio Pallares (@ajpallares)
### Paywallv2
#### ✨ New Features
* Feature: Update default paywall (#3133) via Jacob Rakidzich
(@JZDesign)
#### 🐞 Bugfixes
* Fix V2 paywall safe area in landscape mode (#3221) via Cesar de la
Vega (@vegaro)

### 🔄 Other Changes
* Run integration tests on all branches (#3242) via Toni Rico
(@tonidero)
* Migrate Firebase Test Lab jobs to CircleCI emulators (#3238) via Toni
Rico (@tonidero)
* Run metalava on galaxy module in test-galaxy job (#3235) via Will
Taylor (@fire-at-will)
* Add offering_id to custom paywall impression event (#3230) via Rick
(@rickvdl)
* Cache isAutoRenewing to detect subscription changes without
syncPurchases (#3198) via Facundo Menzella (@facumenzella)
* Bump fastlane-plugin-revenuecat_internal from `e146447` to `3e8c384`
(#3233) via dependabot[bot] (@dependabot[bot])

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release housekeeping: version string bumps and
documentation/deployment path updates with no functional runtime logic
changes beyond the exposed version constant.
> 
> **Overview**
> Publishes the `9.26.0` release by removing `-SNAPSHOT` across
build/version metadata (root `VERSION_NAME`, `.version`,
`Config.frameworkVersion`, and sample/test app dependency pins).
> 
> Updates release documentation artifacts by adding the `9.26.0` notes
to `CHANGELOG.md`/`CHANGELOG.latest.md`, switching docs deployment in
CircleCI to sync `docs/9.26.0` to S3, and updating `docs/index.html` to
redirect to the new version.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0a30a45. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants