Better Animations... in Latest Doodle

pusolito

Nicholas Eddy

Posted on June 29, 2024

Better Animations... in Latest Doodle

Animations in Doodle 0.10.2 can be chained within an animation block using the then method. This makes it easier to have sequential animations and avoids the need to explicitly track secondary animations for cancellation, since these are tied to their "parent" animation.

val animation = animate {
    0f to 1f using (tweenFloat(easing, duration)) {                   // (1)
        // ...
    } then {
        0f to 1f using (after(delay, tweenFloat(easing, duration))) { // (2)

        } then {                                                      // (3)
            // ...
        }
    } then {                                                          // (4)
        // ...
    }
}

animation.completed += { /* ... */ }  // applies to entire chain
animation.pause ()                    // applies to entire chain
animation.cancel()                    // applies to entire chain
Enter fullscreen mode Exit fullscreen mode

This release also includes lots of other great features including:

  • Desktop Accessibility Support - Accessibility features now work on Desktop
  • SpinButtons now support basic Accessibility
  • Improved Sliders - Sliders can now represent values of any Comparable type T between two start and end values.
  • Non-linear Sliders

Check out the docs for more details.

Doodle helps you create beautiful, modern apps entirely in Kotlin. Its render model is intuitive yet powerful, making it easy to achieve complex UIs with pixel level precision and layouts. This simplicity and power applies to everything from user input to drag and drop. Doodle lets you build and animate anything.

💖 💪 🙅 🚩
pusolito
Nicholas Eddy

Posted on June 29, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024