Skip to content

Target API 36 and modernize the build for 2026 Play requirements - #11

Merged
atorch merged 5 commits into
mainfrom
issue-7-modernize-sdk-and-deps
Nov 14, 2026
Merged

atorch merged 5 commits into
mainfrom
issue-7-modernize-sdk-and-deps

Conversation

@atorch

@atorch atorch commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Fixes #7.

Why

Google Play's target API level rules, from August 31, 2026:

  • New apps and app updates must target API 36. At targetSdk 34, Play would reject our next upload.
  • Existing apps must target API 35 or higher to stay available to new users on newer Android versions. Apps targeting 34 or lower are only offered to devices running Android 14 or older, so we're currently hidden from new users on Android 15+ phones.

The "outdated" warnings in #7 (fragment 1.0.0, annotation 1.0.0) come in through appcompat 1.0.2. Upgrading AppCompat fixes them.

Changes

  • SDK: targetSdk 34 → 36, compileSdk 34 → 36, minSdk 16 → 23. AppCompat 1.8 and the rest of AndroidX now require 23.
  • Build:
    • Android Gradle plugin 7.2.2 → 9.5.0 and Gradle 7.3.3 → 9.8.2.
    • jcenter → mavenCentral.
    • plugins {} block and a version catalog (gradle/libs.versions.toml).
    • Removed Jetifier and the proguard-rules.pro reference to a file that doesn't exist.
  • Gradle wrapper: the jar committed in 2023 wasn't an official Gradle jar, and setup-gradle rejected it. It's replaced with the official wrapper, checked against Gradle's published checksums, and the distribution is pinned by SHA-256.
  • Dependencies: AppCompat 1.0.2 → 1.8.0. Removed the unused material, constraintlayout, navigation-*, test libraries and libs/ fileTree.
  • Manifest: removed the unused WRITE_EXTERNAL_STORAGE permission.
  • Edge-to-edge (enforced when targeting 35+, no opt-out at 36). The new SystemBars helper:
    • turns edge-to-edge on with dark system-bar icons, since the theme is always light;
    • top: applies the status bar + action bar inset as a top margin. With EdgeToEdge.enable, AppCompat no longer pushes the content below the action bar; it adds the action bar's height to the top inset instead (found by Copilot's review);
    • navigation bar and cutouts: applies them as padding, so scrolling content can still go behind the translucent navigation bar;
    • keyboard: edge-to-edge stops adjustResize from resizing the window, so it applies the keyboard height as a bottom margin. The ScrollView shrinks to the area above the keyboard, as it did before, and keeps the focused answer field in view. Without this, the field ended up behind the keyboard after a couple of correct answers, the same problem as Fix keyboard covering the answer field on long puzzles probability_puzzles#49. SolvePuzzle also declares adjustResize explicitly.
  • Html.fromHtml → HtmlCompat.fromHtml.
  • CI:
    • JDK 11 → 21, actions/checkout@v7, actions/setup-java@v6, gradle/actions/setup-gradle@v6;
    • runs on every PR, so PRs stacked on this one get CI too.
  • Dependabot: one grouped update PR a month for Gradle dependencies and GitHub Actions.

