show a toast at stopping timer or stopwatch if it is running at onDestroy

This commit is contained in:
tibbi 2018-03-09 21:57:49 +01:00
parent b771f05881
commit 5878af2cc5
5 changed files with 12 additions and 0 deletions

View File

@ -100,6 +100,9 @@ class StopwatchFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
if (isRunning) {
context?.toast(R.string.stopwatch_stopped)
}
isRunning = false
updateHandler.removeCallbacks(updateRunnable)
}

View File

@ -69,6 +69,9 @@ class TimerFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
if (isRunning) {
context?.toast(R.string.timer_stopped)
}
isRunning = false
updateHandler.removeCallbacks(updateRunnable)
}

View File

@ -7,6 +7,8 @@
<string name="no_days_selected">No days selected</string>
<string name="alarm">Alarm</string>
<string name="lap">Lap</string>
<string name="stopwatch_stopped">Stopwatch has been stopped</string>
<string name="timer_stopped">Timer has been stopped</string>
<!-- Settings -->
<string name="clock_tab">Relógio</string>

View File

@ -7,6 +7,8 @@
<string name="no_days_selected">Neboli označené žiadne dni</string>
<string name="alarm">Budík</string>
<string name="lap">Okruh</string>
<string name="stopwatch_stopped">Stopky boli zastavené</string>
<string name="timer_stopped">Časovač bol zastavený</string>
<!-- Settings -->
<string name="clock_tab">Okno s časom</string>

View File

@ -7,6 +7,8 @@
<string name="no_days_selected">No days selected</string>
<string name="alarm">Alarm</string>
<string name="lap">Lap</string>
<string name="stopwatch_stopped">Stopwatch has been stopped</string>
<string name="timer_stopped">Timer has been stopped</string>
<!-- Settings -->
<string name="clock_tab">Clock tab</string>