mirror of
https://codeberg.org/timelimit/opentimelimit-android.git
synced 2025-10-05 10:49:29 +02:00
Fix crash in blocked time area editor
This commit is contained in:
parent
0a08cc7ffa
commit
1808710e0b
1 changed files with 9 additions and 4 deletions
|
@ -233,6 +233,10 @@ class BlockedTimeAreasFragment : Fragment() {
|
|||
|
||||
if (oldValue != newValue) {
|
||||
val currentlyVisiblePosition = layoutManager.findFirstVisibleItemPosition()
|
||||
|
||||
if (currentlyVisiblePosition == RecyclerView.NO_POSITION) {
|
||||
items.value = newValue
|
||||
} else {
|
||||
val currentlyVisibleItem = oldValue!!.getItemAtPosition(currentlyVisiblePosition)
|
||||
val newVisiblePosition = newValue.getPositionOfItem(currentlyVisibleItem)
|
||||
|
||||
|
@ -241,4 +245,5 @@ class BlockedTimeAreasFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue