2026-03-10 23:34:07 -05:00
|
|
|
package com.mindmachine.mvp.session
|
|
|
|
|
|
|
|
|
|
import com.mindmachine.mvp.domain.RuntimeState
|
|
|
|
|
|
|
|
|
|
fun shouldShowActiveControlsByDefault(runtimeState: RuntimeState): Boolean {
|
|
|
|
|
return runtimeState != RuntimeState.RUNNING && runtimeState != RuntimeState.COUNTDOWN
|
|
|
|
|
}
|
2026-03-21 23:01:02 -05:00
|
|
|
|
|
|
|
|
fun sessionProgressFraction(durationSec: Int, remainingSec: Int): Float {
|
|
|
|
|
val total = durationSec.coerceAtLeast(1)
|
|
|
|
|
val elapsed = (total - remainingSec).coerceIn(0, total)
|
|
|
|
|
return elapsed.toFloat() / total.toFloat()
|
|
|
|
|
}
|