Skip to content

Commit 8f22452

Browse files
committed
feat(ui): smoothen timer progress by increasing update rate
1 parent e1fa6c2 commit 8f22452

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

app/src/main/java/org/nsh07/pomodoro/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ class MainActivity : ComponentActivity() {
9393
override fun onStart() {
9494
super.onStart()
9595
// Increase the timer loop frequency again when visible to make the progress smoother
96-
appContainer.appTimerRepository.timerFrequency = 10f
96+
appContainer.appTimerRepository.timerFrequency = 60f
9797
}
9898
}

app/src/main/java/org/nsh07/pomodoro/data/TimerRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AppTimerRepository : TimerRepository {
5454
override var shortBreakTime = 5 * 60 * 1000L
5555
override var longBreakTime = 15 * 60 * 1000L
5656
override var sessionLength = 4
57-
override var timerFrequency: Float = 10f
57+
override var timerFrequency: Float = 60f
5858
override var alarmEnabled = true
5959
override var vibrateEnabled = true
6060
override var dndEnabled: Boolean = false

app/src/main/java/org/nsh07/pomodoro/ui/AlwaysOnDisplay.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fun SharedTransitionScope.AlwaysOnDisplay(
113113
}
114114

115115
onDispose {
116-
setTimerFrequency(10f)
116+
setTimerFrequency(60f)
117117
window.clearFlags(
118118
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON or
119119
WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON

app/src/main/java/org/nsh07/pomodoro/ui/timerScreen/viewModel/TimerViewModel.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ class TimerViewModel(
116116
)
117117
).toUri()
118118

119-
preferenceRepository.getBooleanPreference("aod_enabled")
120-
?: preferenceRepository.saveBooleanPreference("aod_enabled", false)
121-
122119
_time.update { timerRepository.focusTime }
123120
cycles = 0
124121
startTime = 0L

0 commit comments

Comments
 (0)