feat: Show current interval focus count when tapping the clock

#21
This commit is contained in:
Nishant Mishra
2025-09-08 10:23:53 +05:30
parent 8bcf246d1f
commit ad8929217b
3 changed files with 12 additions and 5 deletions

View File

@@ -258,9 +258,10 @@ fun TimerScreen(
shrinkVertically(motionScheme.defaultSpatialSpec())
) {
Text(
"1 of 4",
"${timerState.currentFocusCount} of ${timerState.totalFocusCount}",
fontFamily = openRundeClock,
style = typography.titleLarge
style = typography.titleLarge,
color = colorScheme.outline
)
}
}

View File

@@ -14,7 +14,9 @@ data class TimerState(
val timerRunning: Boolean = false,
val nextTimerMode: TimerMode = TimerMode.SHORT_BREAK,
val nextTimeStr: String = "5:00",
val showBrandTitle: Boolean = true
val showBrandTitle: Boolean = true,
val currentFocusCount: Int = 1,
val totalFocusCount: Int = 4
)
enum class TimerMode {

View File

@@ -145,7 +145,9 @@ class TimerViewModel(
timeStr = millisecondsToStr(time.value),
totalTime = time.value,
nextTimerMode = if (timerRepository.sessionLength > 1) TimerMode.SHORT_BREAK else TimerMode.LONG_BREAK,
nextTimeStr = millisecondsToStr(if (timerRepository.sessionLength > 1) timerRepository.shortBreakTime else timerRepository.longBreakTime)
nextTimeStr = millisecondsToStr(if (timerRepository.sessionLength > 1) timerRepository.shortBreakTime else timerRepository.longBreakTime),
currentFocusCount = 1,
totalFocusCount = timerRepository.sessionLength
)
}
}
@@ -173,7 +175,9 @@ class TimerViewModel(
timerRepository.longBreakTime
) else millisecondsToStr(
timerRepository.shortBreakTime
)
),
currentFocusCount = cycles / 2 + 1,
totalFocusCount = timerRepository.sessionLength
)
}
} else {