show the Lap button only when appropriate

This commit is contained in:
tibbi
2018-03-07 20:07:32 +01:00
parent a54fe11821
commit 2ef7285764
2 changed files with 11 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import android.view.ViewGroup
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.formatStopwatchTime
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
import com.simplemobiletools.commons.extensions.updateTextColors
@ -49,6 +50,11 @@ class StopwatchFragment : Fragment() {
setupStopwatch()
}
override fun onDestroy() {
super.onDestroy()
updateHandler.removeCallbacksAndMessages(null)
}
private fun setupStopwatch() {
stopwatch_time.text = currMS.formatStopwatchTime()
setupViews()
@ -71,5 +77,6 @@ class StopwatchFragment : Fragment() {
private fun togglePlayPause() {
isRunning = !isRunning
updatePlayPauseIcon()
view.stopwatch_lap.beVisibleIf(isRunning)
}
}