DEV Community

Cover image for Doodle 0.6.3 Released
Nicholas Eddy
Nicholas Eddy

Posted on

1

Doodle 0.6.3 Released

Strongly Typed Sliders

ValueSlider, Slider and CircularSlider were previously tied to a Double. This meant it was not easy to force use cases where integer values would be more appropriate. This is now fixed, as these controls are now strongly typed to a numeric value instead of only supporting Double.

val slider = Slider(10 .. 20)
slider.value = 11.2 // will not compile since slider has a type of Int
Enter fullscreen mode Exit fullscreen mode

More Flexible Layouts

Layouts are generally triggered whenever their container's size changes or a child of the container has a bounds change. But there are cases when this default behavior does not work as well. A good example is a Layout that depends on a child's idealSize. Such a Layout won't be invoked when the idealSizes change, and will be out of date in some cases.

This is now fixed by giving Layouts a chance to act when min/ideal-size changes for children of a Container. There are actually 3 new APIs that provide a lot of flexibility in how Layouts behave.

public fun requiresLayout(container: PositionableContainer, old: Size, new: Size): Boolean = true
public fun requiresLayout(child: Positionable, of: PositionableContainer, old: Rectangle, new: Rectangle): Boolean = false
public fun requiresLayout(child: Positionable, of: PositionableContainer, old: SizePreferences, new: SizePreferences): Boolean = false
Enter fullscreen mode Exit fullscreen mode

Form Controls

  • New switch and switchList form controls
  • New spinner form control
  • New framed form control to wrap other controls in a configurable container
  • radioList, checkList, named and labeled form controls now allow a custom renderer and insets for their container
  • sub-forms now allow custom Insets and behavior
  • New check form control with arbitrary view as annotation

Doodle is a pure Kotlin UI framework for the Web (and Desktop), that lets you create rich applications without relying on Javascript, HTML or CSS. Check out the documentation and tutorials to learn more.

Top comments (0)

Sentry mobile image

App store rankings love fast apps - mobile vitals can help you get there

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read full post →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay