Replace MathUtils.clamp with Kotlin coerceIn

This commit is contained in:
TacoTheDank 2023-09-19 16:32:37 -04:00
parent 725c18eada
commit b1faed586d
3 changed files with 12 additions and 13 deletions

View file

@ -38,7 +38,6 @@ import android.view.ViewGroup
import android.widget.Button
import androidx.appcompat.app.AlertDialog
import androidx.core.content.edit
import androidx.core.math.MathUtils
import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import androidx.lifecycle.ViewModelProvider
@ -589,7 +588,7 @@ class FeedFragment : BaseStateFragment<FeedState>() {
// state until the user scrolls them out of the visible area which causes a update/bind-call
groupAdapter.notifyItemRangeChanged(
0,
MathUtils.clamp(highlightCount, lastNewItemsCount, groupAdapter.itemCount)
highlightCount.coerceIn(lastNewItemsCount, groupAdapter.itemCount)
)
if (highlightCount > 0) {