Skip to content

Commit

Permalink
build(deps): bump androidGradlePlugin from 8.6.1 to 8.7.0
Browse files Browse the repository at this point in the history
Fixes NewApi warning on `removeLast()`

https://developer.android.com/about/versions/15/behavior-changes-15?hl=en#:~:text=The%20new%20SequencedCollection,has%20been%20disabled.

Bumps `androidGradlePlugin` from 8.6.1 to 8.7.0.

Updates `com.android.application` from 8.6.1 to 8.7.0

Updates `com.android.library` from 8.6.1 to 8.7.0

---
updated-dependencies:
- dependency-name: com.android.application
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.library
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and david-allison committed Oct 2, 2024
1 parent 7db4ea9 commit 38a1f55
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/libanki/sched/DeckNode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.ichi2.libanki.sched

import anki.decks.DeckTreeNode
import com.ichi2.anki.common.utils.ext.removeLastElement
import com.ichi2.libanki.DeckId
import com.ichi2.libanki.utils.append
import java.lang.ref.WeakReference
Expand Down Expand Up @@ -121,7 +122,7 @@ data class DeckNode(
}
if (node.level > 0 && startingLen == list.size) {
// we don't include ourselves if no children matched
list.removeLast()
list.removeLastElement()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2024 David Allison <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* This file incorporates code under the following license:
* MutableCollections.kt
*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*
* Changes:
*
* * renamed 'removeLast' to 'removeLastElement'; removeLast is deprecated in Android 35
* see: https://developer.android.com/about/versions/15/behavior-changes-15?hl=en#:~:text=The%20new%20SequencedCollection,has%20been%20disabled.
*/

package com.ichi2.anki.common.utils.ext

fun <T> MutableList<T>.removeLastElement(): T = if (isEmpty()) throw NoSuchElementException("List is empty.") else removeAt(lastIndex)
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ acra = '5.11.4'
#
# Old changelogs - See 'Table of Contents' in sidebar
# https://developer.android.com/build/releases/past-releases
androidGradlePlugin = "8.6.1"
androidGradlePlugin = "8.7.0"
# https://developer.android.com/jetpack/androidx/releases/activity
androidxActivity = "1.9.2"
# https://developer.android.com/jetpack/androidx/releases/annotation
Expand Down

0 comments on commit 38a1f55

Please sign in to comment.