-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps): bump androidGradlePlugin from 8.6.1 to 8.7.0
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
1 parent
7db4ea9
commit 38a1f55
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
common/src/main/java/com/ichi2/anki/common/utils/ext/MutableList.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters