github nacular/doodle v0.11.5
0.11.5

12 days ago

Features

Improved Sliders

Animations

AbstractSliderBehavior and AbstractRangeSliderBehavior now support handle movement animations through new animateHandleMove parameters. The provided animation controls the way handles travel to their new value. These animations do not affect the underlying value of the slider though; it is set instantly still.

These base classes also provide new APIs to indicate when the pointer has pressed or released in a way that causes the handles to adjust.

New marks system

Sliders can now have an arbitrary set of marks that denote specific values. This is an expansion of the previous ticks property, which only supported a uniformly spaced set of values. Marks are added to a Slider (or other variants) using a Marker. Markers define the set of marks and determine which mark is closest to a given value. These APIs are used to provide a set of mark values and in handling snapping behavior.

Snapping has been overhauled as well to make it more flexible. Sliders now take a SnappingPolicy that controls when to snap to the closest mark. This provides a lot of control over snap sensitivity or even selectiveness about which marks can snap.

There are also methods for specifying marks and snapping behavior using a list of values.

New handle bounding-box APIs

Slider and RangeSlider now expose the bounds of their handles. This is useful when trying to place popups to show the current value. These popups are even easier to do now b/c PopupManager's show method now lets you provide a Rectangle relative to the View you are anchoring to--instead of assuming it should be that View's bounds.

Animations using cubic-beziers

Animation easings are simply functions that map a "time" value in the range [0,1] to an output in the same range. This means you could already create any arbitrary easing and even use cubic-beziers to do this. But the latter is non-trivial, so there is now a built-in way to directly use cubic-beziers.

The new cubicBezier function returns an EasingFunction, so it works with all the existing animation APIs. The following lets you play with various curves to see how the affect the animation.

New Accordion control

The Accordion lets you show content in a set of sections that can each be collapsed or expanded individually. Each section rendered using an ItemVisualizer that generates the header View and a separate visualizer that renders the content for the section.

This control is strongly typed, which means it can hold a uniformed type of data. This data can be provided during construction of the accordion, but it is also dynamic and changeable afterward.

This control is intended to be very flexible like TabbedPanel, so it provides a less restrictive API and delegates a lot of decision-making to AccordionBehavior. The basicAccordionBehavior provides a simple implementation with some customization to get started.

Squircles and smooth corners

New smooth and squircle for creating smoothed corners on Rectangles that make it easy to achieve the "squircle" shape.

More flexible popup placement

  • New API in PopupManager that allows positioning a popup relative to a Rectangle within the coordinates of a View

APIs

  • ValueSlider now uses a new Marker API to define where marks (previously ticks) are placed on it.
  • ValueSlider now uses a new SnappingPolicy API to define how it snaps to marks.
  • ValueSlider now has markerChanged and snappingPolicyChanged events for subclasses to notify of these changes.
  • New utilities for creating various Marker and SnappingPolicy values.
  • New extension to mark a ValueSlider using an Iterable.
  • New BasicAccordionBehavior
  • New AnimatableTreeRowIcon to expand capability for basic tree and accordion behaviors
  • New ItemVisualizer<String, C>.invoke method to visualize a value as a String.
  • New Color.grayScale extension property to replace Color.grayScale() extension method.
  • New ColorPaint.inverted property to create a new paint based on the inverted color.
  • New ColorPaint.grayScale extension property to replace ColorPaint.grayScale() extension method.
  • New Photo.aspectRatio property
  • New Renderer.horizontalLine and Renderer.verticalLine methods.
  • New extensions to create a Stroke from a Color and Paint.
  • BasicSwitchBehavior now takes a lambda that allows control of transition animation.
  • BasicSelectBoxBehavior and BasicMutableSelectBoxBehavior now has color mappers for list and button hovers
  • Object versions of several ItemVisualizers to make them easier to use. The constructor forms of some are now deprecated.
  • New Rectangle.smooth extension that creates a superellipse path from a rectangle.
  • New Slider.handleRectangle property that gives the current bounds of the handle/knob.
  • BasicCircularSliderBehavior new showTicks and startAngle constructor params
  • BasicCircularRangeSliderBehavior new showTicks and startAngle constructor params
  • nativeSliderBehavior (Web) now supports ticks, enabled via showTicks parameter
  • New APIs in AbstractSliderBehavior and AbstractRangeSliderBehavior to indicate when a slider's handles are "pressed" and "released".
  • New RangeSlider.handleRectangle property that gives the current bounds of the handle/knob.
  • SliderBehavior now has handleBounds method
  • RangeSliderBehavior now has startHandleBounds and endHandleBounds methods
  • AbstractSliderBehavior now supports animation of value changes through animateHandleMove constructor parameter
  • AbstractRangeSliderBehavior now supports animation of value changes through animateHandleMove constructor parameter
  • AbstractCircularSliderBehavior.startAngle for subclasses
  • AbstractCircularRangeSliderBehavior.startAngle for subclasses
  • Photo now allows a radius to be specified to round its corners.
  • LabelBehavior now has a measureText method that takes an assumed width that should be used instead of the label's current width
  • New native behaviors for Label that use the system default font
  • Color.darker, Color.lighter, HslColor.darker and HslColor.lighter are now infix.
  • New HslColor.opacity extension to get a new color with the specified opacity
  • New HsvColor.lightness extension

Fixes | Improvements

  • General

    • Issue where BasicSliderBehavior still showing ticks when showTicks == null
    • Slider and RangeSlider now delegate calls to contains to their behavior instead of checking super first.
    • Issue where Label did not return an updated preferredSize with wrapsWords enabled
    • Updated SliderTests to validate new marker functionality
    • New RangeSliderTests to validate new marker functionality
  • Docs

    • Added basic docs for GenericTextEditOperation
    • Fixed docs for KeyValueTable

Versions

  • Measured -> 0.4.2

Don't miss a new doodle release

NewReleases is sending notifications on new releases.