Skip to content

Update build to Gradle 9 / AGP 9, add CI with tests, Dependabot and max lines limit - #11

Merged
simonebortolin merged 2 commits into
masterfrom
ccr-32b0b815-02w9qq
Oct 23, 2026
Merged

simonebortolin merged 2 commits into
masterfrom
ccr-32b0b815-02w9qq

Conversation

@simonebortolin

@simonebortolin simonebortolin commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Brings FlowLayoutManager in line with MaterialSeekArc (toolchain, CI/CD, Dependabot), cleans the repository and merges the useful changes from the forks. minSdk stays at 21, as low as the dependencies allow.

Two commits: the build/CI/tests/cleanup update, and the max lines limit feature.

Build & dependencies

  • Gradle wrapper 9.8.2, AGP 9.4.0, version catalog (gradle/libs.versions.toml), Java 17, compileSdk/targetSdk 37, namespace in build.gradle
  • The library depends only on RecyclerView 1.4.0 (api, it is part of the public API); published with maven-publish instead of the dead Bintray plugin; jitpack.yml for JDK 17
  • MIN_SDK=21 in gradle.properties, shared by library and sample app. The sample uses only framework widgets + RecyclerView (AppCompat 1.8 and Material 1.14 require minSdk 23), so a dependency update that needs a higher minSdk fails the build instead of raising it silently
  • VERSION_NAME 1.9.0

CI/CD (.github/workflows/ci.yml)

Stages, each one needs the previous: Resolve Version → Test → Build → Tag & Release (same structure as npoi).

  • Test: Robolectric unit tests on SDK 23 (lowest Robolectric supports since 4.16) and SDK 37, JDK 21 (with --add-opens for java.io and jdk.internal.access, needed by Robolectric on recent SDKs); JUnit results uploaded as junit-sdk<N> artifacts
  • Test report: runs also when the tests fail and publishes the junit-sdk<N> artifacts with dorny/test-reporter as one "Unit Tests Result (SDK N)" check run per SDK
  • Build: library AAR, sample APK (signed when the keystore secrets are set), sources jar via publishToMavenLocal
  • Release (master only): tag VERSION_NAME, GitHub Release with AAR, APK, SHA256SUMS and build provenance attestation
  • Dependabot weekly for Gradle and GitHub Actions

Tests

  • CacheHelperTest (13 tests) moved from instrumentation (never run, it needed an emulator) to JVM unit tests
  • New FlowLayoutManagerTest: visible lines, items per line, right alignment, max lines (layout, scrolling past the limit, removing the limit)

Max lines limit

maxLines(int), removeMaxLinesLimit() and FlowLayoutManager(int maxLines), based on the davidleen fork. Unlike the fork, scrolling and predictive layout do not add lines past the limit either, and the view past the limit is recycled. The sample app has a "Max lines" demo.

Forks

Fork Merged
davidleen max lines limit (reworked as above)
hees-k if/else instead of switch on non-final R ids
idindevelop android:exported="true" on the launcher activity
FishAngler not merged: minSdk 19 needs RecyclerView 1.3.x

Cleanup

Removed FlowLayoutManager.zip, gradlew.bat, the nested Gradle wrapper in the library module, empty proguard files, boilerplate tests and unused resources; screenshots moved to art/; README updated (badges, installation, max lines, build, credits).

Known, not changed here

With LEFT/RIGHT alignment computeVerticalScroll* (scrollbar metrics) are item-count based, so RecyclerView.canScrollVertically() can report scrollable at the end of the list; the tests use FlowLayoutManager.canScrollVertically(direction). Pre-existing, can be a follow-up.

Test plan

  • CacheHelperTest run locally with plain JUnit and pure-Java stand-ins for Point/SparseArray: 13/13 pass
  • CI: Robolectric tests on SDK 23 and SDK 37: 19/19 pass on both
  • CI: library AAR and sample APK build
  • CI: "Unit Tests Result (SDK 23/37)" check runs from the Test report job

🤖 Generated with Claude Code

https://claude.ai/code/session_016qFN7YvhK7tdTyvUb24JH5

@simonebortolin
simonebortolin force-pushed the ccr-32b0b815-02w9qq branch 7 times, most recently from 074cda1 to 0e74848 Compare October 23, 2026 23:19
Build
- Gradle wrapper 9.8.2, AGP 9.4.0, version catalog, Java 17,
  compileSdk/targetSdk 37, namespace in build.gradle
- Library depends only on RecyclerView 1.4.0 (api), published with
  maven-publish instead of the dead Bintray plugin; jitpack.yml for JDK 17
- MIN_SDK=21 shared by library and sample app: the sample uses only
  framework widgets and RecyclerView (AppCompat 1.8 and Material 1.14
  require minSdk 23), with if/else on non-final R ids (hees-k fork) and
  an exported launcher activity (idindevelop fork)

CI/CD
- Resolve Version -> Test -> Build -> Tag & Release, each stage needs the
  previous one
- Robolectric unit tests on SDK 23 and 37 with JDK 21, JUnit results
  published as a check run per SDK
- Library AAR and sample APK, released with checksums and provenance
- Dependabot for Gradle and GitHub Actions

Tests
- CacheHelperTest moved from instrumentation to JVM unit tests
- FlowLayoutManagerTest for visible lines, items per line and alignment

Cleanup
- Remove FlowLayoutManager.zip, gradlew.bat, the nested wrapper in the
  library module, empty proguard files, boilerplate tests and unused
  resources; move screenshots to art/; update README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qFN7YvhK7tdTyvUb24JH5
maxLines(int), removeMaxLinesLimit() and FlowLayoutManager(int maxLines),
based on the davidleen fork. Unlike the fork, scrolling and predictive
layout do not add lines past the limit either, and the view past the
limit is recycled.

- Tests for the layout, scrolling past the limit and removing it
- Max lines demo in the sample app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qFN7YvhK7tdTyvUb24JH5
@simonebortolin
simonebortolin merged commit 60137f4 into master Oct 23, 2026
3 checks passed
@simonebortolin
simonebortolin deleted the ccr-32b0b815-02w9qq branch October 25, 2026 17:29
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.

2 participants