Testing

  • CI builds green: compile, lint, and unit tasks (there are no tests on this branch yet; Fix blank puzzle screen after the app is recreated #13 adds the first ones).
  • Not yet run on a device. Things to check on a Pixel:
    • the first line of each screen sits just below the action bar, and nothing shows through behind the status bar when scrolling;
    • the end of each scrolling screen clears the navigation bar with 3-button navigation;
    • on a level 2 puzzle, enter four or five countries with Gboard open: the answer field should stay visible above the keyboard;
    • status-bar icons stay dark with the system in dark mode;
    • landscape, including with a camera cutout.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv

Google Play now requires new apps and updates to target API 36. Apps
targeting API 34 or lower, like this one, are no longer offered to new
users on Android 15+ devices.

- targetSdk 34 -> 36, compileSdk 34 -> 36, minSdk 16 -> 23 (AndroidX,
  including AppCompat 1.8, now requires 23)
- AGP 7.2.2 -> 9.5.0, Gradle 7.3.3 -> 9.6.1, jcenter -> mavenCentral,
  plugins block + version catalog (gradle/libs.versions.toml)
- AppCompat 1.0.2 -> 1.8.0. This pulls in current fragment/annotation
  versions, fixing the outdated-SDK warnings in #7.
- Remove unused material, constraintlayout, navigation and test
  dependencies, plus the unused fileTree jars and Jetifier
- Remove the unused WRITE_EXTERNAL_STORAGE permission
- Edge-to-edge (enforced for apps targeting 35+, with no opt-out at 36):
  new SystemBars helper turns it on with dark system-bar icons and pads
  each screen so the navigation bar doesn't cover content
- Html.fromHtml -> HtmlCompat.fromHtml (the old call is deprecated now
  that minSdk is 23)
- CI: JDK 21, checkout@v7, setup-java@v6, gradle/actions/setup-gradle@v6
- Dependabot: one grouped update PR a month for Gradle deps and Actions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv
CI's wrapper validation (on by default in gradle/actions/setup-gradle)
rejected the gradle-wrapper.jar committed in 2023. Its checksum
(e2b82129...) isn't in Gradle's list of official wrapper jars.

The new jar's SHA-256 (3b8a2577...) is the official checksum for the
Gradle 9.8.1 wrapper, as listed in gradle/actions'
wrapper-checksums.json. It, gradlew, gradlew.bat and
gradle-wrapper.properties come from gradle/actions' test fixtures. The
distribution is Gradle 9.8.2, pinned with distributionSha256Sum. AGP
9.5 needs Gradle 9.6 or newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Inset handling omits the action bar’s top inset and keyboard bottom inset, allowing initial content to sit beneath the action bar and the country input to become obscured by the keyboard.

2 open issues
What changed in this PR

Modernizes the Android app for target API 36 and updates AppCompat to address the outdated-library warnings in #7.

Changes:

  • Raises compile/target SDK to 36 and minimum SDK to 23; updates build tooling, dependencies, and repository configuration.
  • Adds shared edge-to-edge handling, adopts HtmlCompat, and removes the unused storage permission.
  • Updates CI, refreshes Gradle wrapper scripts, and adds monthly grouped Dependabot updates.
File Description
settings.gradle Centralizes plugin and dependency repositories.
gradlew.bat Adds the updated Windows wrapper launcher.
gradlew Refreshes the POSIX wrapper launcher.
gradle/​wrapper/​gradle-wrapper.properties Selects Gradle 9.8.2 with checksum verification.
gradle/​libs.versions.toml Defines AppCompat and Android plugin versions.
gradle.properties Updates JVM settings and removes Jetifier.
build.gradle Uses the version-catalog plugin alias.
app/​src/​main/​java/​atorch/​shortestpaths/​SystemBars.java Adds shared edge-to-edge and inset handling.
app/​src/​main/​java/​atorch/​shortestpaths/​SolvePuzzle.java Applies system-bar setup and adopts HtmlCompat.
app/​src/​main/​java/​atorch/​shortestpaths/​MainActivity.java Applies system-bar setup and adopts HtmlCompat.
app/​src/​main/​AndroidManifest.xml Removes the unused storage permission.
app/​build.gradle Updates SDK levels, Java compatibility, and dependencies.
.github/​workflows/​actions.yml Updates actions and uses JDK 21.
.github/​dependabot.yml Groups monthly Gradle and GitHub Actions updates.

Review effort: Balanced

Comment on lines +62 to +63
Insets bars = insets.getInsets(
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in f6b373b, though with a bottom margin equal to the keyboard height rather than adding the keyboard to the padding. A margin shrinks the ScrollView to the area above the keyboard, the same as adjustResize used to. ScrollView then keeps the focused field in view by itself (onSizeChanged, and the TextView's own request to bring its cursor on screen). With padding, ScrollView's visibility check ignores the padded area, so it would treat a field behind the keyboard as already visible (the same problem atorch/probability_puzzles#49 hit). The top-inset comment is fixed in the following commit, as a top margin.


Generated by Claude Code

ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> {
Insets bars = insets.getInsets(
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());
v.setPadding(left + bars.left, top, right + bars.right, bottom + bars.bottom);
…edge

Once the app is drawn edge-to-edge, windowSoftInputMode="adjustResize"
no longer resizes the window when the keyboard opens. On a puzzle with
several countries to enter, the answer field moves down with every
correct answer and ends up behind the keyboard. The released app
(targetSdk 34, not edge-to-edge) doesn't have this problem; the
previous commit would have introduced it.

SystemBars now handles the keyboard's insets itself. It gives the
layout's root a bottom margin equal to the keyboard height, so the
ScrollView shrinks to the area above the keyboard exactly as
adjustResize used to. ScrollView's own logic (onSizeChanged, plus the
focused TextView requesting its cursor on screen) then keeps the field
in view, so no manual scrolling is needed. Navigation bar padding only
covers whatever part of the bar the keyboard doesn't cover.

SolvePuzzle now declares adjustResize explicitly rather than leaving it
to the default ("unspecified"), so the system doesn't also pan the
window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv
EdgeToEdge.enable sets SYSTEM_UI_FLAG_LAYOUT_STABLE. In that mode
AppCompat's ActionBarOverlayLayout doesn't give the content a top margin
for the action bar. It lays the content out from the top of the window
and adds the action bar's height to the top inset it passes down. Since
SystemBars ignored the top inset, the top of each screen would have been
hidden under the action bar. (Found by Copilot's review on PR #11.)

Apply the top inset (status bar + action bar) as a top margin. With
padding, scrolled content would show through the transparent status
bar above the action bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv
Until now CI only ran on PRs into main, so a PR based on another PR's
branch got no build at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HwXCddsMirbBTNqxSqT6iv
@atorch
atorch marked this pull request as ready for review November 14, 2026 04:08
@atorch
atorch merged commit cc205f7 into main Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address warnings about outdated libraries

3 participants