Skip to content

Update compileSdk and targetSdk to 36#22695

Merged
nbradbury merged 12 commits intotrunkfrom
issue/compileSdk36
Mar 17, 2026
Merged

Update compileSdk and targetSdk to 36#22695
nbradbury merged 12 commits intotrunkfrom
issue/compileSdk36

Conversation

@nbradbury
Copy link
Copy Markdown
Contributor

@nbradbury nbradbury commented Mar 16, 2026

Description

Updates compileSdkVersion and targetSdkVersion from 35 to 36 and addresses all resulting compilation errors, deprecation warnings, and behavioral changes:

  • Edge-to-edge enforcement: SDK 36 enforces edge-to-edge by default. Removed the NoEdgeToEdge opt-out from the manifest and added EdgeToEdgeActivityLifecycleCallbacks to apply inset padding to third-party activities (e.g. Zendesk) that don't extend BaseAppCompatActivity.
  • IME inset handling: Added WindowInsetsCompat.Type.ime() to both BaseAppCompatActivity and EdgeToEdgeActivityLifecycleCallbacks so the keyboard doesn't overlap editors — replacing the old adjustResize behavior that edge-to-edge disables.
  • Zendesk status bar fix: Set windowLightStatusBar to true in the day Zendesk style so status bar icons are visible (dark on light background) now that statusBarColor is ignored.
  • Deprecation fixes (Kotlin): Replaced deprecated Configuration.locale with ConfigurationCompat.getLocales() in LocaleManager, updated PrefMainSwitchToolbarView and NotificationsSettingsActivity for SDK 36 API changes.
  • Deprecation fixes (Java): Updated CommentDetailFragment, MediaPickerUtils, and GutenbergUtils to use non-deprecated alternatives.
  • announceForAccessibility suppressions: Added @Suppress("DEPRECATION") to all call sites (replacement with live regions is a separate effort).

Testing instructions

Build verification:

  1. Build the app: ./gradlew assembleWordPressDebug
  • Verify build succeeds with no errors

Edge-to-edge on SDK 36:

  1. Run the app on an API 36 emulator or device
  2. Navigate through the app — check the main screen, reader, stats, posts
  • Verify content is not obscured by status bar, navigation bar, or display cutout
  1. Open a Zendesk help screen (Help & Support)
  • Verify Zendesk screens also have correct inset padding
  • Verify the status bar is visible in both light and dark modes

Keyboard overlap:

  1. Run the app on an API 35 emulator or device
  2. Make sure the keyboard overlap issues haven't re-appeared

General regression:

  1. Test basic flows: login, browse reader, view stats, create/edit a post
  • Verify no visual regressions or crashes

nbradbury and others added 6 commits March 16, 2026 13:39
- Fix onCheckedChanged signature: CompoundButton parameter is now
  non-null in SDK 36 (PrefMainSwitchToolbarView, its interface,
  and NotificationsSettingsActivity)
- Suppress deprecated announceForAccessibility() calls across 11
  files (13 call sites) — replacement with live regions is a
  separate effort
- Replace deprecated Locale constructors with Locale.Builder in
  LocaleManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The windowOptOutEdgeToEdgeEnforcement attribute is deprecated and
ignored on SDK 36, so the NoEdgeToEdge style no longer prevents
edge-to-edge. Instead, let the 6 affected activities go through
BaseAppCompatActivity.applyInsetOffsets() by removing them from the
exclusion list, and add ActivityLifecycleCallbacks to handle insets
for Zendesk activities that don't extend BaseAppCompatActivity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Suppress announceForAccessibility deprecation in CommentDetailFragment,
WPMainActivity, and MediaPickerUtils. Replace deprecated Locale
constructor with Locale.Builder in GutenbergUtils.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use getLocales() and setLocales() instead of the deprecated
Configuration.locale field and setLocale() method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Mar 16, 2026

3 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ Class EdgeToEdgeActivityLifecycleCallbacks is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 16, 2026

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressRelease/base_manifest.txt	2026-03-16 21:02:30.298339034 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressRelease/head_manifest.txt	2026-03-16 21:02:36.308353302 +0000
@@ -7,7 +7,7 @@
 
     <uses-sdk
         android:minSdkVersion="26"
-        android:targetSdkVersion="35" />
+        android:targetSdkVersion="36" />
 
     <permission
         android:name="org.wordpress.android.permission.DISABLE_NOTIFICATIONS"
@@ -311,7 +311,7 @@
             android:theme="@style/WordPress.ZenDesk" />
         <activity
             android:name="org.wordpress.android.support.SupportWebViewActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge" /> <!-- empty title -->
+            android:theme="@style/WordPress.NoActionBar" /> <!-- empty title -->
         <!-- Preferences activities -->
         <activity
             android:name="org.wordpress.android.ui.about.UnifiedAboutActivity"
@@ -376,7 +376,7 @@
         <activity
             android:name="org.wordpress.android.ui.comments.CommentsDetailActivity"
             android:label="@string/comments"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="adjustResize" />
         <activity
             android:name="org.wordpress.android.ui.comments.unified.UnifiedCommentsDetailsActivity"
@@ -387,7 +387,7 @@
             android:name="org.wordpress.android.ui.posts.EditPostActivity"
             android:configChanges="locale|orientation|screenSize"
             android:exported="false"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="stateHidden|adjustResize" >
             <meta-data
                 android:name="android.support.PARENT_ACTIVITY"
