Skip to content

Commit

Permalink
fix: removeAt instead of removeLast for SDK <35 compatibility (#226)
Browse files Browse the repository at this point in the history
Run Android instrumentation tests against API levels 24 and 35, and fix a compatibility issue by using removeAt instead of removeLast.

fixes #224
  • Loading branch information
sargunv authored Jan 3, 2025
1 parent 8e7c97e commit abf9996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:

test-android:
runs-on: "ubuntu-latest"
strategy:
matrix:
api-level:
- 24
- 35
steps:
- uses: "actions/checkout@v4"
with:
Expand All @@ -57,7 +62,7 @@ jobs:
- name: "Run with AVD ./gradlew connectedDebugAndroidTest"
uses: "./.github/actions/run-with-avd"
with:
api-level: 35
api-level: "${{ matrix.api-level }}"
script: "./gradlew connectedDebugAndroidTest"

test-ios:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ internal class LayerManager(private val styleNode: StyleNode) {
// anything left in missedLayers is a new anchor
missedLayers.forEach { (anchor, nodes) ->
// let's initialize the anchor with one layer
val tail = nodes.removeLast()
val tail = nodes.removeAt(nodes.size - 1)
styleNode.logger?.i { "Initializing anchor $anchor with layer ${tail.layer.id}" }
when (anchor) {
is Anchor.Top -> styleNode.style.addLayer(tail.layer)
Expand Down

0 comments on commit abf9996

Please sign in to comment.