Thread
#compose
    a

    Anton Shilov

    11 months ago
    Hello folks! Is there a way to get the current progress of
    Transition
    on a more granular level rather than current/target state? I'm trying to use
    Transition.playTimeNanos
    and
    Transition.totalDurationNanos
    . But total duration is calculated only in seek mode, which as I assume is reserved for tooling. cc @Doris Liu
    val progress = derivedStateOf {
            if (transition.totalDurationNanos != 0L)
                // total duration is always 0 unles you're in a seek mode
                transition.playTimeNanos / transition.totalDurationNanos
            else 0L
        }
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    11 months ago
    Please don’t @ specific googlers (see the CoC).
    a

    Anton Shilov

    11 months ago
    My bad, won't happen again 🙏
    Doris Liu

    Doris Liu

    11 months ago
    Sorry just saw this - I was on vacation last week. 🙂 What are you trying to achieve with the current progress of a
    Transition
    ? Note that total duration of a Transition is subject to change when the transition gets interrupted. Therefore
    totalDurationNanos
    is more meaningful in the seeking scenario, where
    Transition
    disables its interruption handling mechanism.