@@ -844,7 +844,7 @@
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderCommentListActivity"
             android:label="@string/reader_title_comments"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="adjustResize|stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.NoSiteToReblogActivity"
@@ -858,7 +858,7 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderSubsActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderPhotoViewerActivity"
@@ -927,7 +927,7 @@
             android:theme="@style/WordPress.NoActionBar" /> <!-- Notifications activities -->
         <activity
             android:name="org.wordpress.android.ui.notifications.NotificationsDetailActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge" /> <!-- People Management -->
+            android:theme="@style/WordPress.NoActionBar" /> <!-- People Management -->
         <activity
             android:name="org.wordpress.android.ui.people.PeopleManagementActivity"
             android:label="@string/users"

Go to https://buildkite.com/automattic/wordpress-android/builds/25499/canvas?sid=019cf86e-7405-4d9f-a33f-036b0828a120, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 16, 2026

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackRelease/base_manifest.txt	2026-03-16 21:02:24.016634929 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackRelease/head_manifest.txt	2026-03-16 21:02:30.216684192 +0000
@@ -7,7 +7,7 @@
 
     <uses-sdk
         android:minSdkVersion="26"
-        android:targetSdkVersion="35" />
+        android:targetSdkVersion="36" />
 
     <uses-permission android:name="org.wordpress.android.permission.DISABLE_NOTIFICATIONS" /> <!-- Normal permissions, access automatically granted to app -->
     <uses-permission android:name="android.permission.VIBRATE" />
@@ -503,7 +503,7 @@
             android:theme="@style/WordPress.ZenDesk" />
         <activity
             android:name="org.wordpress.android.support.SupportWebViewActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge" /> <!-- empty title -->
+            android:theme="@style/WordPress.NoActionBar" /> <!-- empty title -->
         <!-- Preferences activities -->
         <activity
             android:name="org.wordpress.android.ui.about.UnifiedAboutActivity"
@@ -568,7 +568,7 @@
         <activity
             android:name="org.wordpress.android.ui.comments.CommentsDetailActivity"
             android:label="@string/comments"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="adjustResize" />
         <activity
             android:name="org.wordpress.android.ui.comments.unified.UnifiedCommentsDetailsActivity"
@@ -579,7 +579,7 @@
             android:name="org.wordpress.android.ui.posts.EditPostActivity"
             android:configChanges="locale|orientation|screenSize"
             android:exported="false"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="stateHidden|adjustResize" >
             <meta-data
                 android:name="android.support.PARENT_ACTIVITY"
@@ -869,7 +869,7 @@
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderCommentListActivity"
             android:label="@string/reader_title_comments"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="adjustResize|stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.NoSiteToReblogActivity"
@@ -883,7 +883,7 @@
             android:theme="@style/WordPress.NoActionBar" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderSubsActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
+            android:theme="@style/WordPress.NoActionBar"
             android:windowSoftInputMode="stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderPhotoViewerActivity"
@@ -952,7 +952,7 @@
             android:theme="@style/WordPress.NoActionBar" /> <!-- Notifications activities -->
         <activity
             android:name="org.wordpress.android.ui.notifications.NotificationsDetailActivity"
-            android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge" /> <!-- People Management -->
+            android:theme="@style/WordPress.NoActionBar" /> <!-- People Management -->
         <activity
             android:name="org.wordpress.android.ui.people.PeopleManagementActivity"
             android:label="@string/users"

Go to https://buildkite.com/automattic/wordpress-android/builds/25499/canvas?sid=019cf86e-7408-4dc3-b9c0-61a3321e7bf5, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 16, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22695-a777cfa
Build Number1487
Application IDcom.jetpack.android.prealpha
Commita777cfa
Installation URL5lmub9og2ccj8
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 16, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22695-a777cfa
Build Number1487
Application IDorg.wordpress.android.prealpha
Commita777cfa
Installation URL26b8ko5hfqgqg
Note: Google Login is not supported on these builds.

nbradbury and others added 5 commits March 16, 2026 14:32
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With edge-to-edge enforced, statusBarColor is ignored and the
status bar is transparent. Set windowLightStatusBar to true in
the day Zendesk style so icons are dark on the light background.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With edge-to-edge enforced, adjustResize no longer shrinks the
content area automatically. Include ime() in the inset types so
the decorView padding accounts for the keyboard height.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.60%. Comparing base (f662c9e) to head (a777cfa).
⚠️ Report is 5 commits behind head on trunk.

Files with missing lines Patch % Lines
...id/ui/main/EdgeToEdgeActivityLifecycleCallbacks.kt 0.00% 27 Missing ⚠️
...s/src/main/java/org/wordpress/android/WordPress.kt 0.00% 4 Missing ⚠️
...n/java/org/wordpress/android/util/LocaleManager.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22695      +/-   ##
==========================================
- Coverage   37.61%   37.60%   -0.01%     
==========================================
  Files        2272     2273       +1     
  Lines      118379   118405      +26     
  Branches    16370    16372       +2     
==========================================
  Hits        44531    44531              
- Misses      70196    70222      +26     
  Partials     3652     3652              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@nbradbury nbradbury marked this pull request as ready for review March 16, 2026 21:32
@nbradbury nbradbury requested review from adalpari and jkmassel March 16, 2026 21:33
Copy link
Copy Markdown
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

LGTM and I haven't found any error while testing on devices

@nbradbury nbradbury merged commit b7c4ddd into trunk Mar 17, 2026
31 of 33 checks passed
@nbradbury nbradbury deleted the issue/compileSdk36 branch March 17, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants