mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-24 16:51:07 +01:00
Fix warning 1.5: 'sumBy((T) -> Int): Int' is deprecated
This commit is contained in:
parent
babbcedd87
commit
4a94426d38
@ -291,7 +291,7 @@ internal class DefaultFileService @Inject constructor(
|
||||
Timber.v("Get size of ${it.absolutePath}")
|
||||
true
|
||||
}
|
||||
.sumBy { it.length().toInt() }
|
||||
.sumOf { it.length().toInt() }
|
||||
}
|
||||
|
||||
override fun clearCache() {
|
||||
|
@ -131,5 +131,5 @@ fun getSizeOfFiles(root: File): Int {
|
||||
Timber.v("Get size of ${it.absolutePath}")
|
||||
true
|
||||
}
|
||||
.sumBy { it.length().toInt() }
|
||||
.sumOf { it.length().toInt() }
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class MatrixItemColorProvider @Inject constructor(
|
||||
|
||||
@ColorRes
|
||||
private fun getColorFromRoomId(roomId: String?): Int {
|
||||
return when ((roomId?.toList()?.sumBy { it.code } ?: 0) % 3) {
|
||||
return when ((roomId?.toList()?.sumOf { it.code } ?: 0) % 3) {
|
||||
1 -> R.color.riotx_avatar_fill_2
|
||||
2 -> R.color.riotx_avatar_fill_3
|
||||
else -> R.color.riotx_avatar_fill_1
|
||||
|
@ -221,7 +221,7 @@ class EmojiRecyclerAdapter @Inject constructor(
|
||||
}
|
||||
|
||||
override fun getItemCount() = dataSource.rawData.categories
|
||||
.sumBy { emojiCategory -> 1 /* Section */ + emojiCategory.emojis.size }
|
||||
.sumOf { emojiCategory -> 1 /* Section */ + emojiCategory.emojis.size }
|
||||
|
||||
abstract class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
abstract fun bind(s: String?)
|
||||
|
Loading…
Reference in New Issue
Block a user