mirror of
				https://github.com/SimpleMobileTools/Simple-Clock.git
				synced 2025-06-05 22:19:17 +02:00 
			
		
		
		
	clone items in the adapter, do not use the object itself
This commit is contained in:
		@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user