upgrade kotlin to 1.5.0 (#2162)

* upgrade kotlin to 1.5.0

* don't explicitly set kotlin jvmtarget
This commit is contained in:
Konrad Pozniak 2021-05-21 17:51:35 +02:00 committed by GitHub
parent 9c9f8ebf2c
commit 751109ac39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 10 deletions

View File

@ -83,9 +83,6 @@ android {
enableSplit = false
}
}
kotlinOptions {
jvmTarget = '1.8'
}
}
ext.lifecycleVersion = "2.2.0"

View File

@ -30,7 +30,7 @@ class EmojiAdapter(
) : RecyclerView.Adapter<BindingHolder<ItemEmojiButtonBinding>>() {
private val emojiList : List<Emoji> = emojiList.filter { emoji -> emoji.visibleInPicker == null || emoji.visibleInPicker }
.sortedBy { it.shortcode.toLowerCase(Locale.ROOT) }
.sortedBy { it.shortcode.lowercase(Locale.ROOT) }
override fun getItemCount() = emojiList.size

View File

@ -351,11 +351,11 @@ class ComposeViewModel @Inject constructor(
':' -> {
val emojiList = emoji.value ?: return emptyList()
val incomplete = token.substring(1).toLowerCase(Locale.ROOT)
val incomplete = token.substring(1).lowercase(Locale.ROOT)
val results = ArrayList<ComposeAutoCompleteAdapter.AutocompleteResult>()
val resultsInside = ArrayList<ComposeAutoCompleteAdapter.AutocompleteResult>()
for (emoji in emojiList) {
val shortcode = emoji.shortcode.toLowerCase(Locale.ROOT)
val shortcode = emoji.shortcode.lowercase(Locale.ROOT)
if (shortcode.startsWith(incomplete)) {
results.add(ComposeAutoCompleteAdapter.EmojiResult(emoji))
} else if (shortcode.indexOf(incomplete, 1) != -1) {

View File

@ -65,7 +65,7 @@ class AccountManager @Inject constructor(db: AppDatabase) {
val maxAccountId = accounts.maxByOrNull { it.id }?.id ?: 0
val newAccountId = maxAccountId + 1
activeAccount = AccountEntity(id = newAccountId, domain = domain.toLowerCase(Locale.ROOT), accessToken = accessToken, isActive = true)
activeAccount = AccountEntity(id = newAccountId, domain = domain.lowercase(Locale.ROOT), accessToken = accessToken, isActive = true)
}

View File

@ -31,8 +31,6 @@ import com.keylesspalace.tusky.entity.Emoji
import java.lang.ref.WeakReference
import java.util.regex.Pattern
import androidx.preference.PreferenceManager
import com.keylesspalace.tusky.settings.PrefKeys
/**
* replaces emoji shortcodes in a text with EmojiSpans

View File

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.4.31'
ext.kotlin_version = '1.5.0'
repositories {
google()
jcenter()