mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-03-04 11:38:01 +01:00
clone items in the adapter, do not use the object itself
This commit is contained in:
parent
a20e1ce8f9
commit
d4de429898
@ -48,7 +48,8 @@ class StopwatchAdapter(activity: SimpleActivity, var laps: ArrayList<Lap>, recyc
|
||||
|
||||
fun updateItems(newItems: ArrayList<Lap>) {
|
||||
lastLapId = 0
|
||||
laps = newItems
|
||||
laps = newItems.clone() as ArrayList<Lap>
|
||||
laps.sort()
|
||||
notifyDataSetChanged()
|
||||
finishActMode()
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ class StopwatchFragment : Fragment() {
|
||||
lapTicks = 0
|
||||
laps.clear()
|
||||
updateIcons()
|
||||
stopwatchAdapter.updateItems(laps)
|
||||
|
||||
view.apply {
|
||||
stopwatch_reset.beGone()
|
||||
|
Loading…
x
Reference in New Issue
Block a user